User forums > Help
WxWindows, makefile... help a newbie! :)
barabba:
Hello! I must complete a school project on c++, so I decided to find out a good IDE. I like Code::Blocks very much, it seems fast and customizable. But I have some problems: my project has to be done using cygwin (i.e. : it should compile under cygwin shell without errors) and WxWindows 2.4.2.
This morning (european time :\ ) I installed the 30/06 night build of Code::Blocks, and it runs quite well... but I have not been able to solve these two problems:
First: I must use a makefile from cygwin make.exe, not from mingw32-make.exe, that my CB uses by default. So, where can I choose which binary to use when using a custom makefile?
Second: I got a compiled and working WxWindows 2.4.2 dll. Unfortunately, the project wizard only supports WxWidgets, the newer version. So, the question is: what settings should i use to make CB recognize WxWindows libraries, allowing them to be used in my code (without the risk of ambiguity with the newer 2.6.x)??
A huge thank you to anyone will bother answering :)
Francesco
MortenMacFly:
For the Cygwin compiler, have a look in the WiKi here:
http://wiki.codeblocks.org/index.php?title=Installing_Cygwin_Compiler
For the wxWidgets I'd suggest you install a "DevPak" of this version. The DevPak download plugin only shows wxWidgets 2.6.1+, but it you google around you'l sureely find an "old" wxWdgets 2.4.2 (e.g. http://old.devpaks.org/show.php?devpak=106). Anyway: Unless you are using specific 2.6.x functions you could still implement your application with wxWidgets 2.6.x and compile it at work / studies with the old library. To make sure that you aren't using v2.6.x functionality I recommend you simply only look inside the 2.4.2 SDK documentation (http://www.wxwindows.org/manuals/2.4.2/wx_contents.html).
With regards, Morten.
barabba:
--- Quote from: MortenMacFly on July 01, 2006, 10:22:13 pm ---For the Cygwin compiler, have a look in the WiKi here:
http://wiki.codeblocks.org/index.php?title=Installing_Cygwin_Compiler
For the wxWidgets I'd suggest you install a "DevPak" of this version. The DevPak download plugin only shows wxWidgets 2.6.1+, but it you google around you'l sureely find an "old" wxWdgets 2.4.2 (e.g. http://old.devpaks.org/show.php?devpak=106). Anyway: Unless you are using specific 2.6.x functions you could still implement your application with wxWidgets 2.6.x and compile it at work / studies with the old library. To make sure that you aren't using v2.6.x functionality I recommend you simply only look inside the 2.4.2 SDK documentation (http://www.wxwindows.org/manuals/2.4.2/wx_contents.html).
With regards, Morten.
--- End quote ---
Thank you very much, but I fear I've not been able to explain my problem.
I've got WxWindows 2.4.2 installed, and I've got a working cygwin. I've got a sample project, and it compiles flawlessy just typing "make" in the project directory in cygwin shell.
So the question could be reduced to: how can I make the same project compile under Code::Blocks? How do I import the makefile and use the make.exe makefile, if needed? And, more important: which flags should I use for linker and compiler, how should I set global variables, paths and such things in C::B to get it work with WxWin 2.4.2?
:(
MortenMacFly:
Again: I hope you've attached the Cygwin compiler as described in the WiKi article, becasue this is required!
Then create a wxWidgets project using the C::B wizard. This will ensure that you have setup your project for wxWidgets in general. Look through the build options and replace anything like "wxmsw26" with "wxmsw42" (you get the point). These are the wxWidgets library you need to link against.
You then can replace the "main.cpp" created by the wizards with your "main" file and add other files to the project if neccesary. This wizard will ask you for the path to the wxWidgtes libs - setup this to you wxWidgets installation and/or setup a global variabe named "wx" to point to this directory, too. I assume you've compiled wxWidgets under Cygwin then as I'm not aware of any wxWidgets package available pre-compiled for Cygwin...?!
You cannot import a makefile, but you can read the makefile to understand what it does. It basically sets the compiler/linker settings as required and compiles/links several files accordingly. You can have a look at special compiler/linker option in this file you may need to apply to your C::B project, too.
Finally make sure your project does not use the MinGW GCC but your newly added Cygwin compiler. You'll find all these settings in the project setup and/or the build options.
With regards, Morten.
barabba:
thank you again! more on the problem:
I installed WxWindows with Cygwin, it was among the packets that could be installed with the cygwin offline installation that school has given us.
The Wx's dlls are installed under /src/local in cygwin directory, but that is not the problem - i could change all the paths, obviously. The problem is that the wx-config that came with this build is a unix one (no exe), which works perfectly if building from cygwin shell, but cannot be called from a windows shell like cmd.exe or directly from Code::Blocks.
I tried to install a wx-config (for windows) packet downloaded from the net: after compiling and setting the global WXWIN variable at the libraries location, it says that it cannot detect any library installed on that path. But the unix wx-config had EXACTLY the same path in its configuration, and works flawlessy.
So I really don't know how to make my wxwindows work with code::blocks :\
any idea?
Navigation
[0] Message Index
[#] Next page
Go to full version