Advertisement

wxWidgets Compiling on Windows

Started by October 22, 2011 10:07 PM
2 comments, last by NumberXaero 13 years, 1 month ago
Hi,

This REALLY shouldn't be this difficult. I've spent the past four hours making slow progress.

Okay, so I've downloaded wxWidgets 2.9, and compiled every configuration in the wx.dsw file. (Note: some project configurations do not build completely. For example, for the configuration DLL Debug, 10 succeed, 12 fail (the first error is "LINK : fatal error LNK1104: cannot open file '..\..\lib\vc_dll\wxmsw29ud_adv.lib'")).

I attempted to make a new project to get at least something working. In my code, I go:[source]#include <wx/string.h>

int main(int argc, char *argv[]) {
wxPuts(wxT("A wxWidgets console application"));
return 0;
}[/source]. . . and get a crapload of linker errors concerning std::basic_string and the like. I added[source]#define WXUSINGDLL[/source]. . . to the top, and I get much fewer linker errors:[source]1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall wxString::~wxString(void)" (__imp_??1wxString@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl wxPuts(class wxString const &)" (__imp_?wxPuts@@YAHABVwxString@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall wxString::wxString(wchar_t const *)" (__imp_??0wxString@@QAE@PB_W@Z) referenced in function _main
1>C:\dev\C++\Test WX\Debug\Test WX.exe : fatal error LNK1120: 3 unresolved externals[/source]

I'm not even sure linking against dlls is a good plan--for distribution, wouldn't the dlls also have to be distributed? In any case, I can't get anything in wxWidgets to compile at all!!!

Help!
Ian

[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

Heheh, yea, wxWidgets gave me trouble as well. I figured if it gave me that much trouble just getting the thing to compile, I'd probably fight with it all through trying to use it too. So I dropped it and went with Qt instead, and it's so wonderful I am more and more switching over to the entire suite of Qt libraries and not just the GUI stuff. It's the cleanest, best designed, most extensive, most flexible, and best documented, C++ library with the largest community of any library I've ever used so far. It's cross-platform, and true opensouce with LGPL license.
When I say it's extensive and well designed, think Boost. It's entirely inter-operable with the C++ standard library, but offers replacement classes for the majority of it anyway, and the replacement classes are way better in terms of flexibility and features. I've even switched to the Qt IDE. biggrin.gif

So uh, sorry I can't help with your wxWidgets problem. smile.gif
The best I can do is offer an alternative.

fanatic.png
Advertisement

...


How did you compile wxWidgets? Have you setup all the .libs?

wxmsw29ud_adv.lib
wxmsw29ud_core.lib
wxbase29ud.lib
wxtiffd.lib
wxjpegd.lib
wxpngd.lib
wxzlibd.lib
wxregexud.lib
wxexpatd.lib


Try compiling and running a sample.


Qt fanatic.


I agree with this. The only problem is it's pretty hard to use any other IDE but Qts...

Engineering Manager at Deloitte Australia

I dont remember 2.9 having trouble compiling but in previous versions I remember I had to build multiple times (not rebuild, build) using the wx.dsw solution. It seems some of the libs depend on others and the order they build is wrong. So hitting build once will build some, building again will build a few more (using the ones from build 1), and so on, eventually they all built.

This topic is closed to new replies.

Advertisement