Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Modified & Improved wxWidgets Project Wizard
Biplab:
--- Quote from: TDragon on December 26, 2006, 06:03:18 am ---
--- Quote from: TDragon on December 25, 2006, 07:22:50 pm ---Using GCC, wxbase28, wxmsw28, and wxmsw28_adv are all that I need to build and run one of my wxWidgets projects using the wxWidgets DLLs. None of the additional libraries from the wxWidgets lib directory appear to be necessary, nor do any of the Win32 libs.
--- End quote ---
"Read my lips." If this were not the case, I'd expect the following command line, copied and pasted directly from the Build log, to kick up a few errors:
--- Code: ---mingw32-g++.exe -LE:\Libraries\wxMSW-2.8.0\lib\gcc_dll -o test.exe main.o app.o -lwxmsw28d_core -lwxbase28d -lwxmsw28d_adv
--- End code ---
But there are none, and the resulting executable works without problems. So also does the more complex project I alluded to earlier, which has many more files' worth of code. You might notice that MinGW's "-mwindows" option is unnecessary to successfully build and run it.
--- End quote ---
I've tested this with GCC and Borland. The app compiles even if you don't add a single extra Win32 SDK lib. But with Borland you need to add wxpng and wxzlib libraries in order to compile successfully. But I found a lot of errors while compiling with MSVC 8. Some of them are as follows --
--- Quote ---:: === TestWX, Debug ===
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__GdiFlush@0 referenced in function "public: virtual void __thiscall wxWindow::Update(void)" (?Update@wxWindow@@UAEXXZ)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragAcceptFiles@8 referenced in function "public: virtual void __thiscall wxWindow::DragAcceptFiles(bool)" (?DragAcceptFiles@wxWindow@@UAEX_N@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__GetTextMetricsA@8 referenced in function "public: virtual void __thiscall wxWindow::GetTextExtent(class wxString const &,int *,int *,int *,int *,class wxFont const *)const " (?GetTextExtent@wxWindow@@UBEXABVwxString@@PAH111PBVwxFont@@@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__GetTextExtentPoint32A@16 referenced in function "public: virtual void __thiscall wxWindow::GetTextExtent(class wxString const &,int *,int *,int *,int *,class wxFont const *)const " (?GetTextExtent@wxWindow@@UBEXABVwxString@@PAH111PBVwxFont@@@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragQueryPoint@8 referenced in function "public: bool __thiscall wxWindow::HandleDropFiles(unsigned int)" (?HandleDropFiles@wxWindow@@QAE_NI@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragFinish@4 referenced in function "public: bool __thiscall wxWindow::HandleDropFiles(unsigned int)" (?HandleDropFiles@wxWindow@@QAE_NI@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragQueryFileA@16 referenced in function "public: bool __thiscall wxWindow::HandleDropFiles(unsigned int)" (?HandleDropFiles@wxWindow@@QAE_NI@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__RealizePalette@4 referenced in function "public: bool __thiscall wxWindow::HandlePaletteChanged(void *)" (?HandlePaletteChanged@wxWindow@@QAE_NPAX@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__SelectPalette@12 referenced in function "public: bool __thiscall wxWindow::HandlePaletteChanged(void *)" (?HandlePaletteChanged@wxWindow@@QAE_NPAX@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__CreateRectRgn@16 referenced in function "public: bool __thiscall wxWindow::HandlePaint(void)" (?HandlePaint@wxWindow@@QAE_NXZ)
wxmsw28d_core.lib(checklst.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(listctrl.obj):: error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "public: virtual __thiscall wxCommandEvent::~wxCommandEvent(void)" (??1wxCommandEvent@@UAE@XZ)
wxmsw28d_core.lib(dib.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(clipbrd.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(dcprint.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(bmpbuttn.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(ownerdrw.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(notebook.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(treectrl.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(tooltip.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(button.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(dcmemory.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(listbox.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(window.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(tbar95.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(bitmap.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(dc.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(toplevel.obj):: error LNK2019: unresolved external symbol __imp__OffsetRgn@12 referenced in function "public: virtual bool __thiscall wxTopLevelWindowMSW::SetShape(class wxRegion const &)" (?SetShape@wxTopLevelWindowMSW@@UAE_NABVwxRegion@@@Z)
wxmsw28d_core.lib(region.obj):: error LNK2001: unresolved external symbol __imp__OffsetRgn@12
wxmsw28d_core.lib(statbox.obj):: error LNK2001: unresolved external symbol __imp__OffsetRgn@12
wxmsw28d_core.lib(toplevel.obj):: error LNK2019: unresolved external symbol __imp__ExtCreateRegion@12 referenced in function "public: virtual bool __thiscall wxTopLevelWindowMSW::SetShape(class wxRegion const &)" (?SetShape@wxTopLevelWindowMSW@@UAE_NABVwxRegion@@@Z)
wxmsw28d_core.lib(region.obj):: error LNK2001: unresolved external symbol __imp__ExtCreateRegion@12
wxmsw28d_core.lib(toplevel.obj):: error LNK2019: unresolved external symbol __imp__GetRegionData@12 referenced in function "public: virtual bool __thiscall wxTopLevelWindowMSW::SetShape(class wxRegion const &)" (?SetShape@wxTopLevelWindowMSW@@UAE_NABVwxRegion@@@Z)
wxmsw28d_core.lib(app.obj):: error LNK2019: unresolved external symbol __imp__InitCommonControls@0 referenced in function "public: virtual bool __thiscall wxApp::Initialize(int &,char * *)" (?Initialize@wxApp@@UAE_NAAHPAPAD@Z)
wxmsw28d_core.lib(app.obj):: error LNK2019: unresolved external symbol __imp__OleInitialize@4 referenced in function "bool __cdecl wxOleInitialize(void)" (?wxOleInitialize@@YA_NXZ)
wxmsw28d_core.lib(clipbrd.obj):: error LNK2001: unresolved external symbol __imp__OleInitialize@4
wxmsw28d_core.lib(app.obj):: error LNK2019: unresolved external symbol __imp__OleUninitialize@0 referenced in function "void __cdecl wxOleUninitialize(void)" (?wxOleUninitialize@@YAXXZ)
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===
--- End quote ---
To solve this I started adding Win32 libraries, one by one. At last the addition of following libraries solved the problem.
--- Quote ---winmm.lib, rpcrt4.lib, kernel32.lib, user32.lib, gdi32.lib, ole32.lib, oleaut32.lib, comctl32.lib, comdlg32.lib, uuid.lib, advapi32.lib, shell32.lib
--- End quote ---
But I don't know why the number of libraries required varies with different compilers? wx Gurus, please shed more light on this.
But as long as I don't know why this is happening, I'll follow the safer route. It's better to have peaceful night rather than breaking one's head over huge number of cryptic error messages.
Code::Blocks team had added few libraries, and I've added few more so that I don't get any error messages and I don't see any point of removing them all, as long as it works with all compilers. :D
bnilsson:
Just for your information,
applying your new script gave me the script error message seen below.
I selected wxWidgets 2.6.x, no extra options.
[attachment deleted by admin]
Biplab:
--- Quote from: bnilsson on December 26, 2006, 01:06:46 pm ---Just for your information,
applying your new script gave me the script error message seen below.
I selected wxWidgets 2.6.x, no extra options.
--- End quote ---
I am very sorry, I may have missed to inform that the modifications are Windows specific. :oops: I would rather disable it for other platforms for the time being. I have no idea about Mac/Linux programming, thus I didn't modify them.
You got that script error due to some uninitialized variables, I'll look for that error. It would be of great help if someone modifies the script for Linux/Mac. :D
Update:
Thanks for posting that bug. It was due to some uninitialised variables of Windows part coming to Unix part of the script. I have now modified the code to restrict all the modification to Windows platform only. Please check it once and post if you're getting any errors. Also my apologies for not mentioning the platform in my original post.
Biplab:
Hi,
I've uploaded new wizard file. Modifications / Improvements are-
* All the modifications are now restricted to Windows only. Linux or Mac users shall not be affected by Script runtime errors (Please check it once if you are using Linux / Mac). For Linux / Mac platform, the wizard behaviour is old one.
* Wizard now checks for appropriate lib file for Monolithic build and wxbase lib file for non-monolithic builds. Check for setup.h has been removed.
* Deprecated compier option /Og has been removed from MSVC 8.
* $(#wx)/include dir is now added as Resource compiler include dir.
* Richtext library can't be selected if user selects wxWidgets 2.6.3.
P.S. - I don't have any experience with Linux. It would be nice if someone modifies the Unix part of the wizard. :D I think couple of changes to the directory of wx-config for each version should do the job. But I don't know how to do that. :(
TDragon:
--- Quote from: biplab on December 26, 2006, 08:18:18 am ---I've tested this with GCC and Borland. The app compiles even if you don't add a single extra Win32 SDK lib. But with Borland you need to add wxpng and wxzlib libraries in order to compile successfully. But I found a lot of errors while compiling with MSVC 8.
...
Code::Blocks team had added few libraries, and I've added few more so that I don't get any error messages and I don't see any point of removing them all, as long as it works with all compilers. :D
--- End quote ---
--- Quote from: TDragon on December 25, 2006, 07:22:50 pm ---If this is not the case for compilers other than GCC, then I would expect a well-designed wizard to distinguish among the various compilers and set the options accordingly.
--- End quote ---
The point of removing the unnecessary libraries is to provide a cleaner, more polished, more professional product. Sure, everything works as it is right now; it's an improvement over the current wizard, and so I congratulate you. As I said originally: aside from throwing in a few libraries I don't need, this version works admirably well.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version