error during linking with gcc: multiple definition of `__cygwin_crt0_bp' ...

K

kai

Hello,

I wrote a little c++-program (hallo world) and I wanted to compile and
link this.


my steps:
1. set
GCC_EXEC_PREFIX=J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\


2. gcc test.cpp -o test.o

3. C:\tmp\rs\dev>gcc test.o -o "Project1.exe"
test.o(.data+0x0):fake: multiple definition of `__cygwin_crt0_bp'
J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B­19\../../../../i386-cygwin32\lib\crt0.o(.data+0x0):crt0.c:

first defined here
test.o(.text+0x0):fake: multiple definition of `mainCRTStartup'
J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B­19\../../../../i386-cygwin32\lib\crt0.o(.text+0x0):crt0.c:

first defined here


I don't get an executable.
What is the reason and how can I resolve this problem?
Thank's for your hints, Kai
 
M

mlimber

kai said:
Hello,

I wrote a little c++-program (hallo world) and I wanted to compile and
link this.


my steps:
1. set
GCC_EXEC_PREFIX=J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\


2. gcc test.cpp -o test.o

3. C:\tmp\rs\dev>gcc test.o -o "Project1.exe"
test.o(.data+0x0):fake: multiple definition of `__cygwin_crt0_bp'
J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B­19\../../../../i386-cygwin32\lib\crt0.o(.data+0x0):crt0.c:

first defined here
test.o(.text+0x0):fake: multiple definition of `mainCRTStartup'
J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B­19\../../../../i386-cygwin32\lib\crt0.o(.text+0x0):crt0.c:

first defined here


I don't get an executable.
What is the reason and how can I resolve this problem?
Thank's for your hints, Kai

This is a compiler-specific problem that you should take to a g++
forum. See this FAQ for what is on-topic here and for several other
newsgroups that you might try:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

Cheers! --M
 
T

Thomas Tutone

kai said:
I wrote a little c++-program (hallo world) and I wanted to compile and
link this.


my steps:
1. set
GCC_EXEC_PREFIX=J:\Software\WinProgs\cyggnu\h-i386-cygwin32\lib\gcc-lib\


2. gcc test.cpp -o test.o

<implementation specific/>

Change the above line to:

gcc -Wall -Wextra -pedantic -c test.cpp -o test.o

</implementation specific>

[snip]

Best regards,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top