vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| We are trying to link a .cpp main file with a C object(.o) and C++ object(.o) using xlC compiler on IBM-AIX. Please let us know, if anyone has a solution to this problem described below. In g++, These files are compiled and linked well in g++. But when using xlC, 'Undefined symbol' occurred. There are 4 files.(All files are zipped..) -> seedx.h, seedx.c, SEED.cpp(main function included), SEED.h * source file link: http://jung0465.cafe24.com/zeroboard...=5& filenum=1 Created objects(.o files) using the following command : xlC -c seedx.c xlC -c SEED.cpp Linking the objects(.o files) : xlC -o SEED seedx.o SEED.o This is the error : ld: 0711-317 ERROR: Undefined symbol: .SeedEncRoundKey__FPUlPUc ld: 0711-317 ERROR: Undefined symbol: .SeedEncrypt__FPUcPUl ld: 0711-317 ERROR: Undefined symbol: .SeedDecrypt__FPUcPUl ld: 0711-317 ERROR: Undefined symbol: .__vn__FUl ld: 0711-317 ERROR: Undefined symbol: .__dl__FPv ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. |
| |||
| GyungChan wrote: > * source file link: > http://jung0465.cafe24.com/zerob... No joy. > Created objects(.o files) using the following command : > xlC -c seedx.c > xlC -c SEED.cpp You need to declare your C functions inside of an extern "C" { } clause. Otherwise, the C++ code presumes that they are C++ functions. In other words, this is likely a coding error. > Linking the objects(.o files) : > xlC -o SEED seedx.o SEED.o > > This is the error : > ld: 0711-317 ERROR: Undefined symbol: .SeedEncRoundKey__FPUlPUc > ld: 0711-317 ERROR: Undefined symbol: .SeedEncrypt__FPUcPUl > ld: 0711-317 ERROR: Undefined symbol: .SeedDecrypt__FPUcPUl > ld: 0711-317 ERROR: Undefined symbol: .__vn__FUl > ld: 0711-317 ERROR: Undefined symbol: .__dl__FPv NOt sure about these...standard new and delete operators, so they ought to get resolved. Without checking the source code, it's difficult to be any more precise. -- Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE __________________________________________________ ______________________ |
| ||||
| jung0465@hanmail.net (GyungChan) writes: > * source file link: > http://jung0465.cafe24.com/zeroboard...=5& filenum=1 The link above results in an empty page. > Created objects(.o files) using the following command : > xlC -c seedx.c > xlC -c SEED.cpp > > Linking the objects(.o files) : > xlC -o SEED seedx.o SEED.o > > This is the error : Are the next 3 functions supposed to have C++ linkage? Chances are they should have C linkage (especially given that they are likely defined in seedx.c). > ld: 0711-317 ERROR: Undefined symbol: .SeedEncRoundKey__FPUlPUc > ld: 0711-317 ERROR: Undefined symbol: .SeedEncrypt__FPUcPUl > ld: 0711-317 ERROR: Undefined symbol: .SeedDecrypt__FPUcPUl If so, they probably have incorrect prototype in seedx.h. Correct prototype should look similar to: #ifdef __cplustplus extern "C" #endif int SeedEncRoundKey(unsigned long *, unsigned char *); > ld: 0711-317 ERROR: Undefined symbol: .__vn__FUl > ld: 0711-317 ERROR: Undefined symbol: .__dl__FPv The other 2 are strange: they are 'operator new[](unsigned long)' and 'operator delete(void *)'; they are defined in /usr/lib/libC.a, and I do not understand how you ended up with them being undefined. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |