Jump to content
• Advertisement

Archived

This topic is now archived and is closed to further replies.

ld returned 1 exit status?

This topic is 5454 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just got myself a new server (RH9 Linux - 2.4.20-20.9) and so I was trying to install qmail on it. But every time I run the 'make' command I get this error and everything aborts (it happens for all the programs):
...
./load envdir unix.a byte.a
envdir.o(.text+0x127): In function main':
: undefined reference to errno'
envdir.o(.text+0x282): In function main':
: undefined reference to errno'
unix.a(openreadclose.o)(.text+0x47): In function openreadclose':
: undefined reference to errno'
unix.a(pathexec_run.o)(.text+0x122): In function pathexec_run':
: undefined reference to errno'
unix.a(pathexec_run.o)(.text+0x163): In function pathexec_run':
: undefined reference to errno'
unix.a(readclose.o)(.text+0x67): more undefined references to errno' follow
collect2: ld returned 1 exit status
make: *** [envdir] Error 1

I've searched the net but I don't see any solution to this. I even upgraded my gcc version to 3.3.1 but still nothing happens. I have another server running gcc 2.96 and this same code compiles without any problem on that. Does anyone know what’s happening here or what do I need to change? Edit: BTW from what I could figure is if I add -static flag when linking the problem goes away.. but still I want to know why the above is happening with this new server? Any help will be appreciated! [edited by - cyanide on October 16, 2003 10:49:21 PM]

Share this post

Share on other sites
Advertisement
Change all the places that have "extern int errno;" (envdir.c, openreadclose.c, pathexec_run.c and readclose.c unless they all include some common header) to have "#include <errno.h>" instead. errno is allowed to be a macro (the C standard defines it as "a modifiable lvalue that has type int" and in modern glibcs, it is in fact a #define for something like (*__errno_location()).

Share this post

Share on other sites
A ld error just means that something went wrong while trying to compile it. To find out what actually went wrong, you have to look at the lines above (i.e. undefined references to errno).
As to the solution to your problem, I have no idea, could be the AP is right.

Share this post

Share on other sites
The change to errno` in the latest glibc versions break qmail. There''s a patch to fix qmail; it contains the changes described by the AP.

Share this post

Share on other sites
hey thanks so much to all you nice people finally got it working.. It was indeed what AP said.. had to replace all exclude errno with #include <errno.h> and it works like a charm now!

thanks so much once again for the suggestions!!

Share this post

Share on other sites

• Advertisement
• Advertisement

• Popular Contributors

1. 1
2. 2
Rutin
20
3. 3
4. 4
frob
13
5. 5
• Advertisement

• 9
• 13
• 10
• 9
• 17
• Forum Statistics

• Total Topics
632601
• Total Posts
3007349

×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!