Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Racecar56 on June 01, 2009, 04:52:27 am

Title: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Racecar56 on June 01, 2009, 04:52:27 am
I want to compile wxDFast (on Linux obviously), but it can't seem to find my includes of wx-2.6 and wx-2.8 (I think it uses 2.8, I tried both .6 and .8,) and it fails to detect them. How do I configure it to see the wxWidgets includes? They are in /usr/include/wx-2.8 for 2.8 and /usr/include/wx-2.6 for 2.6. I can't get either to work. I (think I) am using GCC. I tried 2 methods. Using Plugins>Library Finder (didn't work), and using the properties thing in 'search directories'. I'm not really new to CodeBlocks but I don't have much experience with it.
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: stahta01 on June 01, 2009, 06:56:23 am
I am windows user; so, I am just repeating what I read.

Try running the below on command line and see if results look right.

Code
wx-config --libs
wx-config --cflags

Edit: The wxDFast.cbp does not work right under WinXP so it might not be good under Linux either

Tim S
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Racecar56 on June 01, 2009, 07:13:48 am
wx-config --libs:
-pthread -Wl,-Bsymbolic-functions  -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8

wx-config --cflags:
-I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread

Notice that the old-fashiones './configure && make' method works perfectly. I think it is a codeblocks problem. By the way it''s v8.02 on Ubuntu 9.04.
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: stahta01 on June 01, 2009, 07:18:14 am
Notice that the old-fashiones './configure && make' method works perfectly. I think it is a codeblocks problem. By the way it''s v8.02 on Ubuntu 9.04.

does make -f Makefile.gcc work?
The Code::Blocks project just uses Makefile.gcc. But, the Makefile.gcc does not work under windows.

Tim S
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Jenna on June 01, 2009, 09:11:45 am
I just tested it and if you compile the release version the cbp-file works straightforward under linux.
The debug-version tries to use a wxWidgets debug version, what is not available in most cases.

You have to change line 22 of Makefile.gcc from
Code
WXCONFIG = $(WXWIDGETS_DIR)wx-config --debug=yes
to
Code
WXCONFIG = $(WXWIDGETS_DIR)wx-config --debug=no
or leave the --debug-parameter away.

You can also use the project-file as "real" cbp-file.
Just uncheck the This is a custom Makefile-checkbox in the "Project properties -> Project settings", fix the output paths in "Project properties -> Build targets" to meet different directories (or the debug-build overrides the release-build and vice-versa) and remove the "wxDFast.rc"-file (windows-resource-file) from the project.

And you most likely have to add USE_EXTERNAL_XRC to "Build options -> Compiler settings -> #defines" (not if you use Makefile.gcc).

EDIT:
if you fix the output path for the executable, you also have to copy the resources-subdir to the output-dir (probably in the post-build-step.
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Racecar56 on June 01, 2009, 09:17:57 pm
I am windows user; so, I am just repeating what I read.

Try running the below on command line and see if results look right.

Code
wx-config --libs
wx-config --cflags

Edit: The wxDFast.cbp does not work right under WinXP so it might not be good under Linux either

Tim S


Yes, it does work.

I just tested it and if you compile the release version the cbp-file works straightforward under linux.
The debug-version tries to use a wxWidgets debug version, what is not available in most cases.

You have to change line 22 of Makefile.gcc from
Code
WXCONFIG = $(WXWIDGETS_DIR)wx-config --debug=yes
to
Code
WXCONFIG = $(WXWIDGETS_DIR)wx-config --debug=no
or leave the --debug-parameter away.

You can also use the project-file as "real" cbp-file.
Just uncheck the This is a custom Makefile-checkbox in the "Project properties -> Project settings", fix the output paths in "Project properties -> Build targets" to meet different directories (or the debug-build overrides the release-build and vice-versa) and remove the "wxDFast.rc"-file (windows-resource-file) from the project.

And you most likely have to add USE_EXTERNAL_XRC to "Build options -> Compiler settings -> #defines" (not if you use Makefile.gcc).

EDIT:
if you fix the output path for the executable, you also have to copy the resources-subdir to the output-dir (probably in the post-build-step.

Thanks! : >
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Racecar56 on June 01, 2009, 09:34:55 pm
||=== wxDFast, Release ===|
obj/Release/src/wxDFast.o||In function `mApplication::OnInit()':|
wxDFast.cpp:(.text+0x5797)||undefined reference to `InitXmlResource()'|
||=== Build finished: 1 errors, 0 warnings ===|
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Jenna on June 01, 2009, 09:39:27 pm
||=== wxDFast, Release ===|
obj/Release/src/wxDFast.o||In function `mApplication::OnInit()':|
wxDFast.cpp:(.text+0x5797)||undefined reference to `InitXmlResource()'|
||=== Build finished: 1 errors, 0 warnings ===|

That's why I wrote:
And you most likely have to add USE_EXTERNAL_XRC to "Build options -> Compiler settings -> #defines" (not if you use Makefile.gcc).
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Racecar56 on June 01, 2009, 10:41:22 pm
||=== wxDFast, Release ===|
obj/Release/src/wxDFast.o||In function `mApplication::OnInit()':|
wxDFast.cpp:(.text+0x5797)||undefined reference to `InitXmlResource()'|
||=== Build finished: 1 errors, 0 warnings ===|

That's why I wrote:
And you most likely have to add USE_EXTERNAL_XRC to "Build options -> Compiler settings -> #defines" (not if you use Makefile.gcc).

It still does it.

EDIT: NVM.
Just had to recompile the whole thing, and it worked. At last.
</thread>
Title: Re: Compiling wxDFast, codeblocks dosen't work, regular old-fashioned method does.
Post by: Jenna on June 01, 2009, 11:06:10 pm
It still does it.

Did you rebuild the project, not just build ?

Or at least save wxDFast.cpp with a new timestamp, to force the cobject-file to  be rebuild (add and remove a space at the end of a line and save the file, or something similar) ?