Author Topic: My 1st wx Program  (Read 3082 times)

Del Noble

  • Guest
My 1st wx Program
« on: June 05, 2015, 05:06:15 am »

Even though Code Blocks has a template for wxWidgets, I’d like to start my application from zero. So, I created an application using the ‘Console Application’ template and added the ‘#include <wx/window.h>’ as the first step, as suggested here [http://docs.wxwidgets.org/stable/overview_helloworld.html]. But I get an error saying :
D:\Dev\Projects\CodeBlocks\wx001\main.cpp:2:23: fatal error: wx/window.h: No such file or directory #include <wx/window.h>
I know that this is not a wx problem, since the ‘wxWidgets Template’ does work, but CB does not have a mailing list to post this question and, thus, I hope someone here can help me set up the project from zero, or point out to me a site that provides the solution to this problem.
 

I added this settings:
Debug
Linker settings = libwxmsw30ud.a
Search Directory -> Compiler = $(#wx)\lib\gcc_dll\mswud
Search Directory -> Linker = $(#wx)\lib\gcc_dll
Search Directory -> Resource compiler = $(#wx)\lib\gcc_dll\mswud


Release
Linker settings = libwxmsw30u.a
Search Directory -> Resource compiler = $(#wx)\lib\gcc_dll\mswu
but, still, no cheese Sad smile
Thanks

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: My 1st wx Program
« Reply #1 on: June 05, 2015, 07:43:57 am »
You have post the same question in wx maillist, right?
I think it is quite simple to solve your problem.
project1: create a simple console app, and did what have said, it surely failed with build errors.
project2: create a simple wxWidgets app by C::B's wx wizard, then you have a minimal workable project.

Now, compare the compiler command between project2 and project1, you will notice what is missing for project1. Then add them manually. (that is what our wx wizard do automatically for you)

That's simple, right?



If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.