Code::Blocks Forums

User forums => Help => Topic started by: ghostcoder on August 26, 2010, 06:25:52 am

Title: hello and question about setting project global variable base directory for wx
Post by: ghostcoder on August 26, 2010, 06:25:52 am
Hello,

I'm trying to run the wxSmith tutorial found here http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Hello_world

I've installed CodeBlocks into a directory on my C drive, so it looks like c:\CodeBlocks

When I run the wizard to start a wxWidgets project, I get to the page where it wants wxWidgets location.

The generic $(#wx) is in place, but then it shows the dialog to set the base directory, and everything I set does not work.
I get the error: The path you entered seems valid, but the wizard can't locate wxWidgets files in it.

Can someone help me out and tell me which directory I should be setting this to in order to get the wizard to accept it?

Thanks very much!
Title: Re: hello and question about setting project global variable base directory for wx
Post by: Jenna on August 26, 2010, 07:30:18 am
Are you aware , that wxWidgets itself do not provide precompiled binaries, but only the sources on windows ?

See http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef) .
Title: Re: hello and question about setting project global variable base directory for wx
Post by: ghostcoder on August 26, 2010, 07:56:29 am
No I was not aware of this. Thank you for the link and the tip! I'll check it out and go from there...
Title: Re: hello and question about setting project global variable base directory for wx
Post by: ghostcoder on August 26, 2010, 09:10:12 am
Ok I'm back. I believe I successfully compiled wxWidgets. I was able to make a project and I followed the first tutorial.

However, when I then tried to build the application, I'm getting an error in platform.h on line 196
error: wx/setup.h: no such file or directory

ok let me edit this. I found a tip somewhere that suggested I move the setup.h file from the msw folder to the wx folder, so I did.

This worked! However, I still get one final error when I build.

ld.exe         cannot find -lwsmsw28ud

I don't know what this is but I'm looking for some info on it.
Title: Re: hello and question about setting project global variable base directory for wx
Post by: Jenna on August 26, 2010, 09:22:01 am
This is the wxwidgets debug library, you most likely "only" have a release build and not also made a debug-build of wxWidgets.
Title: Re: hello and question about setting project global variable base directory for wx
Post by: ghostcoder on August 26, 2010, 09:47:13 am
yes I believe I compiled the release library.

What should I do then? Do I need to recompile wxWidgets or can I simply remove this problem another way?

-------

-------------- Build: Debug in test ---------------

Linking executable: bin\Debug\test.exe
c:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28ud
Title: Re: hello and question about setting project global variable base directory for wx
Post by: Jenna on August 26, 2010, 09:59:46 am
yes I believe I compiled the release library.

What should I do then? Do I need to recompile wxWidgets or can I simply remove this problem another way?

-------

-------------- Build: Debug in test ---------------

Linking executable: bin\Debug\test.exe
c:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28ud
If you do not want to debug wxwidgets itself (I think you don't want taht), you can change your projects build options as follows:

target Debug:
change "Linker settings -> Link libraries:" from "libwxmsw28ud.a" to "libwxmsw28u.a" (just remove the "d" )
change "Search directories -> Compiler" and "Resource compiler" remove the "d" from "mswud"
remove __WXDEBUG__ from "Compiler settings -> #defines"

A side-effect: It should work without the need to copy "setup.h" now.

You are still able to debug your own code.
Title: Re: hello and question about setting project global variable base directory for wx
Post by: ghostcoder on August 26, 2010, 10:20:25 am
Ok I did what you said and at first it gave me more errors, but then I hit 'rebuild' and it worked!

I was then able to build and run it and it launched the little app. Only thing now is that it is putting the exe file in a bin\Debug folder. I guess it still thinks the project is in debug mode. I'm totally new to Code Blocks and compiling, but I think it's pretty awesome so far. Thanks very much for your help, you've been patient. Much appreciated.
Title: Re: hello and question about setting project global variable base directory for wx
Post by: Jenna on August 26, 2010, 10:22:26 am
You use the debug-target (to be able debug your app), but you can change it by chosing the release-target from the dropdown-list in the build-toolbar.
Title: Re: hello and question about setting project global variable base directory for wx
Post by: ghostcoder on August 26, 2010, 10:30:49 am
Ok cool I see that and I was able to compile for release. Awesome.

It works when I build and run from the Code Blocks, however, when I double click the .exe I've generated, I now get the error This app has failed to start because wsmsw28u_gcc_custom.dll was not found.
Title: Re: hello and question about setting project global variable base directory for wx
Post by: Jenna on August 26, 2010, 10:39:40 am
The dll has to be in the systems search-path or in the same folder as the exe.