Archived

This forum has been archived. Please start a new discussion on GitHub.

Error using Makefile with Eclipse with MinGW

I want to work with Eclipse with the C++-Compiler by MinGW.

I wrote a makefile in Eclipse to compile my programm:
all:
g++ -I"Client\headerFiles" \
-I"C:\Ice-3.3.0-VC90\include" -c \
Client\resourceFiles\Client.cpp \
Client\resourceFiles\Printer.cpp

g++ -L"C:\Ice-3.3.0-VC90\lib" -o adapterTest.exe \
Client.o Printer.o \
-l ice -l iceutil -l icegrid
But the linker gives me some error messages:

Client.o(.text+0x652):Client.cpp: undefined reference to `IceUtil::operator<<(std::ostream&, IceUtil::Exception const&)'
Client.o(.text+0x8b4):Client.cpp: undefined reference to `IceInternal::FactoryTable::FactoryTable()'
Client.o(.text+0x971):Client.cpp: undefined reference to `IceGrid::UserAccountNotFoundException::~UserAccountNotFoundException()'
Client.o(.text+0x98c):Client.cpp: undefined reference to `Ice::AdapterNotFoundException::~AdapterNotFoundException()'
Client.o(.text+0x9a7):Client.cpp: undefined reference to `IceGrid::ParseException::~ParseException()'
Client.o(.text+0x9dd):Client.cpp: undefined reference to `IceGrid::ApplicationNotExistException::~ApplicationNotExistException()'
Client.o(.text+0x9f8):Client.cpp: undefined reference to `Glacier2::CannotCreateSessionException::~CannotCreateSessionException()'
Client.o(.text+0xa13):Client.cpp: undefined reference to `IceInternal::FactoryTable::~FactoryTable()'
Client.o(.text$_ZN11IceInternal6HandleIN3Ice12CommunicatorEEC1EPS2_[IceInternal::Handle<Ice::Communicator>::Handle(Ice::Communicator*)]+0x2a):Client.cpp: undefined reference to `IceInternal::upCast(Ice::Communicator*)'
Client.o(.text$_ZN11IceInternal6HandleIN3Ice12CommunicatorEED1Ev[IceInternal::Handle<Ice::Communicator>::~Handle()]+0x17):Client.cpp: undefined reference to `IceInternal::upCast(Ice::Communicator*)'
Client.o(.text$_ZN11IceInternal6HandleIN3Ice10PropertiesEEC1EPS2_[IceInternal::Handle<Ice::Properties>::Handle(Ice::Properties*)]+0x2a):Client.cpp: undefined reference to `IceInternal::upCast(Ice::Properties*)'
etc...

But I'm sure, that in C:\Ice-3.3.0-VC90\lib are the files "ice.lib" "icegrid.lib" "iceutil.lib"

What is wrong with my Makefile?

Comments

  • matthew
    matthew NL, Canada
    You built Ice yourself, or you are using a binary installation? If binary, then that cannot work with MinGW since the libraries are only for specific compilers (ie: Microsoft & Borland).