Author Topic: question on wxwidget sample projects, and where to find more  (Read 6100 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
question on wxwidget sample projects, and where to find more
« on: November 24, 2008, 03:14:23 am »
I'm new to this forum.
I just installed the codeblocks and wxpack, I want to learn to build some wxwidget project. I found that when there are many samples in the wxwidget folder. But all these sample project file can't be opened by CB.  These are only project files for "VC" "DecC++" and other IDE.

So, my question  is where can I find similar sample files to study. ( If I manually converter these samples to CB, I think it's not an easy way, adding CPP, H, RC files to the new CB project is not enough).

Any questions and suggestions? Thank you.
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: question on wxwidget sample projects, and where to find more
« Reply #1 on: November 24, 2008, 06:30:10 am »
Any questions and suggestions? Thank you.
You can import DevC++ projects with C::B just fine (File->Import...). This should work right out-of-the-box.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: question on wxwidget sample projects, and where to find more
« Reply #2 on: November 24, 2008, 06:42:30 am »
Thank you for your reply. But it was very strange. There is no DEV-CPP project file (which is *.dev ) in any samples folders when I installed the wxpack. :(
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: question on wxwidget sample projects, and where to find more
« Reply #3 on: November 24, 2008, 06:53:01 am »
These are only project files for "VC" "DecC++" and other IDE.
So what do you mean by this sentence then...?!
Anyways - you can import VC projects, too. Hence the settings might need to be adjusted in case you don't compile them afterwards with the VC compiler but e.g. MinGW/GCC.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: question on wxwidget sample projects, and where to find more
« Reply #4 on: November 24, 2008, 06:58:38 am »

I add a picture of one sample folder name "dialogs". There are *.dsp files ( which is for visual C++ 6 ) .

So, the only thing I can do is to import this file manually, But it's not an easy way, a lot thing should be adjusted.
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: question on wxwidget sample projects, and where to find more
« Reply #5 on: November 24, 2008, 07:56:15 am »
Here is the steps I'm trying to import a *.dsp project files. But I failed when building.

1. I use "File->import project -> ms visual c++ project" and pick the menu.dsp.

2. I choose the GNU GCC compiler in a compiler selection dialog.

3. In "configuration selection dialog, I only checked "Win32 Unicode debug"

4. Import finished, and the workplace has a "menu.cpp" and "menu.rc" file.

4. I choose "build". here is the error message:

Code
-------------- Build: Win32 Unicode Debug in menu ---------------

Compiling: menu.rc
Compiling: menu.cpp
Linking executable: vc_mswud\menu.exe
D:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lwxmsw28ud_core
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 4 seconds)
1 errors, 0 warnings
 


Can someone help me to build this project?
I get stuck here, and can't figure out. Thanks for your help.


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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: question on wxwidget sample projects, and where to find more
« Reply #6 on: November 24, 2008, 12:03:15 pm »
D:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lwxmsw28ud_core
You either don't have the wxWidgets SDK with this configuration (unicode, debug) or you are missing to set the linker path and/or variables. Search the forums how to setup a wxWidgets project in C::B (or let the wizard create one for you) then correct the settings.

Notice: The import wizard cannot and will not know where your wxWidgets SDK is. This is information is available from the VC project file. You need to provide this setup anyways (the same would apply in VC, too).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: question on wxwidget sample projects, and where to find more
« Reply #7 on: November 24, 2008, 04:25:21 pm »
D:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lwxmsw28ud_core
You either don't have the wxWidgets SDK with this configuration (unicode, debug) or you are missing to set the linker path and/or variables. Search the forums how to setup a wxWidgets project in C::B (or let the wizard create one for you) then correct the settings.

Notice: The import wizard cannot and will not know where your wxWidgets SDK is. This is information is available from the VC project file. You need to provide this setup anyways (the same would apply in VC, too).
Thanks MortenMacFly. As you said, it was the problem that the linker can't find the Lib files. I change the "search Library path " to ".\..\..\lib\gcc_dll". Note: this is the only modification after imported. Then, I can happily build the exe file.  :D. It was so great!

I'm wondering why the wxwidget develop team haven't add C::B sample project to their distribution. If it is hard to import from another project, many people will give up using C::B.
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.