errors building wxWidgets in VS2008 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
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

errors building wxWidgets in VS2008

Post by jesseb07 »

hello, I usually develop in linux so this is an area in which I don't have much breadth of knowledge. I've been following the steps outlined in the wiki (here: http://wiki.wxwidgets.org/Microsoft_Vis ... B%2B_Guide) and I'm running into problems in section 3. I tried to just do the "batch build all" but that gave me about 100 errors of various sorts, so I've been doing the manual build of the individual components and that went well up to building "odbc" where I got 8 errors:

Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagTIMESTAMP_STRUCT const *)" (__imp_??4wxVariant@@QAEXPBUtagTIMESTAMP_STRUCT@@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " (?GetColumn@wxDbTable@@UBE?AVwxVariant@@H@Z) dbtable.obj odbc

Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagTIME_STRUCT const *)" (__imp_??4wxVariant@@QAEXPBUtagTIME_STRUCT@@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " (?GetColumn@wxDbTable@@UBE?AVwxVariant@@H@Z) dbtable.obj odbc

Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagDATE_STRUCT const *)" (__imp_??4wxVariant@@QAEXPBUtagDATE_STRUCT@@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " (?GetColumn@wxDbTable@@UBE?AVwxVariant@@H@Z) dbtable.obj odbc

Error 4 fatal error LNK1120: 3 unresolved externals ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.dll odbc

Error 5 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagTIMESTAMP_STRUCT const *)" (__imp_??4wxVariant@@QAEXPBUtagTIMESTAMP_STRUCT@@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " (?GetColumn@wxDbTable@@UBE?AVwxVariant@@H@Z) dbtable.obj odbc

Error 6 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagTIME_STRUCT const *)" (__imp_??4wxVariant@@QAEXPBUtagTIME_STRUCT@@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " (?GetColumn@wxDbTable@@UBE?AVwxVariant@@H@Z) dbtable.obj odbc

Error 7 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagDATE_STRUCT const *)" (__imp_??4wxVariant@@QAEXPBUtagDATE_STRUCT@@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " (?GetColumn@wxDbTable@@UBE?AVwxVariant@@H@Z) dbtable.obj odbc

Error 8 fatal error LNK1120: 3 unresolved externals ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.dll odbc

WxWidgets version: 2.8.9

I did a google search trying to find a solution, but I didn't find any vs2008 LNK1120 errors relating to wxwidgets.

I am working just in the "wx" project that results from loading the wx.proj file from inside the wxwidgets program files so many of the linker options etc, are not available to me. It seemed from the wiki that I would need to build wxwidgets before I could use it in a project, but maybe that was an incorrect assumption.

Let me know if any other information would be relevant to include, any help would be appreciated.

Thanks!

~J
Last edited by jesseb07 on Wed Mar 18, 2009 9:04 pm, edited 3 times in total.
jacmoe
Experienced Solver
Experienced Solver
Posts: 64
Joined: Sun Feb 22, 2009 3:34 pm
Location: Denmark
Contact:

Post by jacmoe »

Care to elaborate? :)
What wxWidgets version are you on?
What kind of errors do you get?

It works just fine here. :wink:
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

Post by jesseb07 »

it's not displaying my posts, that's odd, must have been a strange formatting with copying/pasting my errors, I'll try again.

Edit: Fixed it
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan »

Hi,
it looks like you had built wxbase component with wxUSE_ODBC=0. Try rebuild wxbase with wxUSE_ODBC=1.
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

Post by jesseb07 »

thanks for the reply.

I don't see where I can set build flags inside vs2008, do I need to do this outside of the environment or is there a set of options I am not aware of?

Also, I don't want to assume anything, so I wanted to double check what you meant:

I'm following the build instructions and are building the modules in the following order:

wxjpeg
wxpng
wxtiff
wxzlib
wxregex
wxexpat
base
net
odbc
xml
core
gl
html
media
qa
adv
dbgrid
xrc
aui
richtext

so I assume you are referring to "base" when you said "wxbase" but I wanted to be sure, because otherwise I don't recalling building a module called "wxbase." Thanks.

~J
rodrigod
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Thu Jun 26, 2008 8:50 pm

Post by rodrigod »

Actually if those are all the errors you get, it means that only odbc didnt get compiled

So if you are not planning on using it (and you shouldn't) than everything is all right.


Bye
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

Post by jesseb07 »

I am building them one at a time so I could isolate what was giving me problems, but I skipped "odbc" and continued to see what would happen. There must be an underlying problem somewhere because when I tried to build "core" I got the following errors:

Warning 1 warning C4251: 'wxListMainWindow::m_aColWidths' : class 'ColWidthArray' needs to have dll-interface to be used by clients of class 'wxListMainWindow' c:\wxWidgets-2.8.9\src\generic\listctrl.cpp 778 core

Error 2 error LNK2019: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) referenced in function "public: static int __cdecl wxApp::GetComCtl32Version(void)" (?GetComCtl32Version@wxApp@@SAHXZ) app.obj core

Error 3 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) appcmn.obj core

Error 4 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) msgout.obj core

Error 5 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) rendcmn.obj core

Error 6 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) utilscmn.obj core

Error 7 fatal error LNK1120: 1 unresolved externals ..\..\lib\vc_dll\wxmsw28ud_core_vc_custom.dll core

Warning 8 warning C4251: 'wxListMainWindow::m_aColWidths' : class 'ColWidthArray' needs to have dll-interface to be used by clients of class 'wxListMainWindow' c:\wxWidgets-2.8.9\src\generic\listctrl.cpp 778 core

Error 9 error LNK2019: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) referenced in function "public: static int __cdecl wxApp::GetComCtl32Version(void)" (?GetComCtl32Version@wxApp@@SAHXZ) app.obj core

Error 10 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) appcmn.obj core

Error 11 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) msgout.obj core

Error 12 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) rendcmn.obj core

Error 13 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" (?GetAssertStackTrace@wxAppTraitsBase@@MAE?AVwxString@@XZ) utilscmn.obj core

Error 14 fatal error LNK1120: 1 unresolved externals ..\..\lib\vc_dll\wxmsw28d_core_vc_custom.dll core

Warning 15 warning C4251: 'wxListMainWindow::m_aColWidths' : class 'ColWidthArray' needs to have dll-interface to be used by clients of class 'wxListMainWindow' c:\wxWidgets-2.8.9\src\generic\listctrl.cpp 778 core

Warning 16 warning C4251: 'wxListMainWindow::m_aColWidths' : class 'ColWidthArray' needs to have dll-interface to be used by clients of class 'wxListMainWindow' c:\wxWidgets-2.8.9\src\generic\listctrl.cpp 778 core


Since core is necessary (as the name suggests, I think), there seems to be a problem.

~J
jacmoe
Experienced Solver
Experienced Solver
Posts: 64
Joined: Sun Feb 22, 2009 3:34 pm
Location: Denmark
Contact:

Post by jacmoe »

You need to edit wxWidgets/lib/vc_lib/mswu/wx/setup.h (IIRC).
If wxUSE_ODBC is set to 0, set it to 1. :wink:
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

Post by jesseb07 »

I've changed wxUSE_ODBC to 1, but when I batch build odbc (and even when I rebuild "base"), it changes it back to 0. I realize this is probably a simple solution, I'm just quite new to customizing builds. Thanks.
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

Post by jesseb07 »

wow this is frustrating. Anyway, I'm going to completely ignore the problem I'm having with "odbc" because I don't need database things at this point. Does anyone have a suggestion on what could be wrong when building "core"?

Thanks.

~J
jacmoe
Experienced Solver
Experienced Solver
Posts: 64
Joined: Sun Feb 22, 2009 3:34 pm
Location: Denmark
Contact:

Post by jacmoe »

I suggest getting wxWidgets 2.9 from SVN.
They removed ODBC, AFAIK. :wink:
jesseb07
Earned a small fee
Earned a small fee
Posts: 10
Joined: Tue Feb 17, 2009 1:45 am

Post by jesseb07 »

well, I fixed the odbc problem by editing the following file:

C:\wxWidgets-2.8.9\include\wx\msw\setup.h
(little bit different path than was suggested, but that happens)

and setting wxUSE_ODBC to 1.

I still had the same errors when building "core" and I couldn't figure that out, something about strings. So I copped out and went with wxPack. It works now ;)

Thanks for all your help.
Post Reply