0

I just achieved (in testing phase) an open source C CometD library in C. After some time I thought that it would be a good idea to give the option to the user to benefit from it under Xcode for iOS development.

Two years ago I developed a little application in Objective-C and as far as I remember, I could put C code and compile it.

So I took my code and compile it as a .dylib.

The Problem is when i try to use it under an Objective-C Xcode project, at function calling i always get a : - "implicit declaration error is invalid in C99" error as well as a - "Source file is not valid UTF-8" error

I searched the internet to find out why but no relevant answers were found.

Any help would be much appreciated.

Robotic Cat
  • 5,899
  • 4
  • 41
  • 58
Hakeem El Bakka-lee
  • 756
  • 1
  • 7
  • 23
  • `implicit declaration error is invalid in C99` usually means that the function you are trying to call isn't defined. Did you include the correct header file? It would be helpful if you included your objective c code. – duncanc4 Jul 09 '15 at 03:50
  • I don't have any Objective-C code, i just finished the C library and was hoping that it can work immediately under a Xcode generated Objective-c project, which it doesn't. I have, i guess, included properly the .so in the "Build Phases"->Link Binary With Libraries and added my .so there. Do i have to do something else ? I don't know. i found only very few documentation about this subject on the internet, which doesn't covert my issue or does't help me at all. – Hakeem El Bakka-lee Jul 10 '15 at 09:58
  • Is it possible c library needs other libraries linked in? – duncanc4 Jul 11 '15 at 02:37
  • Yes as the Jansson library as well as the Curl library. Does it put sand into gears ? – Hakeem El Bakka-lee Jul 13 '15 at 08:41
  • Those libraries will need to be linked in at some point. I don't know if you can do it in Xcode, or if it should be done before hand when you compile your library. – duncanc4 Jul 14 '15 at 03:55
  • I found a way, i just downloaded the source code of the two libraries, and include it the hard way on the program and it worked well :). – Hakeem El Bakka-lee Jul 27 '15 at 12:14

0 Answers0