468,512 Members | 1,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

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

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

Jul 18 '06 #1
2 14096
kai wrote:
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-lit...t.html#faq-5.9

Cheers! --M

Jul 18 '06 #2
kai wrote:
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

Jul 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by pptran | last post: by
4 posts views Thread by John | last post: by
1 post views Thread by yanwan | last post: by
3 posts views Thread by Felix Kater | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.