project setup for MSVC++ 2008 Express Edition Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
MoonKid
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 543
Joined: Wed Apr 05, 2006 9:39 am
Contact:

project setup for MSVC++ 2008 Express Edition

Post by MoonKid »

I build my project on WinXP with MinGW and Code::Blocks. Now I want to migrate it to MSVC++ 2008 Express Edition.

I compiled wx from SVN with MSVC in "Debug DLL" mode. It work fine.

In my own project I setup lib\vc_dll as lib-dir. And I copied all extra libs from the widgets-sample in my own project. But there are still some unreferences symbols.

This is the linker commandline that the IDE shows to me.

Code: Select all

/OUT:"D:\Garage\projekte\blackfisk\Kopie von trunk\blackfisk\Debug\blackfisk.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\wxWidgets\lib\vc_dll" /MANIFEST /MANIFESTFILE:"Debug\blackfisk.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\Garage\projekte\blackfisk\Kopie von trunk\blackfisk\Debug\blackfisk.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT wxmsw29ud_adv.lib wxmsw29ud_core.lib wxbase29ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wininet.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
This is cutted the linker output for it

Code: Select all

1>------ Erstellen gestartet: Projekt: blackfisk, Konfiguration: Debug Win32 ------
1>Verknüpfen...
1>BFTaskDlg.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""protected: static struct wxEventTable const wxDialogBase::sm_eventTable" (?sm_eventTable@wxDialogBase@@1UwxEventTable@@B)".
1>BFMessageDlg.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""protected: static struct wxEventTable const wxDialogBase::sm_eventTable" (?sm_eventTable@wxDialogBase@@1UwxEventTable@@B)".
...
1>BFProgressCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxValidator const wxDefaultValidator" (?wxDefaultValidator@@3VwxValidator@@B)".
...
1>BFProjectPlannerDlg.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""char const * const wxButtonNameStr" (?wxButtonNameStr@@3QBDB)".
...
1>BFAboutDlg.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""char const * const wxStaticBitmapNameStr" (?wxStaticBitmapNameStr@@3QBDB)".
...
1>BFPlaceholderButton.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)".
...
1>BFTaskListCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxSize const wxDefaultSize" (?wxDefaultSize@@3VwxSize@@B)".
...
1>BFDirCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""wchar_t const * const wxEmptyString" (?wxEmptyString@@3PB_WB)".
...
1>BFTask.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxMBConv * wxConvLibcPtr" (?wxConvLibcPtr@@3PAVwxMBConv@@A)".
...
1>BFProjectSettingsDlg.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static unsigned int const wxString::npos" (?npos@wxString@@2IB)".
...
1>BFwxLog.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""struct wxPrivate::UntypedBufferData * wxPrivate::untypedNullDataPtr" (?untypedNullDataPtr@wxPrivate@@3QAUUntypedBufferData@1@A)".
...
1>BFTaskDlg.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxEventTypeTag<class wxCommandEvent> const wxEVT_COMMAND_BUTTON_CLICKED" (?wxEVT_COMMAND_BUTTON_CLICKED@@3V?$wxEventTypeTag@VwxCommandEvent@@@@B)".
...
1>BFTimeDurationCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxDateTime const wxDefaultDateTime" (?wxDefaultDateTime@@3VwxDateTime@@B)".
...
1>BFHyperlinkCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""protected: static struct wxEventTable const wxWindow::sm_eventTable" (?sm_eventTable@wxWindow@@1UwxEventTable@@B)".
...
1>BFBackupTree.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxEventTypeTag<class wxTreeEvent> const wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK" (?wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK@@3V?$wxEventTypeTag@VwxTreeEvent@@@@B)".
...
1>BFProjectSettingsCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxEventTypeTag<class wxFileDirPickerEvent> const wxEVT_COMMAND_DIRPICKER_CHANGED" (?wxEVT_COMMAND_DIRPICKER_CHANGED@@3V?$wxEventTypeTag@VwxFileDirPickerEvent@@@@B)".
...
1>BFMainFrame.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""protected: static struct wxEventTable const wxFrame::sm_eventTable" (?sm_eventTable@wxFrame@@1UwxEventTable@@B)".
...
1>wxSerialize.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class wxMBConvStrictUTF8 * wxConvUTF8Ptr" (?wxConvUTF8Ptr@@3PAVwxMBConvStrictUTF8@@A)".
1>D:\Garage\projekte\blackfisk\Kopie von trunk\blackfisk\Debug\blackfisk.exe : fatal error LNK1120: 79 nicht aufgelöste externe Verweise.
1>Das Buildprotokoll wurde unter "file://d:\Garage\projekte\blackfisk\Kopie von trunk\blackfisk\blackfisk\Debug\BuildLog.htm" gespeichert.
1>blackfisk - 419 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan »

Hi,
show compiler command line too.
I guess you forgot add /DWXUSINGDLL option, because you are using wx as DLLs.
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
MoonKid
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 543
Joined: Wed Apr 05, 2006 9:39 am
Contact:

Post by MoonKid »

This help a little bit.

Now there are just 11 errors for missing symbols

Code: Select all

1>------ Erstellen gestartet: Projekt: blackfisk, Konfiguration: Debug Win32 ------
1>Verknüpfen...
1>   Bibliothek "blackfisk_.lib" und Objekt "blackfisk_.exp" werden erstellt.
1>BFMainFrame.obj : warning LNK4049: Lokal definiertes Symbol "?BF_EVENT_THREAD_END@@3HB (int const BF_EVENT_THREAD_END)" wurde importiert.
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual class wxInputStream * __thiscall wxFTP::GetInputStream(class wxString const &)" (__imp_?GetInputStream@wxFTP@@UAEPAVwxInputStream@@ABVwxString@@@Z)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: bool __thiscall wxFTP::FileExists(class wxString const &)" (__imp_?FileExists@wxFTP@@QAE_NABVwxString@@@Z)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: bool __thiscall wxFTP::ChDir(class wxString const &)" (__imp_?ChDir@wxFTP@@QAE_NABVwxString@@@Z)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall wxFTP::~wxFTP(void)" (__imp_??1wxFTP@@UAE@XZ)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual bool __thiscall wxFTP::Connect(class wxString const &)" (__imp_?Connect@wxFTP@@UAE_NABVwxString@@@Z)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: void __thiscall wxProtocol::SetPassword(class wxString const &)" (__imp_?SetPassword@wxProtocol@@QAEXABVwxString@@@Z)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: void __thiscall wxProtocol::SetUser(class wxString const &)" (__imp_?SetUser@wxProtocol@@QAEXABVwxString@@@Z)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>BFApp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall wxFTP::wxFTP(void)" (__imp_??0wxFTP@@QAE@XZ)" in Funktion ""private: class wxString __thiscall BFApp::ReadFileFromFTP(class wxString const &,class wxString const &,class wxString const &,class wxString const &,class wxString const &)" (?ReadFileFromFTP@BFApp@@AAE?AVwxString@@ABV2@0000@Z)".
1>blackfisk_.exe : fatal error LNK1120: 8 nicht aufgelöste externe Verweise.
1>Projekt : warning PRJ0018 : Folgende Umgebungsvariablen konnten nicht gefunden werden:
1>$(ConfigrationName)
1>Das Buildprotokoll wurde unter "file://d:\Garage\projekte\blackfisk\Kopie von trunk\.out_Debug\BuildLog.htm" gespeichert.
1>blackfisk - 9 Fehler, 1 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan »

Well, it is quite obvious. This time you have forgotten to add wxbase28ud_net.lib :)
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
MoonKid
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 543
Joined: Wed Apr 05, 2006 9:39 am
Contact:

Post by MoonKid »

Thank you. There should be a doc about such errors. ;)

Now there is a mysterious warning

Code: Select all

BFMainFrame.obj : warning LNK4049: Lokal definiertes Symbol "?BF_EVENT_THREAD_END@@3HB (int const BF_EVENT_THREAD_END)" wurde importiert.
I define that event by myself.

Code: Select all

#ifdef __MINGW32__
    extern const wxEventType BF_EVENT_THREAD_END;
#else
    BEGIN_DECLARE_EVENT_TYPES()
    DECLARE_EVENT_TYPE(BF_EVENT_THREAD_END, -1)
    END_DECLARE_EVENT_TYPES()
#endif
Should I use the MinGW code for MSVC++, too?
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan »

Replace
DECLARE_EVENT_TYPE(BF_EVENT_THREAD_END, -1)
to
DECLARE_LOCAL_EVENT_TYPE(BF_EVENT_THREAD_END, -1)
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Post Reply