Problems with compile
I am trying to compile the following code Environment: Ubuntu 11.04 x64 int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh Finally I create the following GNUMakeFile... include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.make But when I try running I get the following message... ~/Development/Code/personal/GnuStep/helloWorld$ make This is gnustep-make 2.6.1. Type 'make print-gnustep-make-help' for help. Making all for tool LogTest... Compiling file source.m ... source.m: In function ‘main’: source.m:36:3: error: cannot find interface declaration for ‘NXConstantString’ make[3]: *** [obj/LogTest.obj/source.m.o] Error 1 make[2]: *** [internal-tool-all_] Error 2 make[1]: *** [LogTest.all.tool.variables] Error 2 make: *** [internal-all] Error 2 the ls for the folder is... :/usr/GnuStep# ls bin share Any help would be very appreciated. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Problem with compile
I am trying to compile the following code Environment: Ubuntu 11.04 x64 int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh Finally I create the following GNUMakeFile... include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.make But when I try running I get the following message... ~/Development/Code/personal/GnuStep/helloWorld$ make This is gnustep-make 2.6.1. Type 'make print-gnustep-make-help' for help. Making all for tool LogTest... Compiling file source.m ... source.m: In function ‘main’: source.m:36:3: error: cannot find interface declaration for ‘NXConstantString’ make[3]: *** [obj/LogTest.obj/source.m.o] Error 1 make[2]: *** [internal-tool-all_] Error 2 make[1]: *** [LogTest.all.tool.variables] Error 2 make: *** [internal-all] Error 2 the ls for the folder is... :/usr/GnuStep# ls bin share Any help would be very appreciated. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Problem with compile
Hey, To use NSLog, NSString, and even constant strings (@), you need to import the GNUstep base headers. Adding: #import Foundation/Foundation.h to the top of your source.m file should fix the problem. :-) Eric On 2011-09-24, at 10:56 AM, Jackie Gleason wrote: I am trying to compile the following code Environment: Ubuntu 11.04 x64 int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh Finally I create the following GNUMakeFile... include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.make But when I try running I get the following message... ~/Development/Code/personal/GnuStep/helloWorld$ make This is gnustep-make 2.6.1. Type 'make print-gnustep-make-help' for help. Making all for tool LogTest... Compiling file source.m ... source.m: In function ‘main’: source.m:36:3: error: cannot find interface declaration for ‘NXConstantString’ make[3]: *** [obj/LogTest.obj/source.m.o] Error 1 make[2]: *** [internal-tool-all_] Error 2 make[1]: *** [LogTest.all.tool.variables] Error 2 make: *** [internal-all] Error 2 the ls for the folder is... :/usr/GnuStep# ls bin share Any help would be very appreciated. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Problem with compile
Hm, I'm not sure what is going on. Your install procedure looks correct and I've used a very similar procedure on Ubuntu 11.04 successfully. Here's another test program you could try which avoids constant strings: #import Foundation/Foundation.h #include stdio.h int main(int argc, const char **argv) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; printf(testing NSNumber: %d\n, [[NSNumber numberWithInt: 3] intValue]); [pool release]; return 0; } Also, could you try running make with make messages=yes? This will log the full command line used to run gcc. How did you install the objective-C compiler and runtime? Just through the gobjc package? -Eric On 2011-09-25, at 11:03 AM, Jackie Gleason wrote: Sorry, I was trying not to send the whole code, probably should have included that. Anyway still looking for an answer, I believe it has something to do with the way I am compiling from source since I don't see a Libraries folder under /usr/GnuStep #include stdio.h #import Foundation/Foundation.h /* * The next #include line is generally present in all Objective-C * source files that use GNUstep. The Foundation.h header file * includes all the other standard header files you need. */ /* * Declare the Test class that implements the class method (classStringValue). */ @interface Test + (const char *) classStringValue; @end /* * Define the Test class and the class method (classStringValue). */ @implementation Test + (const char *) classStringValue; { return This is the string value of the Test class; } @end /* * The main() function: pass a message to the Test class * and print the returned string. */ int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } Same issue is still happening On Sun, Sep 25, 2011 at 12:51 PM, Eric Wasylishen ewasylis...@gmail.com wrote: Hey, To use NSLog, NSString, and even constant strings (@), you need to import the GNUstep base headers. Adding: #import Foundation/Foundation.h to the top of your source.m file should fix the problem. :-) Eric On 2011-09-24, at 10:56 AM, Jackie Gleason wrote: I am trying to compile the following code Environment: Ubuntu 11.04 x64 int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh Finally I create the following GNUMakeFile... include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.make But when I try running I get the following message... ~/Development/Code/personal/GnuStep/helloWorld$ make This is gnustep-make 2.6.1. Type 'make print-gnustep-make-help' for help. Making all for tool LogTest... Compiling file source.m ... source.m: In function ‘main’: source.m:36:3: error: cannot find interface declaration for ‘NXConstantString’ make[3]: *** [obj/LogTest.obj/source.m.o] Error 1 make[2]: *** [internal-tool-all_] Error 2 make[1]: *** [LogTest.all.tool.variables] Error 2 make: *** [internal-all] Error 2 the ls for the folder is... :/usr/GnuStep# ls bin share Any help would be very appreciated. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Problem with compile
Sorry, I was trying not to send the whole code, probably should have included that. Anyway still looking for an answer, I believe it has something to do with the way I am compiling from source since I don't see a Libraries folder under /usr/GnuStep #include stdio.h #import Foundation/Foundation.h /* * The next #include line is generally present in all Objective-C * source files that use GNUstep. The Foundation.h header file * includes all the other standard header files you need. */ /* * Declare the Test class that implements the class method (classStringValue). */ @interface Test + (const char *) classStringValue; @end /* * Define the Test class and the class method (classStringValue). */ @implementation Test + (const char *) classStringValue; { return This is the string value of the Test class; } @end /* * The main() function: pass a message to the Test class * and print the returned string. */ int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } Same issue is still happening On Sun, Sep 25, 2011 at 12:51 PM, Eric Wasylishen ewasylis...@gmail.comwrote: Hey, To use NSLog, NSString, and even constant strings (@), you need to import the GNUstep base headers. Adding: #import Foundation/Foundation.h to the top of your source.m file should fix the problem. :-) Eric On 2011-09-24, at 10:56 AM, Jackie Gleason wrote: I am trying to compile the following code Environment: Ubuntu 11.04 x64 int main(void) { NSString* s = @Hello, world!; NSLog(s); //printf(%s\n, [Test classStringValue]); return 0; } I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh Finally I create the following GNUMakeFile... include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.make But when I try running I get the following message... ~/Development/Code/personal/GnuStep/helloWorld$ make This is gnustep-make 2.6.1. Type 'make print-gnustep-make-help' for help. Making all for tool LogTest... Compiling file source.m ... source.m: In function ‘main’: source.m:36:3: error: cannot find interface declaration for ‘NXConstantString’ make[3]: *** [obj/LogTest.obj/source.m.o] Error 1 make[2]: *** [internal-tool-all_] Error 2 make[1]: *** [LogTest.all.tool.variables] Error 2 make: *** [internal-all] Error 2 the ls for the folder is... :/usr/GnuStep# ls bin share Any help would be very appreciated. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Problems with compile
Hi Jackie, Your code and makefile both look correct, but you're missing one line at the beginning of source.m: #include Foundation/Foundation.h Hope this helps, -Truls ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Problem with compile
I did use the prefix option but I also tried without but I can try again otherwise that is the order I did things. The weird thing is when I install gnumake it installs into a directory like the following... /usr/GNUstep/share/GNUstep/MakeFiles I am wondering if there is an issue there. Thanks to everyone for all of their help. On Sep 25, 2011 4:58 PM, Richard Frith-Macdonald rich...@tiptree.demon.co.uk wrote: On 24 Sep 2011, at 17:56, Jackie Gleason wrote: I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh I'm not sure if you actually did exactly what you said ... but that's not what the HOWTOs tell you to do, and may well account for things being rather messed up. The correct order to do things in is: 1. Configure and install make (you can use the --prefix option for this if you want) 2. Source the GNUstep.sh script to set up your environment 3. Configure, build and install the other packages *without* using --prefix The reason for this order is that everything apart from make is designed to be handled by gnustep-make, and the build process will take care of installing stuff in the correct place depending on how the make package was configured. If you use --prefix= with the other packages, you will probably be overriding the correct locations, and putting things where they are not expected (so headers/libraries won't be found later when you try to use them). ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Problem with compile
I retried everything without using --prefix and no dice. Jackie On Sun, Sep 25, 2011 at 5:07 PM, Jackie Gleason jackieglea...@gmail.comwrote: I did use the prefix option but I also tried without but I can try again otherwise that is the order I did things. The weird thing is when I install gnumake it installs into a directory like the following... /usr/GNUstep/share/GNUstep/MakeFiles I am wondering if there is an issue there. Thanks to everyone for all of their help. On Sep 25, 2011 4:58 PM, Richard Frith-Macdonald rich...@tiptree.demon.co.uk wrote: On 24 Sep 2011, at 17:56, Jackie Gleason wrote: I install and Compile GNUstep by checking out the anonymous core, then compiling in the order make, base, gui, back. I compile all of them using the following command (under sudo shell).. ./configure --prefix=/usr/GnuStep make make install After make I run the following... . /usr/GnuStep/share/GNUstep/Makefiles/GNUstep.sh I'm not sure if you actually did exactly what you said ... but that's not what the HOWTOs tell you to do, and may well account for things being rather messed up. The correct order to do things in is: 1. Configure and install make (you can use the --prefix option for this if you want) 2. Source the GNUstep.sh script to set up your environment 3. Configure, build and install the other packages *without* using --prefix The reason for this order is that everything apart from make is designed to be handled by gnustep-make, and the build process will take care of installing stuff in the correct place depending on how the make package was configured. If you use --prefix= with the other packages, you will probably be overriding the correct locations, and putting things where they are not expected (so headers/libraries won't be found later when you try to use them). ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev