This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Help for GCC newbie
- From: "Rupert Wood" <me at rupey dot net>
- To: "'mark grimshaw'" <mark_grimshaw at hotmail dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 1 May 2002 08:40:27 +0100
- Subject: RE: Help for GCC newbie
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.