Cannot link my files now

I have several compilations of a program that I have used both gcc and pgcc on. The program compiles and runs either way. However, I was not able to put it through Valgrind memcheck without an error message. In my last email that error message is shown

I searched the net and found some utility that I though might correct the problem.

The utility was binutils-gold.

I was unable to install it. I seemd to have a later version already on my Ubuntu 11.04 that the one that I was trying to install.The Ubuntu would not install it.

However, when I go back to my original program and try to compile it eihter with pgcc or gcc I get the folliwing:

, IPA: The value of this argument is the constant 21 
     46, IPA: 1 constant-valued arguments replaced 
     61, Loop unrolled 21 times (completely unrolled) 
     62, Loop unrolled 16 times 
/usr/bin/ld: error: /opt/pgi/linux86/11.7/lib/pgi.ld: SECTIONS seen after other input files; try -T/--script 
/usr/bin/ld: error: cannot find -lm 
/usr/bin/ld: error: cannot find -lrt 
/usr/bin/ld: error: cannot find -ldl 
/usr/bin/ld: error: cannot find -lpthread 
/usr/bin/ld: error: cannot find -lm 
/usr/bin/ld: error: cannot find -lc 
/usr/bin/ld: internal error in input_sections_begin, at ../../gold/merge.h:269 
child process exit status 1: /usr/bin/ld 
james@james-Precision-WorkStation-T7500:~/Desktop/WEGtestOpt$ ./compile2.sh 
/usr/bin/ld: /tmp/cc43IW7i.o: in function InitMutex:WAFmutex.c:32: error: undefined reference to 'pthread_mutexattr_init' 
/usr/bin/ld: /tmp/cc43IW7i.o: in function InitMutex:WAFmutex.c:38: error: undefined reference to 'pthread_mutexattr_setpshared' 
/usr/bin/ld: /tmp/cc43IW7i.o: in function InitMutex:WAFmutex.c:61: error: undefined reference to 'pthread_condattr_setpshared' 
/usr/bin/ld: /tmp/ccowCNfg.o: in function CreateThread:thread.c:46: error: undefined reference to 'pthread_attr_setstacksize' 
/usr/bin/ld: /tmp/ccowCNfg.o: in function CreateThread:thread.c:53: error: undefined reference to 'pthread_create' 
/usr/bin/ld: /tmp/ccowCNfg.o: in function CreateThread:thread.c:61: error: undefined reference to 'pthread_attr_getstacksize' 
/usr/bin/ld: /tmp/ccowCNfg.o: in function DetachThread:thread.c:84: error: undefined reference to 'pthread_detach' 
collect2: ld returned 1 exit status 
james@james-Precision-WorkStation-T7500:~/Desktop/WEGtestOpt$ cd /usr/bin 
james@james-Precision-WorkStation-T7500:/usr/bin$ ls -al ld 
lrwxrwxrwx 1 root root 7 2011-11-04 13:48 ld -> ld.gold

I am unable to link anymore. If you notice on the last line it seems that ld is softlinked to ld.gold which never installed completely.

Is this the problem? if it is how do I break the link? Will that solve the problem?

THX 1138

PS How does one install binutils-gold?

Any help appreciated.

Hi THX 1138,

Is this the problem?

Sorry, I don’t know. I would guess that you’ve left your binutils in an incomplete state. Maybe you can re-install the original binutils?

  • Mat

I tried that.The file that was recommended to install binutils-gold was older than the one that I had already on my pc. So it did not install.

I guess that i partially installed and that was the reason I cannot link now

ld ->gold

is is my file as I said. If I remove this link then maybe I could link again?

THX 1138