Code::Blocks Forums

User forums => Help => Topic started by: rowck001 on November 08, 2005, 02:11:34 pm

Title: wxWidgets 2.6.2 Instructions
Post by: rowck001 on November 08, 2005, 02:11:34 pm
Sory to post again - but can anybody who has successfully installed wxWidgets and used it with code::blocks let me know how they did it?

I used "nmake -f makefile.vc BUILD=release SHARED=0 MONOLITHIC=1 RUNTIME_LIBS=static" as the wxwidget command-line to compile.

Details of how (the command-line) they compiled WxWidgets into the static library version and details of the setup for code::blocks.

I have looked at the wiki post and all the wxwidget problems in the forums, but nothing I do will work given those instructions

I always get unresolved imports link messages - I have clean compiled WxWidgets many times and never any joy!

I guess I will have to stick with Win32 API as wxWidgets just doesnt seem to work!
Title: Re: wxWidgets 2.6.2 Instructions
Post by: mandrav on November 08, 2005, 03:40:45 pm
If all you have is linking problems, check your compiler flags.
For example, you shouldn't be using WXUSINGDLL with a static wx lib...
Title: Re: wxWidgets 2.6.2 Instructions
Post by: kisoft on November 08, 2005, 04:00:06 pm
...
I used "nmake -f makefile.vc BUILD=release SHARED=0 MONOLITHIC=1 RUNTIME_LIBS=static" as the wxwidget command-line to compile.

Details of how (the command-line) they compiled WxWidgets into the static library version and details of the setup for code::blocks.
...

I try now on my Win2k, wxWidgets 2.6.2, sorry, WinGW only, C::B CVS [08.11.2005].
My steps see below:

1. clean old compile (was dll for C::B):
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 clean

2. build static wxWidgets:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=0 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=my
SHARED=0 - main difference

3. copy $(WX_DIR)\lib\gcc_lib\* to $(WX_LIB)\lib\gcc_libNonUnicode\*
List of files:
Code
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxexpat.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxjpeg.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxmsw26.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxpng.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxregex.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxtiff.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\libwxzlib.a
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\msw
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\msw\build.cfg
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\msw\wx
C:\Devel\wxWidgets-2.6.2\lib\gcc_libNonUnicode\msw\wx\setup.h
rem For your VC compiler "gcc_lib" change on "vc_lib"

4. start C::B and create new wxWidgets project "using static wxWidgets library"
   and "With header files"

5. change WX_DIR in CustomVariables on C:\Devel\wxWidgets-2.6.2

6. change WX_CFG in CustomVariables on NonUnicode
rem Use it only if your execute p.3

7. change wxmsw on wxmws26 in library list

8. ReBuild

9. Ctrl-F10 - Ok

It's correct on your system?

If not, let see build parameters for your application.

Good luck!
Title: Re: wxWidgets 2.6.2 Instructions
Post by: cyberkoa on November 08, 2005, 04:11:25 pm
I am using gcc with static wxwidgets library last time , it works fine for me.

I have faced unresolve reference problem before but it solved by adding appropriate library in the Linker settings.


Title: Re: wxWidgets 2.6.2 Instructions
Post by: rowck001 on November 09, 2005, 01:07:36 am
Thanks for the replies ... but what I really need is a list of compiler / linker and library flags that works!

I am using NOT using WXUSINGDLL with a static library version -= but what flag is used for a static library??.
Do I need a library such as rpcrt4.lib? - If so, it is not listed in the default wxwidgets project file. What linker flags are used for VC Toolkit 2003? All help seems to be minGW-centric.

Also I have read that codeblocks default wxwidgets project file is old and does not include up-to-date command parameters.
Where can I get an update?

Just about rerady for the old uninstall button for codeblocks and wxwidgets!
Title: Re: wxWidgets 2.6.2 Instructions
Post by: grv575 on November 09, 2005, 05:30:29 am
http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29#Building_wxWidgets_2.6.1_mingw32_.26_vc.2B.2B_toolkit_2003

The only thing to change for static libs should be
SHARED=0

and omit the WXUSINGDLL flag (make sure to select static wx project when you create a new project to test things).
do double check that the linker options is specifying the wxwidgets lib correctly (just wxmsw I believe).
Title: Re: wxWidgets 2.6.2 Instructions
Post by: rowck001 on November 09, 2005, 08:12:33 am
Thankx to all for the replies

lowjoel from the wxwidgets forum fixed my problem. Turns out I didn't specify ALL the needed libraries for the VC Toolkit linker and my search include paths were screwed!  :oops:

Anyway, I thought I would post a copy of my wxwidgets project file so other noobs can see what needs to be done for code::blocks to play nicely with wxwidgets

<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="1"/>
   <Project>
      <Option title="wxWidgets application"/>
      <Option makefile="Makefile"/>
      <Option makefile_is_custom="0"/>
      <Option compiler="1"/>
      <Build>
         <Target title="default">
            <Option output="C:\Documents and Settings\Craig Rowlands.CRAIGR.000\Desktop\wxWidgets.exe"/>
            <Option working_dir="."/>
            <Option object_output=".objs"/>
            <Option deps_output=".deps"/>
            <Option type="0"/>
            <Option compiler="1"/>
            <Option projectResourceIncludeDirsRelation="0"/>
         </Target>
         <Environment>
            <Variable name="WX_DIR" value="C:\wxWidgets-2.6.2"/>
            <Variable name="WX_CFG" value=""/>
         </Environment>
      </Build>
      <Compiler>
         <Add option="/MT"/>
         <Add option="/W4"/>
         <Add option="/D__WXMSW__"/>
         <Add option="/DWIN32"/>
         <Add directory="c:\wxwidgets-2.6.2\include"/>
         <Add directory="c:\wxwidgets-2.6.2\lib\vc_lib"/>
         <Add directory="c:\wxwidgets-2.6.2\contrib\include"/>
         <Add directory="C:\wxWidgets-2.6.2\lib\vc_lib\msw"/>
      </Compiler>
      <ResourceCompiler>
         <Add directory="c:\wxwidgets-2.6.2\include"/>
      </ResourceCompiler>
      <Linker>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxmsw26.lib"/>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxtiff.lib"/>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxjpeg.lib"/>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxpng.lib"/>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxzlib.lib"/>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxregex.lib"/>
         <Add library="C:\wxWidgets-2.6.2\lib\vc_lib\wxexpat.lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\Kernel32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\User32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\Gdi32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\ComDlg32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\WinSpool.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\WinMM.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\Shell32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\ComCtl32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\Ole32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\OleAut32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\Uuid.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\RpcRT4.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\AdvAPI32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\WSock32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\odbc32.lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\OpenGL32.Lib"/>
         <Add library="C:\Program Files\Microsoft Platform SDK\Lib\winhttp.lib"/>
         <Add directory="C:\wxWidgets-2.6.2\lib\vc_lib"/>
         <Add directory="C:\Program Files\Microsoft Platform SDK\Lib"/>
      </Linker>
      <Unit filename="main.cpp">
         <Option compilerVar="CPP"/>
         <Option target="default"/>
      </Unit>
      <Unit filename="main.h">
         <Option compilerVar=""/>
         <Option compile="0"/>
         <Option link="0"/>
         <Option target="default"/>
      </Unit>
   </Project>
</CodeBlocks_project_file>


BTW. Good to be back in C++. Java is sooooo slooooow!!!!!