I'd like to use some C++ code in an Xcode project but I don't understand either language well enough yet to know how to proceed. I've been at the Obj-C for a while and have an app on the app store, but still learning...
The code I want to use has two files with the same name and .h
and .c
extensions. I would think they correspond to .h
and .m
files in Obj-C, but they lack the @interface
and @implementation
structure I'm familiar with. And there's a main.c
that I don't know what to do with. It looks like it's the main program - should I try to pull its code out into my primary viewController
?
Maybe a link to a good tutorial? Maybe this question's too vague...
FYI - the code I want to use is for calculating sunrise and sunset times, and is located at: http://www.risacher.org/sunwait/
Thanks!
EDIT:
Thanks for the suggestions - I will probably have to do some more learning before I get this. But I made some progress...
In main.c
(seems weird to have a file called that...) there is a function(?) like this:
int mainFunction(int argc, char *argv[])
{
// a bunch of function-y stuff
}
It was called main
but I changed it to mainFunction
to get rid of an error. Now it compiles and I can call it but the compiler warns me thus: warning: implicit declaration of function 'mainFunction'
and it crashes after I call it.