keyongtech


  keyongtech > aix > 04/2004

 #1  
04-06-04, 07:21 AM
GyungChan
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.
 #2  
04-06-04, 03:21 PM
Gary R. Hook
GyungChan wrote:
> * source file link:
> [..]...


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.
 #3  
04-06-04, 03:32 PM
Paul Pluzhnikov
jung0465 (GyungChan) writes:

> * source file link:
> [..]


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,
Similar Threads
Itanium: determine object file main or sub

Integrity/Itanium: Does anybody know how to determine from an object file whether it is a main module or a sub module? On the Alpha, the output of analyze/object contained...

icc compiler, object file problem

Hi all, I am current engage in a project that require me to create object files. However I am struck in compiling all the object files together. I tend to get lots of...

How to get the main window object from outside the object?

I'm pretty new to .net Windows Forms, but I've done a lot of searching and can't find an answer to this question. Here's what I'm trying to do: main() { Form1 myForm = new...

Build failed. Compiler for file type '*.xsd' failed. Object reference not set to an instance of an object.

Hi! I'm receiving this message for xsd,odx and btm files. I tried repairing BizTalk installation couple of times but without any success. Please don't tell me that I have to...

How to link the object files(.o) into one BIG object file with "Symbols partly located" ?

Hi, "Symbols partly located" is means: Link some .o files with option "-Ttext 0xXXXXXX" of "ld" (fixed the offset of .text segment), So I want the "ld" will locate the...


All times are GMT. The time now is 11:21 PM. | Privacy Policy