Author Topic: Just getting it set up w/wxWidgets...  (Read 20796 times)

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Just getting it set up w/wxWidgets...
« on: January 28, 2007, 02:48:47 am »
Hey,

I just downloaded Code::Blocks to see what it was like, and after trying to compile the default wxWidgets program, found out that I needed to download wxWidgets seperately (Yeah, I'm used to wxDev-C++). So thats been done.

Now when I try and compile the project (after changing the wxwidgets version in project->Build options to 2.8.0), I just get a bunch of errors, the first being "wx/setup.h: No such file or directory".

What should I do to be able to fully work with wxWidgets in Code::Blocks? It seems like a great IDE!

Thanks!
FlyingIsFun1217

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2769
Re: Just getting it set up w/wxWidgets...
« Reply #1 on: January 28, 2007, 03:17:17 am »
You probably just need to set your global variables.
Bet sure to follow the compiling directions for you OS from
wiki.codeblocks.org.


Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #2 on: January 28, 2007, 03:30:50 am »
Set global variables? How?

I also assume that when you say to follow the compiling directions for (in my case) Windows that you are talking about compiling wxWidgets (found here, under Building wxWidgets). I tried this, but only ever got errors. Maybe because the version I downloaded came with MinGW?

FlyingIsFun1217
« Last Edit: January 28, 2007, 03:33:26 am by FlyingIsFun1217 »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2769
Re: Just getting it set up w/wxWidgets...
« Reply #3 on: January 28, 2007, 04:41:22 am »
MainMenu->Settings->Global Variables

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #4 on: January 28, 2007, 05:14:22 am »
You can use direct path in place of Global Variable. Use the absolute Path of wx version in the following dialog in the textbox.



For example, in my PC, wx-2.6.3 is kept at C:\wxWidgets-2.6.3 and wx-2.8.0 is kept at C:\wxMSW-2.8.0. Please specify the top level dir. C::B will find out include and lib dir.

Code::Blocks doesn't come with pre-compiled wx libs. You can compile it on your own, or download wxPack (http://wxpack.sourceforge.net). wxPack comes with wx lib compiled with GCC and MSVC. That might be helpful.
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #5 on: January 28, 2007, 01:56:00 pm »
I believe that wxPack should solve my problem.

Thanks for the help, I'll post my results in a while.

FlyingIsFun1217 :)

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #6 on: January 28, 2007, 11:43:02 pm »
Ok, I've got all of the bugs worked out, except for one.

Output gives:
"Cannot find -lwxmsw28"

?
Thanks again,
FlyingIsFun1217

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #7 on: January 29, 2007, 06:14:15 am »
I think you are trying to use Monolithic build which is unavailable in your system. Uncheck the option wxWidgets is built as monolithic library in the wizard.

Regards,

Biplab

P.S.: If you are not using the newer wizard then please read the following post.

http://forums.codeblocks.org/index.php?topic=4768.0
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #8 on: January 30, 2007, 06:36:55 pm »
Sorry for not posting a reply sooner than I did.
I will try installing it without it being a monolithic build.
As far as the new wizard goes, I have downloaded it and put everything where it goes, but I can't say that I know where to access it within Code::Blocks. Where can it be found, and more importantly, what is it's usefulness?

Thanks!
FlyingIsFun1217

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Just getting it set up w/wxWidgets...
« Reply #9 on: January 30, 2007, 07:23:01 pm »
Hi,

after installing the new wxWidgets wizard you can access it by choosing "File"->"New"->"Project"->"wxWidgets project".
What the wizard does is setting up your project to use wxWidgets (e.g. inserting directory search paths, libraries to link to, etc.).
You may as well create an empty project and start wx coding, but then you'll have to configure the project settings to use wxWidgets manually.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #10 on: January 30, 2007, 11:26:54 pm »
Does the version of codeblocks being used have to be a nightly? I am currently using the release candidate, and all I get is the normal setup, no dialog.

I'll try reinstalling it...

FlyingIsFun1217

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Just getting it set up w/wxWidgets...
« Reply #11 on: January 31, 2007, 12:06:33 am »
Does the version of codeblocks being used have to be a nightly?
Yes.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #12 on: January 31, 2007, 01:32:11 am »
Does the version of codeblocks being used have to be a nightly?
Yes.

It's officially shipped with 31st January 2007's nightly. Please download it and you won't need to install it manually.  :)

You may as well create an empty project and start wx coding, but then you'll have to configure the project settings to use wxWidgets manually.

Which project settings are you talking of?? In my PC I've retested it on request from manutd. It's working perfectly. You are only required to add source files to it. But the source you are adding should be properly written.

I'm not sure which type of errors you are getting. But if you face any problem, please post full details. Otherwise don't post such misleading informations.

Just do a simple test. First create a project using the wizard. Later create an empty project using the same wizard. Now add the source files to empty project from first project. Check whether it compiles or not. I strongly believe it will compile.
« Last Edit: January 31, 2007, 01:34:58 am by Biplab »
Be a part of the solution, not a part of the problem.

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Just getting it set up w/wxWidgets...
« Reply #13 on: January 31, 2007, 02:50:41 pm »
Which project settings are you talking of??
I've meant an empty non-wx-wizard project. You have to add wx-libraries and search path, then :)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #14 on: January 31, 2007, 03:29:32 pm »
Which project settings are you talking of??
I've meant an empty non-wx-wizard project. You have to add wx-libraries and search path, then :)

Even if you generate empty project, the search path and libraries are automatically added depending upon the your selection. You can select wx config, additional lib even after checking Create Empty project. Whatever you select will be added to the project file.

The procedure remained same. If you request an Empty Project necessary settings, lib will be added but No File will be added to the project.

There is some issues if you select Empty project with PCH support. It's not a bug but due to the mismatch between the way support is added and the way it is used by the users. I'll add a warning to inform the user about Possible Issue that may arise due to this settings.  :)
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #15 on: February 01, 2007, 12:29:32 am »
Ok, downloaded the nightly.

When I try and run the exe though, I get:

Quote
This application has failed to start because wxmsw26u_gcc_cb.dll was not found. Re-installing the application may fix this problem.

How can I get it running?

Thanks again!
FlyingIsFun1217

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #16 on: February 01, 2007, 02:01:47 am »
Nevermind, I was being an idiot.

I'll try it out now.

FlyingIsFun1217 :)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #17 on: February 01, 2007, 05:22:18 am »
Download the following two files.

Quote
http://prdownload.berlios.de/codeblocks/wxmsw26u_gcc_cb_wx2.6.3p2AndCbPatch_version3.7z
and
Quote
http://prdownload.berlios.de/codeblocks/mingwm10.7z

Extract them in the folder where you find the codeblocks.exe file.  :)
« Last Edit: February 01, 2007, 05:26:46 am by Biplab »
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #18 on: February 02, 2007, 12:48:39 am »
Yeah, done and done. Heck, I even got far enough to be able to build a project that was created using wxDev-C++. Of course, I just deleted the files in the newly created wxWidgets project, etc.

What I would really like to know is: When installing wxWidgets through wxPack, I can choose to install the GCC libs and/or the dll. Obviously, the dll is MUCH smaller, and would be much better suited for my 20 gb hard drive. Is there a way I can get Code::Blocks to use the wxWidgets dll to compile a program? Or is that what "Use wxWidgets DLL" is going to do?

Also (edit), I installed the minGW compiler so that I could uninstall the CodeBlocks RC, but now I just get the error "\mingw\lib\crt2.o:crt1.c:(.text+0x16a):: undefined reference to `__cpu_features_init'
:: === Build finished: 1 errors, 0 warnings ===". What do I need to change?


Thanks again!
FlyingIsFun1217
« Last Edit: February 02, 2007, 01:25:42 am by FlyingIsFun1217 »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #19 on: February 02, 2007, 04:30:01 am »
Is there a way I can get Code::Blocks to use the wxWidgets dll to compile a program? Or is that what "Use wxWidgets DLL" is going to do?

You are right. Select that option.
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #20 on: February 02, 2007, 01:35:47 pm »
Cool.
Going back to my off-topic problem though, how can I fix the error the linker is giving me?

Thanks a million!
FlyingIsFun1217

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #21 on: February 02, 2007, 01:55:54 pm »
I overlooked your linking problem. It seems to me that you didn't install MinGW Runtime. Download it from-
Quote
http://prdownloads.sourceforge.net/mingw/mingw-runtime-3.11.tar.gz?download
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #22 on: February 02, 2007, 11:21:19 pm »
Cool. How do I "install" it though?

Thank you very much!
FlyingIsFun1217

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #23 on: February 03, 2007, 02:02:58 am »
Extract the contents of the file in C:\MinGW folder or to your MinGW installation folder.  :)
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #24 on: February 03, 2007, 05:10:03 am »
Ok... :P
Now I get: "undefined reference to 'WinMain@16'".

AAAAHHHHH!!!!!!
FlyingIsFun1217 :)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #25 on: February 03, 2007, 05:50:43 am »
Ok... :P
Now I get: "undefined reference to 'WinMain@16'".

AAAAHHHHH!!!!!!
FlyingIsFun1217 :)

Probably you didn't declare any WinMain function. Did you declare wxApp derived class and used IMPLEMENT_APP() macro? Please provide more details.
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #26 on: February 03, 2007, 06:05:59 am »
Well, for some reason, all it took was a restart of Code::Blocks.

Now my only concern is that when trying to run the program, it wants wxbase28_gcc.dll. Is it expecting the dll of wxwidgets to run it since I compiled it with the dll?

How can I get to to be standalone?

Thanks again for your cooperation!
FlyingIsFun1217

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #27 on: February 03, 2007, 06:08:37 am »
Don't link against dll. Uncheck the option Use wxWidgets DLL from wizard. You should also have static lib of wx in your system. If you are using wxPack then it will be there.
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #28 on: February 03, 2007, 06:11:53 am »
So to be able to use the wxWidgets dll provided with wxPack, I HAVE to have it to run the program?

Ok, will use monolithic build.

Thanks!
FlyingIsFun1217

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Just getting it set up w/wxWidgets...
« Reply #29 on: February 03, 2007, 06:37:14 am »
Use the following thumb-rule to select wx lib.
  • Static - When you want your application to be self sufficient. Means don't rely upon external wx DLLs.
  • DLL - You wish your application exe size to be smaller.
  • Monolithic DLL - You'll distribute only one wx DLL.
  • Monolithic Static - It's same as using Static. It's your personal choice to select this one.
So just don't take your decision arbitrarily. I use DLL while developing as I have to recompile it frequently. During distribution I prefer static wx lib. Now it's your personal choice on selecting appropriate lib.  :)
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Just getting it set up w/wxWidgets...
« Reply #30 on: February 03, 2007, 06:52:16 am »
Well, I will just have to use the library only, as space is very limited on my 20 gb hard drive.

Thank you again!
FlyingIsFun1217