Error Undefined Symbol .main Aix
compiling C++ program with xlc 1 reply Latest Post - 2013-05-29T10:58:22Z by flodstrom Display:ConversationsBy Date 1-2 of 2 Previous Next JoseLuis3 270005EBX3 1 Post Pinned topic Linker error when compiling C++ program with xlc 2013-05-15T10:54:55Z | Tags: Answered question This question has been answered. Unanswered question This question has not been answered yet. Hi, Why these linker errors? <
I've come to expect from IBM's compiler - nothing's ever that simple. What did I expect? They don't even provide a man page, and the linker always kicks out thousands of irrelevant warnings by design. The system is running IBM VisualAge 5 on AIX 5.1. I said it was ageing. Always finish with -bdynamic Dynamic linking (-bdynamic) is the default for AIX's xlC compiler. The documentation says that the -bstatic option turns on static linking. OK, but try using this option and you get dozens of ‘undefined symbol' errors for symbols that should be defined in libc: ld: https://www.ibm.com/developerworks/community/forums/html/topic?id=ac9b95a6-20f5-47bc-89d7-5e55e26a1f9d 0711-317 ERROR: Undefined symbol: errno ld: 0711-317 ERROR: Undefined symbol: _exit ld: 0711-317 ERROR: Undefined symbol: open Apparently, you can't link libc statically. Here's the relevant quote, hidden away on page 102 of some blasted PDF: To avoid possible problems with unresolved linker errors when linking the C library, you must add the -bdynamic option to the end of any compilation sections that use the -bstatic option. Note: Actually http://blog.firetree.net/2005/07/21/static-linking-on-aix/ the documentation says you can statically link libc, but you might not want to. That said, I've not been able to make it work. See below for the secret. ranlib libz.a I had trouble with linking Zlib of all things. I got these six severe errors: ld: 0711-212 SEVERE ERROR: Symbol .__divus, found in the global symbol table of archive /lib/libz.a, was not defined in archive member libz.so.1. ld: 0711-212 SEVERE ERROR: Symbol __divus, found in the global symbol table of archive /lib/libz.a, was not defined in archive member libz.so.1. ld: 0711-212 SEVERE ERROR: Symbol .__mulh, found in the global symbol table of archive /lib/libz.a, was not defined in archive member libz.so.1. ld: 0711-212 SEVERE ERROR: Symbol __mulh, found in the global symbol table of archive /lib/libz.a, was not defined in archive member libz.so.1. ld: 0711-212 SEVERE ERROR: Symbol .__quous, found in the global symbol table of archive /lib/libz.a, was not defined in archive member libz.so.1. ld: 0711-212 SEVERE ERROR: Symbol __quous, found in the global symbol table of archive /lib/libz.a, was not defined in archive member libz.so.1. AIX's libz.a is at fault. Simply running ranlib on it fixes the problem. You have to make a copy first, since the current one may be in use
AIX compiling Fortran code which links to some C routines. Getting loader ld 0711-317 ERROR: Undefined Symbol message on all the C routines. It lists them all with a dot (period) http://www.justskins.com/forums/ld-0711-317-error-92177.html in front of their name: ..sycntl ..syslep etc. Is there some special compiler http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id130/Compilation_on_IBM_Power7_and_AI....html option I need to link the C and Fortran? Is this the same as the +ppu vs. +noppu (Post-Pend Underscores) compiler option on the HP-UX boxes? Any help appreciated. Dan McKinley [email]mckinldjwestinghouse.com[/email]... Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to error undefined Threaded Mode July 11th,10:55 AM #1 ld 0711-317 ERROR: Undefined Symbol Running xlf on AIX compiling Fortran code which links to some C routines. Getting loader ld 0711-317 ERROR: Undefined Symbol message on all the C routines. It lists them all with a dot (period) in front of their name: ..sycntl ..syslep etc. Is there some special compiler option I need to link the C and Fortran? error undefined symbol Is this the same as the +ppu vs. +noppu (Post-Pend Underscores) compiler option on the HP-UX boxes? Any help appreciated. Dan McKinley [email]mckinldjwestinghouse.com[/email] Dan McKinley Guest July 11th,12:47 PM #2 Re: ld 0711-317 ERROR: Undefined Symbol Dan McKinley wrote: > Running xlf on AIX ... > Is there some special compiler option I need to link the C and Fortran? > Is this the same as the +ppu vs. +noppu (Post-Pend Underscores) compiler > option on the HP-UX boxes? > Yes, you have -qextname and -qnoextname extname Suffixes an underscore to all external names (except for main program names). -- Alberto 'JCN-9000' Varesio AKA BlueRider AIX pSeries System Admin EADS-MDTV - Via Goito 51/A Riding the world Jeeper on Black '01TJ4.0 10195 Grugliasco (TO) ITALY on HONDA CB500 Phone: +39-011-415-8148 mailto:A-Varesiomatradatavision.it LHG/Wave [email]A-Varesioeads.dnsalias.net[/email] Please [url]http://www.fsf.org/philosophy/no-word-attachments.html[/url], thanks! -- BOFH Excuse: stop bit received Alberto 'JCN-9000' Varesio Guest « System Management with SNMP-Traps | Question: FastT200 » Similar Threads Undefined symbol perl_get_sv By Scott Thibault in forum PERL Modules Replies: 1 Last Post: March 7th, 05:32 PM Undefined symbol? By Mark Setzer in forum PERL Beginners Replies: 1 Last Post: January 26th, 08:47 PM relocation error: nimage_c.so: undefined symbol: str
Category Current Forum Current Thread Viewed 3883 times, With a total of 4 Posts Jump to: navigation, search Credits Search Today's Posts Forum >> NWChem's corner >> Compiling NWChem Guest - Send PM 6:12:00 AM PDT - Mon, May 2nd 2011 I'm getting the following error when compiling nwchem 6.0 on an IBM Power 7 machine running AIX 6.1 with xlf version 13.1 and xlc version 11.1. ld: 0711-317 ERROR: Undefined symbol: .slamch_ ld: 0711-317 ERROR: Undefined symbol: .slaset_ ld: 0711-317 ERROR: Undefined symbol: .sspsvx_ ld: 0711-317 ERROR: Undefined symbol: .sgesvd_ ld: 0711-317 ERROR: Undefined symbol: .cheev_ ld: 0711-317 ERROR: Undefined symbol: .ssyev_ ld: 0711-317 ERROR: Undefined symbol: .slascl_ ld: 0711-317 ERROR: Undefined symbol: .sgebal_ ld: 0711-317 ERROR: Undefined symbol: .slacpy_ ld: 0711-317 ERROR: Undefined symbol: .sorghr_ Guest - Send PM 6:12:39 AM PDT - Mon, May 2nd 2011 The command I used for compilation is gmake USE_64TO32=y HAS_BLAS=yes BLASOPT="-lessl -lmass" I've tried using BLASOPT="-L/usr/lib -lessl -lmass" with the same result I've setup the following variables before compilation export PATH=/usr/vacpp/bin:$PATH export LARGE_FILES=TRUE export LIB_DEFINES=-DDFLT_TOT_MEM=16777216 export NWCHEM_TOP=/usr/local/packages/nwchem/6.0 export NWCHEM_TARGET=LAPI64 export NWCHEM_MODULES="all" export MPI_INCLUDE=/usr/lpp/ppe.poe/include export MPI_LIB=/usr/lpp/ppe.poe/lib export LIBMPI="-binitfini:poe_remote_main -lmpi_r -lvtd_r -I/usr/lpp/ssp/css/include -llapi_r -lpthreads -L/usr/lpp/ppe.poe/lib/threads -L/usr/lpp/ppe.poe/lib -L/usr/lpp/ppe.poe/lib/ip " export USE_OLDAIO=y I've tried compilation by linking to lapack and blas which I compiled on said machine. I've also tried compiling using gmake USE_64TO32=y all options result in the same error while linking to the blas libraries. Appreciate all the help and advice I can get. I have the make logs and loadmap files if anyone wants to take a look at it. Thanks Alex Bert Forum:Admin, Forum:Mod, NWChemDeveloper, bureaucrat, sysop Profile Send PM Forum Vet Threads 4 Posts 597 2:59:19 PM PDT - Mon, May 2nd 2011 Alex, Can you check if sgesvd_ is actually in the essl library you are linking against (and if it has the underscore at the end)? Bert Quote: May 2nd 1:12 pmThe command I used for compilation is gmake USE_64TO32=y HAS_BLAS=yes BLASOPT="-lessl -lmass" I've tried using BLASOPT="-L/usr/lib -lessl -lmass" with the same result