Operating System - HP-UX
1753366 Members
5766 Online
108792 Solutions
New Discussion юеВ

Re: ld errors while compiling via gcc

 
SOLVED
Go to solution
Igor Sovin
Super Advisor

ld errors while compiling via gcc

Need help!
i want to compile my c program on HP-UX 11.23 with gcc doing following:

# gcc -ansi -funsigned-char -Wcast-align -pthread -fpic -DSAPwithTHREADS -DSAPonLIN -Iinclude -L/usr/rfcsdk/lib saprfcsr.c

all .h files are in "include" directory
library needed is in /usr/rfcsdk/lib
Some dummy sources, needed for compilation, are in current directory from where I start compilation process.

After the executing gcc command written above, I get lot of errors:

ld: Unsatisfied symbol "RfcLastError" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcSendData" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcRaise" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "ItFill" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcListen" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcGetData" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcEnvironment" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "ItAppLine" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "ItGetLine" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcInstallStructure" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "ORIFICE" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcAccept" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "CALCDL" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "CALCGS" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcInstallFunction" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcClose" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcDispatch" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab5a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab5b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab5d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab6a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab6b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab6c" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab6d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab23a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab23b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab23d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab24a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab24b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab24c" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab24d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab53a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab53b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab53d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab54a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab54b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab54c" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab54d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab59a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab59b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab59d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab60a" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab60b" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab60c" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "tab60d" in file /var/tmp//ccpHGObb.o
ld: Unsatisfied symbol "RfcAbort" in file /var/tmp//ccpHGObb.o
46 errors.
collect2: ld returned 1 exit status

What the problem could be?
11 REPLIES 11
Igor Sovin
Super Advisor

Re: ld errors while compiling via gcc

I've corrected some things
I forgot to put the library name
but still only one error
#gcc -ansi -funsigned-char -Wcast-align -pthread -fpic -DSAPwithTHREADS -DSAPonLIN -Iinclude -L/usr/rfcsdk/lib saprfcsr.c api_tab.c aga3sa.c aga8plus.c detailsa.c grosssa.c librfccm.so -o qci_srv
ld: Mismatched Data ABI. Expected None but found EF_IA_64_ABI64 in file librfccm.so
Fatal error.
collect2: ld returned 1 exit status

Dont know what to do
Ermin Borovac
Honored Contributor
Solution

Re: ld errors while compiling via gcc

I see that you have -L/usr/rfcsdk/lib on the compile line. But do you do also have -l, so it knows which library to link with?
Ermin Borovac
Honored Contributor

Re: ld errors while compiling via gcc

Second error is result of mixing 32-bit and 64-bit objects. Your library is 64-bit and gcc is compiling 32-bit by default.
Igor Sovin
Super Advisor

Re: ld errors while compiling via gcc

Hi Ermin!

How to set gcc to compile 64-bit?
Ermin Borovac
Honored Contributor

Re: ld errors while compiling via gcc

If you are on Itanium you can try using -mlp64 flag to get 64-bit compile.
Igor Sovin
Super Advisor

Re: ld errors while compiling via gcc

thank you -mlp64 option works, I've got the executable qci_srv, but there is one warning

#gcc - mlp64 -ansi -funsigned-char -Wcast-align -pthread -fpic -DSAPwithTHREADS -DSAPonLIN -Iinclude -L/usr/rfcsdk/lib saprfcsr.c api_tabs.c
den_tabs.c sg_tabs.c tab_5960.c tcommon.c aga3sa.c aga8plus.c detailsa.c grosssa.c librfccm.so -o qci_srv
ld: (Warning) Unsatisfied symbol "__cxa_personality_routine" in file librfccm.so
1 warnings.

What is it?
Igor Sovin
Super Advisor

Re: ld errors while compiling via gcc

my binary file qci_srv doesn't execute because of that warning :(
Ermin Borovac
Honored Contributor

Re: ld errors while compiling via gcc

This symbol comes from /usr/lib/hpux64/libCsup.so. I think your library was compiled with aCC. It's not good to mix gcc (g++) and aCC.

So if you used aCC to compile everything, libCsup.so would link in automatically so you wouldn't get this error.

If you have aCC on your system you should use it instead of gcc (g++).
Igor Sovin
Super Advisor

Re: ld errors while compiling via gcc

Unfortunatly I don't have aCC
where should I get it?