hi,
...I've been trying to make an OSX port of GEM using Project Builder, which is basically an IDE built around using GCC and GDB...unfortunately, I'm having problems with symbol exports.
...I followed the project builder documentation and made a text file with all of the symbols that I need exported (I think), then added that to the project and did a clean recompile...unfortunately projectbuilder spits this out after some warnings (mostly unused variables, but also alot of "shadow declarations", which I'm unfamiliar with):
/usr/bin/jam -d1 JAMBASE=/Developer/Makefiles/pbx_jamfiles/ProjectBuilderJambase JAMFILE=- build ACTION=build _DEFAULT_GCC_VERSION=2.95.2 _GCC3_IS_IN_OFFICIAL_LOCATION=YES BUILD_STYLE=Development CPP_HEADERMAP_FILE=/Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Gem_darwin.hmap SRCROOT=/Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin OBJROOT=/Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build SYMROOT=/Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build DSTROOT=/tmp/gem_darwin.dst ...updating 8 target(s)... MasterObjectFile.Combine /Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o MasterObjectFile.EditExports /Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o /usr/bin/nmedit: symbols names listed in: symbols.exp not in: /Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o atom_getfloat atom_getfloatarg atom_getint atom_getsymbol atom_string canvas_getcurrent canvas_makefilename class_addbang class_addcreator class_addlist class_addmethod class_addsymbol class_doaddfloat class_new class_sethelpsymbol clock_delay clock_free clock_getsystime clock_gettimesince clock_new clock_unset cosf dsp_add error floatinlet_new freebytes garray_class garray_getfloatarray garray_redraw gensym getbytes inlet_free inlet_new model_setup multimodel_setup nullfn outlet_anything outlet_bang outlet_float outlet_free outlet_list outlet_new outlet_symbol pd_findbyclass pd_new post resizebytes s_ s_bang s_float s_list s_signal sinf
/usr/bin/nmedit -s "symbols.exp" "/Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o" -o "/Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o"
...failed MasterObjectFile.EditExports /Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o ... ...removing /Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/gem_darwin.build/Gem_d_w-oPart.build/Objects-normal/ProjectBuilderMasterObjectFile.o
How do I fix this? These symbols are the ones that were spit out before I added the "symbols.exp" file...btw, here are the flags I'm using: is anything missing?
OTHER_LDFLAGS= -bundle -undefined suppress -flat_namespace WARNING_CFLAGS= -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch -Wno-four-char-constants -Wno-unknown-pragmas
I'm assuming that the frameworks and stuff are automatically linked by virtue of the IDE...
Any Ideas?
tanx, jamie
hi,
OTHER_LDFLAGS= -bundle -undefined suppress -flat_namespace*
basically, all symbols defined by pd are missing, so, you can try to link with these options :
-bundle -undefined error -twolevel_namespace -bundle_loader /usr/local/pd/bin/pd
where you'll have to adjust path to the pd binary.
besides solving the undefined issue, this linking mode allows you to define your own symbols, local to your library, this is better if you want to avoid conflicts with other libs.
cheers,
yves/
hi,
OTHER_LDFLAGS= -bundle -undefined suppress -flat_namespace*
basically, all symbols defined by pd are missing, so, you can try to link with these options :
-bundle -undefined error -twolevel_namespace -bundle_loader /usr/local/pd/bin/pd
where you'll have to adjust path to the pd binary.
besides solving the undefined issue, this linking mode allows you to define your own symbols, local to your library, this is better if you want to avoid conflicts with other libs.
cheers,
yves/
hi yves,
...ok, I tried the above, but came up with the same problems...so then I removed my symbol.exp from the target, and then came up with different errors: basically saying:
/usr/bin/libtool: unknown option character `b' in: -bundle Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
...so I dropped the -bundle and -bundle_loader flags, and added -dynamic, so that this is my LDFLAGS:
-undefined error -twolevel_namespace -dynamic /Applications/pd-0.35-test23/bin/pd
...and then, of course, I get another new error:
DynamicLibrary /Users/tigital/Desktop/gem-0.87/src/PBprojects/gem_darwin/build/GEM_darwin.dylib ld: /Applications/pd-0.35-test23/bin/pd is input for the dynamic link editor, is not relocatable by the static link editor again /usr/bin/libtool: internal link edit command failed
...guess I've got loads to learn about ld! but i am also wondering why the "-bundle" and "-bundle_loader" didn't work...
confused, jamie
hi,
...guess I've got loads to learn about ld! but i am also wondering why the "-bundle" and "-bundle_loader" didn't work...
i'm also surprised it didn't work but i used them in a different context : i just linked some pd externs with these options.
the linking command was :
cc -bundle -undefined error -twolevel_namespace -bundle_loader ../../bin/pd -o <extern>.pd_darwin <extern>.o
as you can see, it didn't make use of libtool...
so, maybe you can try to issue this command outside of Project Builder :
cc -bundle -undefined error -twolevel_namespace -bundle_loader ../../bin/pd -o Gem.pd_darwin <all your objects with wildcards>.o
i personally avoid using any IDE [ vi power, not even emacs ].
cheers,
yves