PDA

View Full Version : 3dBuzz VTM: wxWidgets linking problem


BernieK
08-29-2005, 04:38 PM
hello!

i started the 3dBuzz GUI-Design VTM and i have some problems getting wxwidgets to run properly.

i use visual studio 2005 beta 2 with ms platform sdk (april 2005) and wxwidgets 2.5.3

when creating the libraries in wxwidgets i do get a lot of warnings (more than the guys in the VTM), but all 7 builds are successful.

when trying to compile my first project (of course the helloWorld :) ) i get some linking errors.

here is my code:


#include "wx/wx.h"

class HelloWorldApp : public wxApp
{
public:
virtual bool OnInit();
};

IMPLEMENT_APP(HelloWorldApp)

bool HelloWorldApp::OnInit()
{
wxFrame *frame = new wxFrame(NULL, -1, argv[0]);

frame->Show(TRUE);

SetTopWindow(frame);

return true;
}


and here are the errors i get:


------ Rebuild All started: Project: helloWorldAppFinal, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'helloWorldAppFinal', configuration 'Debug|Win32'
Compiling...
helloWorldApp.cpp
c:\program files\wxwidgets-2.5.3\include\wx\buffer.h(96) : warning C4996: 'strdup' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(170) : see declaration of 'strdup'
Compiling manifest to resources...
Linking...
helloWorldApp.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall wxApp::Initialize(int &,wchar_t * *)" (?Initialize@wxApp@@UAE_NAAHPAPA_W@Z)
helloWorldApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
helloWorldApp.obj : error LNK2001: unresolved external symbol "wchar_t const * const wxFrameNameStr" (?wxFrameNameStr@@3PB_WB)
helloWorldApp.obj : error LNK2019: unresolved external symbol "protected: void __thiscall wxStringBase::InitWith(wchar_t const *,unsigned int,unsigned int)" (?InitWith@wxStringBase@@IAEXPB_WII@Z) referenced in function "public: __thiscall wxStringBase::wxStringBase(wchar_t const *)" (??0wxStringBase@@QAE@PB_W@Z)
helloWorldApp.obj : error LNK2019: unresolved external symbol "void __cdecl wxAssert(int,wchar_t const *,int,wchar_t const *,wchar_t const *)" (?wxAssert@@YAXHPB_WH00@Z) referenced in function "public: __thiscall wxStringBase::wxStringBase(class wxStringBase const &)" (??0wxStringBase@@QAE@ABV0@@Z)
helloWorldApp.obj : error LNK2001: unresolved external symbol "wchar_t const * const wxEmptyString" (?wxEmptyString@@3PB_WB)
Debug\helloWorldAppFinal.exe : fatal error LNK1120: 6 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Bernie\My Documents\Visual Studio 2005\Projects\helloWorldAppFinal\helloWorldAppFina l\Debug\BuildLog.htm"
helloWorldAppFinal - 7 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


i hope anyone can help me...

cheers!

BernieK
08-29-2005, 04:46 PM
just found something on the ms-sdk homepage:

If you are using Microsoft Visual C/C++, run it at least once before installing the SDK. This will ensure that the environment variables are correctly configured

i did not run vc++ before installing the sdk. can this somehow cause these problems?

gga
08-30-2005, 06:04 AM
You forgot to link your code against the wx library. As such, all the WxWidgets symbols are failing. You need to specify either the library's .lib (if you want a static link) or .dll (a dynamic link) file for it. Usually, you will want a dynamic link.
You can add that in your project settings. If you are unsure, I'm pretty sure wxwidgets already comes with some vc projects, so check your settings against those.

CGTalk Moderation
08-30-2005, 06:04 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.