OpenVZ Forum


Home » General » Support » compiling
compiling [message #647] Wed, 04 January 2006 04:53 Go to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
Hi,

Using centos-default I add the gcc, cpp, glibc-devel and other dependant rpms.

However gcc will not build anything. It errors with:

bash-3.00# gcc test.c
collect2: cannot find `ld'

ld exists and is in the path:


bash-3.00# ld
ld: no input files

any ideas?

Thanks!
Re: compiling [message #649 is a reply to message #647] Wed, 04 January 2006 06:32 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
I have checked /proc/user_beancounters and nothing is going over.

I also created a fedora core 4 ve, did :

yum install gcc

and it too has the same compile error.

Any ideas - this is driving me crazy Smile
Re: compiling [message #655 is a reply to message #649] Wed, 04 January 2006 21:22 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

do you use EMT64 arch?
maybe you installed 32bit ld, so gcc can't find the appropriate 64bit. or vise versa.
send me credentials via email if want some help.


http://static.openvz.org/userbars/openvz-developer.png
Re: compiling [message #656 is a reply to message #655] Wed, 04 January 2006 21:48 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member

hardware nod is running RedHat EL4

(Red Hat Enterprise Linux ES release 4 (Nahant Update 1)

ve is running CentOS 4 (the template from the openvz site)

All on Intel(R) Celeron(R) CPU 2.40GHz

ld on ve is :

Name : binutils Relocations: (not relocatable)
Version : 2.15.92.0.2 Vendor: CentOS
Release : 15 Build Date: Sun Aug 21 21:18:12 2005
Install Date: Wed Dec 14 18:36:18 2005 Build Host: build1-i386
Group : Development/Tools Source RPM: binutils-2.15.92.0.2-15.src.rpm
Size : 6663307 License: GPL
Signature : DSA/SHA1, Mon Aug 22 02:31:26 2005, Key ID a53d0bab443e1821
Packager : Johnny Hughes <johnny@centos.org>
URL : http://sources.redhat.com/binutils
Summary : A GNU collection of binary utilities.



Re: compiling [message #657 is a reply to message #656] Wed, 04 January 2006 21:54 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

so everything is 32bit?
then send me a dump of `strace -f -o dump gcc test.c` please
or give me credentials to the VPS. I'm sure, it's something simple Smile)))


http://static.openvz.org/userbars/openvz-developer.png
Re: compiling [message #658 is a reply to message #657] Wed, 04 January 2006 22:17 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
doing this now

[Updated on: Wed, 04 January 2006 22:18]

Report message to a moderator

Re: compiling [message #659 is a reply to message #658] Wed, 04 January 2006 22:26 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
The output is very large so I am trying to cut it down some.

I did find it is something to do with linking:

gcc -c test.c

works and produces test.o

What packages install the linker? I think I have them all installed but I must not!

Thanks again
Re: compiling [message #660 is a reply to message #659] Wed, 04 January 2006 22:32 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

try to find out from strace output what was doing gcc before it printed that it failed. this is a clue. it will be visible that it looks for some file or something like that. after that you can check to which RPM this file in question belongs to and install the required packages.


http://static.openvz.org/userbars/openvz-developer.png
Re: compiling [message #661 is a reply to message #660] Wed, 04 January 2006 23:18 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
No luck yet.

Here is the dump:


[cut to clean the post up - see last post - operator error!]

[Updated on: Thu, 05 January 2006 02:56]

Report message to a moderator

Re: compiling [message #662 is a reply to message #661] Wed, 04 January 2006 23:20 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
The command line result is:

bash-3.00# gcc test.c
collect2: cannot find `ld'


test.c is :

main(){return(0);}

Re: compiling [message #663 is a reply to message #662] Thu, 05 January 2006 02:57 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
ok, i fixed it.

classic operator error!

my path was not set. I could have SWORN I checked it first thing since that would be an obvious reason that ld could not be found.

Anyway fixed now. Argggg....
Re: compiling [message #664 is a reply to message #663] Thu, 05 January 2006 07:02 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

congratulations! Laughing
vmvmvm sorry that I had to go to sleep and was not with you at this moment Embarassed
if you want a quick help next time I'd recommend to buy a support or just give us a temporary credentials to resolve the problem.


http://static.openvz.org/userbars/openvz-developer.png
Re: compiling [message #671 is a reply to message #664] Thu, 05 January 2006 15:01 Go to previous message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
Hi,

Thanks again for your help! Smile

As a reminder to anyone who may be reading this in the future - if you vzctl into a ve I don't think it sets the same environment as if you ssh'd in.

This was the main cause of my problem.

Also, don't forget to export your PATH after you set it.

I think what I was doing was:

using vzctl to enter the VE
try to complile
gcc can't find ln
checking path
no path
setting path
FORGETTING TO EXPORT PATH!!!
still no worky

exporting my path or ssh'ing in proper fixed it.

Anyway, I hope this may help someone who has the same problem in the future.

Previous Topic: How does openVZ compare to the real thing?
Next Topic: Anyone make a working Gentoo Template?
Goto Forum:
  


Current Time: Tue Jul 09 18:23:31 GMT 2024

Total time taken to generate the page: 0.02547 seconds