manuelBetancurt
manuelBetancurt

Reputation: 16128

compiling *.h files in objective c Linux

Im learning objective C (using a mac in my work) In my house I only have a Linux box, I'm using it to compile the objective c, so far its been a good path, but now, I got to the stage of using the interface *.h file in a different file than the *.m, I was using

gcc `gnustep-config --objc-flags` -lgnustep-base 6_header.m -o 6_header

to compile the programs for testing, but it doesnt work it a separate .h file, what to add? or change?

thank you!

Upvotes: 0

Views: 356

Answers (1)

jbenet
jbenet

Reputation: 3060

Your .h file should get included correctly from the .m. Just make sure the .m has #import "some_file.h".

Also, just like in regular C, the .h should be in the same directory. If not, you can pass -I/some/other/path to look for .h's inside /some/other/path

Upvotes: 2

Related Questions