473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

g++ linker behavior

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
7 3406
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
"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
great thnx!

Jul 23 '05 #4
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sam Smith | last post by:
Hi, I'm thinking about whether or not to build a general library on its own and later link that lib with the main executable, or to build the main executable with a subset of the relevant source...
1
by: Generic Usenet Account | last post by:
I am "plugging in" a class type into an STL map definition and I am getting linker errors unless all my class definitions are defined in the header file, as opposed to a separate source file. This...
0
by: Tom McDermott | last post by:
I am having linker errors : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types This code linked sucessfully in C++.NET 2002, but does...
3
by: Steve Baer | last post by:
I recently read your whitepaper under the "extremely long link times" post and have a question that I was hoping you could answer. My question is based on the following paragraph: Directives...
4
by: izhar.wallach | last post by:
Hi all, I've noticed an odd behavior of the linker while trying to compile the code below. The linking did not fail even though variable a1 (A2.cpp) was defined as extern in namespace A2 while...
3
by: Ninan | last post by:
I am using gcc compiler gcc B.o Main.o -lMyLib //A.h class A { public: A(); void abc ();
1
by: =?Utf-8?B?RmFiaWFu?= | last post by:
I have a native singleton in a C++/CLI dll. To compile the dll itself I put a declaration of the instance variable into the cpp file (otherwise the linker complains with a LNK 2020). I now want to...
1
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- ...
3
by: Rahul | last post by:
Hi Everyone, I have the following polymorphic classes, class Shape { public : virtual void draw() { } virtual void sample();
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.