User forums > Help

Using wxWidgets

(1/2) > >>

Samuel G.:
Hello :D :D :D


I installed wxWidgets via wxPack. I want to use it in the nightly build 3398.

After hours of searching wiki.codeblocks and the forums I was not able to find out, how to set the global variable "wx" correctly to make wxWidgets Projects.

stahta01:
What project is NOT working?

Note, you can NOT use wxPack DLLs to build Code::Blocks to my knowledge because Code::Blocks requires an Monolithic DLL and I do NOT think wxPack supplies a Monolithic DLL.

Correction: I was wrong wxPack does have an Monolithic DLL called wxmsw26u_gcc.dll that should work to build Code::Blocks.

Tim S

thomas:

--- Quote from: Samuel G. on December 21, 2006, 01:35:37 am ---was not able to find out, how to set the global variable "wx" correctly to make wxWidgets Projects.
--- End quote ---
Whatever is the location of your wxWidgets installation.

If you have a "normal" layout, it suffices to set the base directory (for example D:\wxWidgets).

If your headers and libraries are in "strange locations" (for example, headers are in C:\wx and libraries are in F:\libs\wx) then you have to set the include and lib members of the #wx variable to the respective correct locations. This is most unusual, though.

RJP Computing:
Samuel,

There is a great tutorials section right on wxPack's website. It has the step by step directions for using Code::Block.

There is a problem with the current Code::Blocks wxWidgets wizard that makes it complain if you use any other version of wxWidgets that isn't 2.6. Also it seems to be not including 'Comdlg32' in the linker libraries.


--- Quote from: stahta01 on December 21, 2006, 01:55:59 am ---Note, you can NOT use wxPack DLLs to build Code::Blocks to my knowledge because Code::Blocks requires an Monolithic DLL and I do NOT think wxPack supplies a Monolithic DLL.
--- End quote ---
FYI. wxPack does include monolithic static libraries as well as dll versions of wxWidgets. I am not sure because I have not tried to use then to build Code::Blocks, but I assume there should be know problem. It isn't like building it for Code::Blocks has any special instructions.

Samuel G.:
Thanks for your engangement. It was helpful, but still I am not able to build a wxWidgets-Application.

I set the variable "wx" (I did not set the values lib and include, I think this is not necessary (?)). Then I started the Wizzard for a wxWidgets-Project. (I knew the tutorial, but it I was confused whether I had to set the values lib, include and to which value). I want the Project to use wxWidgets as a static library, so I guess it was right to make the following selection:

Use wxWidgets DLL: No
wxWidgets is build as a monolithic library: Yes
Enable Unicode: Yes
Use the debugging libraries: NO
Create and use precompiled header: Yes

In the linker options I change libwxmsw26u.a to libwxmsw27u.a. When I build, I get the following errors (build log)

--- Quote ----------------- Build: Debug in Test ---------------
Precompiling header: wx_pch.h
Compiling: main.cpp
Compiling: app.cpp
Linking console executable: bin\Debug\Test.exe
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_colordlg.o):colordlg.cpp:(.text+0xd11): undefined reference to `ChooseColorW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_fontdlg.o):fontdlg.cpp:(.text+0x372): undefined reference to `ChooseFontW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_printdlg.o):printdlg.cpp:(.text+0x11ca): undefined reference to `PrintDlgW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_printdlg.o):printdlg.cpp:(.text+0x2649): undefined reference to `PrintDlgW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_printdlg.o):printdlg.cpp:(.text+0x37e1): undefined reference to `PageSetupDlgW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_printdlg.o):printdlg.cpp:(.text+0x3826): undefined reference to `PageSetupDlgW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_filedlg.o):filedlg.cpp:(.text+0xce2): undefined reference to `GetSaveFileNameW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_filedlg.o):filedlg.cpp:(.text+0xcfc): undefined reference to `CommDlgExtendedError@0'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_filedlg.o):filedlg.cpp:(.text+0xd14): undefined reference to `GetOpenFileNameW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_dcprint.o):dcprint.cpp:(.text+0x655): undefined reference to `PrintDlgW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_dcprint.o):dcprint.cpp:(.text+0xed2): undefined reference to `PrintDlgW@4'
H:\wxWidgets2.7\lib\gcc_lib/libwxmsw27u.a(monolib_dcprint.o):dcprint.cpp:(.text+0x1212): undefined reference to `PrintDlgW@4'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 21 seconds)
0 errors, 0 warnings
--- End quote ---

Do I also have to add include or lib directories in the "compiler and debugger" settings?

Navigation

[0] Message Index

[#] Next page

Go to full version