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 » Wed Mar 18, 2009 8:07 pm

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 *)" ([email protected]@[email protected]@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " ([email protected]@@[email protected]@[email protected]) dbtable.obj odbc

Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagTIME_STRUCT const *)" ([email protected]@[email protected]@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " ([email protected]@@[email protected]@[email protected]) dbtable.obj odbc

Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagDATE_STRUCT const *)" ([email protected]@[email protected]@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " ([email protected]@@[email protected]@[email protected]) 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 *)" ([email protected]@[email protected]@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " ([email protected]@@[email protected]@[email protected]) dbtable.obj odbc

Error 6 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagTIME_STRUCT const *)" ([email protected]@[email protected]@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " ([email protected]@@[email protected]@[email protected]) dbtable.obj odbc

Error 7 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall wxVariant::operator=(struct tagDATE_STRUCT const *)" ([email protected]@[email protected]@@Z) referenced in function "public: virtual class wxVariant __thiscall wxDbTable::GetColumn(int)const " ([email protected]@@[email protected]@[email protected]) 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 » Wed Mar 18, 2009 8:21 pm

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 » Wed Mar 18, 2009 8:48 pm

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
Moderator
Moderator
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan » Thu Mar 19, 2009 6:25 am

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 » Thu Mar 19, 2009 6:31 pm

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 » Thu Mar 19, 2009 6:35 pm

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 » Thu Mar 19, 2009 7:23 pm

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)" ([email protected]@@[email protected]@XZ) referenced in function "public: static int __cdecl wxApp::GetComCtl32Version(void)" ([email protected]@@SAHXZ) app.obj core

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

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

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

Error 6 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" ([email protected]@@[email protected]@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)" ([email protected]@@[email protected]@XZ) referenced in function "public: static int __cdecl wxApp::GetComCtl32Version(void)" ([email protected]@@SAHXZ) app.obj core

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

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

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

Error 13 error LNK2001: unresolved external symbol "protected: virtual class wxString __thiscall wxAppTraitsBase::GetAssertStackTrace(void)" ([email protected]@@[email protected]@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 » Fri Mar 20, 2009 7:51 am

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 » Fri Mar 20, 2009 8:16 pm

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 » Sat Mar 21, 2009 10:14 pm

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 » Sat Mar 21, 2009 10:26 pm

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 » Sun Mar 22, 2009 11:31 pm

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