Re: wxWidgets und vc++
Hi
Anscheinend weiss niemand bescheid, ich probiere es mal ein wenig komkreter zu umschreiben.
Ich habe die libs von wxwidgets erstellt mit vc++. nun habe ich ein eigenes Projekt erstellt und folgendes reingeschrieben:
#include "wx/wx.h"
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
DECLARE_APP(MyApp)
IMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, "Hello World");
frame->CreateStatusBar();
frame->SetStatusText("Hello World");
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
Das kompilieren funktioniert 0 errors...
Aber das linken nicht. Bekomme immer folgende Fehlermeldungen:
--------------------Configuration: test - Win32 Debug--------------------
Linking...
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strftime already defined in LIBCMTD.lib(strftime.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __vsnprintf already defined in LIBCMTD.lib(vsnprint.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strpbrk already defined in LIBCMTD.lib(strpbrk.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __snprintf already defined in LIBCMTD.lib(snprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _setlocale already defined in LIBCMTD.lib(setlocal.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __stricmp already defined in LIBCMTD.lib(stricmp.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __CrtSetDbgFlag already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __close already defined in LIBCMTD.lib(close.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __commit already defined in LIBCMTD.lib(commit.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
test.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxStringData::Free(void)" (?Free@wxStringData@@QAEXXZ)
Debug_/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
test.exe - 28 error(s), 1 warning(s)
Weiss einer was bei den Settings im VC++ falsch ist damit ich das Projekt linken kann.
Vielen Dank