Re: GNUmakefile and a strange case
On Tuesday 19 December 2006 21:44, Christopher Armstrong wrote: Hi gcc -o account.so -shared Account.os cli.os man.os User.os Group.os LoggedUser.os -L/usr/lib/GNUstep/System/Library/Libraries -lobjc -lgnustep-base scons: done building targets. Note with this you're linking against the gnustep-base library, which includes the NSString class (the missing export in your error messages). I guess you are making use of NSString somehow (either in the constant (@) or non-constant form). Yes, I am using NSString directly ([NSString ...]) and indirectly (@...) many times as well as other GNUstep classes. And since it is a library I am using I am liking with it... anything wrong there ? On Monday 18 December 2006 19:49, José Pablo Fernández wrote: User.m:108: warning: â_OBJC_INSTANCE_0â defined but not used User.m:185: warning: â_OBJC_INSTANCE_1â defined but not used User.m:194: warning: â_OBJC_INSTANCE_2â defined but not used These warnings come with gnustep-base when you use constant strings in the form @something here They seem to be harmless, and its a bug in gcc that should be fixed when the gcc guys get round to it (ask them; check their bug reporting system first). Ok, thank you. ? Any help in any of these problems is appreciated. You said you were compiling a c library. It used to be a c-only library... now it is a obj-c library. This form of a GNUmakefile with GNUstep does not link in gnustep-base. I am not sure what we are talking about really, because... You will want to compile as a normal library ($(GNUSTEP_MAKEFILES)/library.make). ... that is what I included in my GNUmakefile. My current GNUmakefile looks like this: include $(GNUSTEP_MAKEFILES)/common.make LIBRARY_NAME = account account_OBJC_FILES = Account.m cli.m Group.m LoggedUser.m man.m User.m account_OBJCFLAGS = -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make -include GNUmakefile.postamble Please note that what you are doing by putting the library in a different directory is likely to cause problems. The gnustep-base library and the objective-c runtime will somehow need to be in your library export path (ldconfig and friends) for libaccount.so to load properly. I can't avoid this. This library is dloaded by another program which loads all the libraries (modules/plugins) in a certain directory, I have to install my library there and even name it in a special way (no lib). -- José Pablo Fernández [EMAIL PROTECTED] ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: GNUmakefile and a strange case
On 18 Dec 2006, at 22:49, José Pablo Fernández wrote: Hello, I have a strange situation here, it used to be a C library compiled with SCons, but now I am using ObjC and GNUstep and I was recommended to use GNUmakefiles because of the added goodies. Now, I need to create a library, the library should be called account.so (note, not libaccount.so, account.so) and it should be installed on /usr/lib/account/modules/ not on /whatever/Library/whatever. How can I do this ? I think you need an extra rule in the makefile to rename/install the library. The standard makefile will build libaccount.so in the obj subdirectory, so your extra install rule needs to copy that to /usr/ lib/account/modules/account.so Now, this library is dlopened, when I compile it with SCons it is loaded succesfully, when I compile it with GNUmakefile (and copy the file by hand renaming it in the process) I get this error: Error loading module 'account.so': /usr/lib/asterisk/modules/ account.so: undefined symbol: __objc_class_name_NSString Evidently there's something different in how it was linked with the gnustep libraries. Quite possibly, but we would need to see the gnustep make file to know what the problem might be. It should look something like (no promise that this is correct ... just a quick, rough idea from memory): include $(GNUSTEP_MAKEFILES)/common.make LIBRARY_NAME=account account_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/library.make after-install: cp obj/libaccount.so /usr/lib/account/modules/account.so And as a last detail, I get this warnings, what do they mean: User.m:108: warning: ‘_OBJC_INSTANCE_0’ defined but not used User.m:185: warning: ‘_OBJC_INSTANCE_1’ defined but not used User.m:194: warning: ‘_OBJC_INSTANCE_2’ defined but not used That's a harmless compiler bug in some versions of gcc ... best ignored. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: GNUmakefile and a strange case
Hi gcc -o account.so -shared Account.os cli.os man.os User.os Group.os LoggedUser.os -L/usr/lib/GNUstep/System/Library/Libraries -lobjc -lgnustep-base scons: done building targets. Note with this you're linking against the gnustep-base library, which includes the NSString class (the missing export in your error messages). I guess you are making use of NSString somehow (either in the constant (@) or non-constant form). Thanks. On Monday 18 December 2006 19:49, José Pablo Fernández wrote: Hello, I have a strange situation here, it used to be a C library compiled with SCons, but now I am using ObjC and GNUstep and I was recommended to use GNUmakefiles because of the added goodies. Now, I need to create a library, the library should be called account.so (note, not libaccount.so, account.so) and it should be installed on /usr/lib/account/modules/ not on /whatever/Library/whatever. How can I do this ? Now, this library is dlopened, when I compile it with SCons it is loaded succesfully, when I compile it with GNUmakefile (and copy the file by hand renaming it in the process) I get this error: Error loading module 'account.so': /usr/lib/asterisk/modules/account.so: undefined symbol: __objc_class_name_NSString Evidently there's something different in how it was linked with the gnustep libraries. And as a last detail, I get this warnings, what do they mean: User.m:108: warning: â_OBJC_INSTANCE_0â defined but not used User.m:185: warning: â_OBJC_INSTANCE_1â defined but not used User.m:194: warning: â_OBJC_INSTANCE_2â defined but not used These warnings come with gnustep-base when you use constant strings in the form @something here They seem to be harmless, and its a bug in gcc that should be fixed when the gcc guys get round to it (ask them; check their bug reporting system first). ? Any help in any of these problems is appreciated. You said you were compiling a c library. This form of a GNUmakefile with GNUstep does not link in gnustep-base. You will want to compile as a normal library ($(GNUSTEP_MAKEFILES)/library.make). Please note that what you are doing by putting the library in a different directory is likely to cause problems. The gnustep-base library and the objective-c runtime will somehow need to be in your library export path (ldconfig and friends) for libaccount.so to load properly. For other customisations, I suggest taking a look a the gnustep-makefile manual on GNUstep's web site; it has some options for customising your output. Cheers Chris -- Christopher Armstrong carmstrong ^^AT^ fastmail dOT com /Dot/ au ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
GNUmakefile and a strange case
Hello, I have a strange situation here, it used to be a C library compiled with SCons, but now I am using ObjC and GNUstep and I was recommended to use GNUmakefiles because of the added goodies. Now, I need to create a library, the library should be called account.so (note, not libaccount.so, account.so) and it should be installed on /usr/lib/account/modules/ not on /whatever/Library/whatever. How can I do this ? Now, this library is dlopened, when I compile it with SCons it is loaded succesfully, when I compile it with GNUmakefile (and copy the file by hand renaming it in the process) I get this error: Error loading module 'account.so': /usr/lib/asterisk/modules/account.so: undefined symbol: __objc_class_name_NSString Evidently there's something different in how it was linked with the gnustep libraries. And as a last detail, I get this warnings, what do they mean: User.m:108: warning: ‘_OBJC_INSTANCE_0’ defined but not used User.m:185: warning: ‘_OBJC_INSTANCE_1’ defined but not used User.m:194: warning: ‘_OBJC_INSTANCE_2’ defined but not used ? Any help in any of these problems is appreciated. Thank you. -- José Pablo Fernández [EMAIL PROTECTED] ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: GNUmakefile and a strange case
I thought maybe it was usefull to see how I was compiling it with SCons: $ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o Account.os -c -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -I/usr/include/GNUstep/Headers/ -fconstant-string-class=NSConstantString -fPIC Account.m gcc -o cli.os -c -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -I/usr/include/GNUstep/Headers/ -fconstant-string-class=NSConstantString -fPIC cli.m gcc -o man.os -c -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -I/usr/include/GNUstep/Headers/ -fconstant-string-class=NSConstantString -fPIC man.m gcc -o User.os -c -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -I/usr/include/GNUstep/Headers/ -fconstant-string-class=NSConstantString -fPIC User.m gcc -o Group.os -c -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -I/usr/include/GNUstep/Headers/ -fconstant-string-class=NSConstantString -fPIC Group.m gcc -o LoggedUser.os -c -D_GNU_SOURCE -std=gnu99 -pipe -Wall -ggdb -I/usr/include/GNUstep/Headers/ -fconstant-string-class=NSConstantString -fPIC LoggedUser.m gcc -o account.so -shared Account.os cli.os man.os User.os Group.os LoggedUser.os -L/usr/lib/GNUstep/System/Library/Libraries -lobjc -lgnustep-base scons: done building targets. Thanks. On Monday 18 December 2006 19:49, José Pablo Fernández wrote: Hello, I have a strange situation here, it used to be a C library compiled with SCons, but now I am using ObjC and GNUstep and I was recommended to use GNUmakefiles because of the added goodies. Now, I need to create a library, the library should be called account.so (note, not libaccount.so, account.so) and it should be installed on /usr/lib/account/modules/ not on /whatever/Library/whatever. How can I do this ? Now, this library is dlopened, when I compile it with SCons it is loaded succesfully, when I compile it with GNUmakefile (and copy the file by hand renaming it in the process) I get this error: Error loading module 'account.so': /usr/lib/asterisk/modules/account.so: undefined symbol: __objc_class_name_NSString Evidently there's something different in how it was linked with the gnustep libraries. And as a last detail, I get this warnings, what do they mean: User.m:108: warning: ‘_OBJC_INSTANCE_0’ defined but not used User.m:185: warning: ‘_OBJC_INSTANCE_1’ defined but not used User.m:194: warning: ‘_OBJC_INSTANCE_2’ defined but not used ? Any help in any of these problems is appreciated. Thank you. -- José Pablo Fernández [EMAIL PROTECTED] ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev