By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,570 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,570 IT Pros & Developers. It's quick & easy.

g++ linker behavior

P: n/a
Hello,

I have been getting the following error:

ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status

while I was trying to link several .o files in my project. I googled
this error and it seems to be caused by double import of external
variables/constants/functions.

However when I could not figure out what caused the error I stripped
down my program to a simple "hello world" AND... surprize I keep
getting the same error.

As long as I do
g++ my_program.c -o my_program

everything is fine. But if first build the object and then the
executable, I run into the error.

g++ -c my_program.c

g++ my_program.o -o my_program
ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status

Does anyone know what causes this error to occur and how can I fix it?
Thank you!
Nadina

Jul 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Nadina wrote:
I have been getting the following error:

ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status
[...]
Does anyone know what causes this error to occur and how can I fix it?


Somebody in gnu.g++.help should know. Your question is OT here since
it's not a _language_ issue, sorry.

V
Jul 23 '05 #2

P: n/a
"Nadina" wrote...
Hello,

I have been getting the following error:

ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status

while I was trying to link several .o files in my project.
Note that linking is off-topic in this ng.
I googled
this error and it seems to be caused by double import of external
variables/constants/functions.

However when I could not figure out what caused the error I stripped
down my program to a simple "hello world" AND... surprize I keep
getting the same error.

As long as I do
g++ my_program.c -o my_program

everything is fine.
You're compiling a (presumably) C program [ so your post is doubly off-topic ;-) ] with a C++ compiler - might well
work, as valid C code may also be valid C++ code...
But if first build the object and then the
executable, I run into the error.

g++ -c my_program.c

g++ my_program.o -o my_program
You're trying to link a C program with a C++ linker - might well not work.
ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status

Does anyone know what causes this error to occur and how can I fix it?


Use gcc (not g++) for C programs.

--
Lionel B
Jul 23 '05 #3

P: n/a
great thnx!

Jul 23 '05 #4

P: n/a
I remember having this error and getting puzzled long time ago.
Just tried it, and I don't see a problem any more.
I am using g++ 3.3.2.

Nadina wrote:
Hello,

I have been getting the following error:

ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status

while I was trying to link several .o files in my project. I googled
this error and it seems to be caused by double import of external
variables/constants/functions.

However when I could not figure out what caused the error I stripped
down my program to a simple "hello world" AND... surprize I keep
getting the same error.

As long as I do
g++ my_program.c -o my_program

everything is fine. But if first build the object and then the
executable, I run into the error.

g++ -c my_program.c

g++ my_program.o -o my_program
ld: fatal: file my_program: creation interrupted: No space left on
devicecollect2: ld returned 1 exit status

Does anyone know what causes this error to occur and how can I fix it?
Thank you!
Nadina

Jul 23 '05 #5

P: n/a
Haro,

Same here it comes and goes. I dont know what is causing it.
Also I noticed that I could go around it by leaving the -o option out
and then it compiles fine into the a.out file.

I posted in gnu.g++.help and no answer yet. If i hear something I'll
let you know too.
Nadina

Jul 23 '05 #6

P: n/a
Hi Haro,

The g++ error was caused by lack of hard drive space. The system admin
confirmed that, plus someone else from the gnu.g++.help group.

Here is the link if you want to see his exact answer:
http://groups-beta.google.com/group/...9e99ecf8?hl=en

Jul 23 '05 #7

P: n/a
Thanks Nadina for update.
I guess in my case it was not the problem but
I will keep this in my mind.
Nadina wrote:
Hi Haro,

The g++ error was caused by lack of hard drive space. The system admin
confirmed that, plus someone else from the gnu.g++.help group.

Here is the link if you want to see his exact answer:
http://groups-beta.google.com/group/...9e99ecf8?hl=en

Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.