* RE: Help for GCC newbie
[not found] <616BE6A276E3714788D2AC35C40CD18D5FB5BD@whale.softwire.co.uk>
@ 2002-05-01 0:40 ` Rupert Wood
[not found] ` <616BE6A276E3714788D2AC35C40CD18D5EC37C@whale.softwire.co.u k>
1 sibling, 0 replies; 3+ messages in thread
From: Rupert Wood @ 2002-05-01 0:40 UTC (permalink / raw)
To: 'mark grimshaw'; +Cc: gcc-help
Mark Grimshaw wrote:
> I compile my program using:
> g++ -W -pedantic -o test.o test.cpp (this works ok)
> g++ -o test.exe test.o
:
> test.o: In function `main':
> /home/mark/C++programming/test.cpp:14: multiple definition of
> `__dso_handle'
You're actually generating an executable in the first step and not an
object file. (The error occurs because you're then attempting to re-link
the executable with all the standard libraries.) You probably want to
add '-c' to the first command line to compile without linking.
As a side note, you probably also want to add either '-g' to both steps
to include debugging information in the executable, or add '-O2' to the
first to build an optimised release.
Hope that helps,
Rup.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Help for GCC newbie
[not found] ` <616BE6A276E3714788D2AC35C40CD18D5EC37C@whale.softwire.co.u k>
@ 2002-05-02 16:17 ` Andrea 'Fyre Wyzard' Bocci
0 siblings, 0 replies; 3+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2002-05-02 16:17 UTC (permalink / raw)
To: Rupert Wood, 'mark grimshaw'; +Cc: gcc-help
At 08.40 01/05/2002 (GMT +0100), Rupert Wood wrote:
>As a side note, you probably also want to add either '-g' to both steps
>to include debugging information in the executable, or add '-O2' to the
>first to build an optimised release.
Of both (-g -O2). gcc support debugging info when optimisig, so you can
actually see how the optimised code runs.
fw
^ permalink raw reply [flat|nested] 3+ messages in thread
* Help for GCC newbie
@ 2002-05-01 0:23 mark grimshaw
0 siblings, 0 replies; 3+ messages in thread
From: mark grimshaw @ 2002-05-01 0:23 UTC (permalink / raw)
To: gcc-help
Hello,
I have been trying to get GCC 3.0.4 which i downloaded and built to build
even the simplest 'Hello World' programs. I get the following linker
errors after a simple 'Hello World' has been compiled and similar errors
when trying to build a C program (albeit the C runtime libraries are
mentioned instead) - can anyone help me. Thanks.
I compile my program using:
g++ -W -pedantic -o test.o test.cpp (this works ok)
g++ -o test.exe test.o
test.o: In function `main':
/home/mark/C++programming/test.cpp:14: multiple definition of `__dso_handle'
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/crtbegin.o(.data+0x0): first
defined here
test.o: In function `_init':
test.o(.init+0x0): multiple definition of `_init'
/usr/lib/crti.o(.init+0x0): first defined here
test.o: In function `_start':
test.o(.text+0x0): multiple definition of `_start'
/usr/lib/crt1.o(.text+0x0): first defined here
test.o: In function `main':
/home/mark/C++programming/test.cpp:14: multiple definition of `_fini'
/usr/lib/crti.o(.fini+0x0): first defined here
test.o: In function `main':
/home/mark/C++programming/test.cpp:14: multiple definition of
`_GLOBAL_OFFSET_TABLE_'
/usr/lib/crti.o(.got.plt+0x0): first defined here
test.o: In function `main':
/home/mark/C++programming/test.cpp:14: multiple definition of
`_IO_stdin_used'
/usr/lib/crt1.o(.rodata+0x4): first defined here
test.o: In function `main':
/home/mark/C++programming/test.cpp:14: multiple definition of `__data_start'
/usr/lib/crt1.o(.data+0x0): first defined here
/usr/lib/crti.o(.dynamic+0x0): multiple definition of `_DYNAMIC'
collect2: ld returned 1 exit status
make: *** [build] Error 1
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-02 23:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <616BE6A276E3714788D2AC35C40CD18D5FB5BD@whale.softwire.co.uk>
2002-05-01 0:40 ` Help for GCC newbie Rupert Wood
[not found] ` <616BE6A276E3714788D2AC35C40CD18D5EC37C@whale.softwire.co.u k>
2002-05-02 16:17 ` Andrea 'Fyre Wyzard' Bocci
2002-05-01 0:23 mark grimshaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).