Author Topic: hello and question about setting project global variable base directory for wx  (Read 7650 times)

Offline ghostcoder

  • Single posting newcomer
  • *
  • Posts: 6
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!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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 .

Offline ghostcoder

  • Single posting newcomer
  • *
  • Posts: 6
No I was not aware of this. Thank you for the link and the tip! I'll check it out and go from there...

Offline ghostcoder

  • Single posting newcomer
  • *
  • Posts: 6
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.
« Last Edit: August 26, 2010, 09:17:34 am by ghostcoder »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
This is the wxwidgets debug library, you most likely "only" have a release build and not also made a debug-build of wxWidgets.

Offline ghostcoder

  • Single posting newcomer
  • *
  • Posts: 6
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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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.

Offline ghostcoder

  • Single posting newcomer
  • *
  • Posts: 6
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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.

Offline ghostcoder

  • Single posting newcomer
  • *
  • Posts: 6
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
The dll has to be in the systems search-path or in the same folder as the exe.