Author Topic: How to setup wxwidgets in code::blocks Linux  (Read 31385 times)

takeshimiya

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #15 on: April 25, 2006, 11:29:35 pm »
No, you're experiencing a different problem.
This thread may help you: http://forums.codeblocks.org/index.php?topic=2195.0

Yep, did work for me.

Thanks,

Andre

Great. :)
Did you changed the shell to bash?

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #16 on: April 25, 2006, 11:41:36 pm »
Great. :)
Did you changed the shell to bash?

No, cause i don't have the Shell setting shown in the screenshot in the other thread. After reading the other thread i recognized that i missed the backsticks. I had the `wx-config --cflags` in the default settings and in the project settings, but in the default settings without the backsticks. I removed it from the project settings, added the backsticks to the default settings and then it worked.

But i had already downloaded the sources from SVN...   ;)

Regards,

Andre

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #17 on: April 25, 2006, 11:48:32 pm »
Forget all i said. While trying to get it work i added the '/usr/include/wx-2.6' directory to Project->Build Options->Directories->Compiler. If i remove this again it will not work anymore. I think i'll have to build Codeblocks from source and change the Shell to Bash.

Andre

takeshimiya

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #18 on: April 25, 2006, 11:52:08 pm »
I think i'll have to build Codeblocks from source and change the Shell to Bash.

It's not necessary: that setting has been moved to Settings->Environment.

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #19 on: April 26, 2006, 12:04:56 am »
It's not necessary: that setting has been moved to Settings->Environment.

If i click on Settings-Environment i get an exception and Codeblocks dies. I've put the Debug report here:

http://www.rotlaus.de/img/codeblocks.xml

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: How to setup wxwidgets in code::blocks Linux
« Reply #20 on: April 26, 2006, 12:18:42 am »

If i click on Settings-Environment i get an exception and Codeblocks dies. I've put the Debug report here:


Is this a source build crash or a .deb package crash or what?

thanks
pecan

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #21 on: April 26, 2006, 10:13:20 am »
Is this a source build crash or a .deb package crash or what?

Its a .deb package crash. It was a package the user Micheal of this forum provided. Just testetd the new version (rev2377), but this crashes also.

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #22 on: April 26, 2006, 02:48:28 pm »
Is this a source build crash or a .deb package crash or what?

Its a .deb package crash. It was a package the user Micheal of this forum provided. Just testetd the new version (rev2377), but this crashes also.

I've build the actual SVN Version for myself and there are the environment settings working. But changing the shell to bash doesn't help. `wx-config --cflags` get not expanded on the command line. But ican compile if i put the wx directory to the compiler directories.

takeshimiya

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #23 on: April 26, 2006, 03:25:45 pm »
I've build the actual SVN Version for myself and there are the environment settings working. But changing the shell to bash doesn't help. `wx-config --cflags` get not expanded on the command line. But ican compile if i put the wx directory to the compiler directories.

Could you paste the output produced by wx-config --cflags and wx-config --libs in a command line?
Check also if the --cflags outputs the correct include dir.

And, could you paste your project.cbp to see if everything is ok?

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #24 on: April 26, 2006, 05:59:58 pm »
Could you paste the output produced by wx-config --cflags and wx-config --libs in a command line?
Check also if the --cflags outputs the correct include dir.

And, could you paste your project.cbp to see if everything is ok?

wx-config --cflags
Code
andre@main:~$ wx-config --cflags
-I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA
The Directories are the right ones.

wx-config --libs
Code
andre@main:~$ wx-config --libs
-pthread   -lwx_gtk2u_xrc-2.6 -lwx_gtk2u_qa-2.6 -lwx_gtk2u_html-2.6 -lwx_gtk2u_adv-2.6 -lwx_gtk2u_core-2.6 -lwx_baseu_xml-2.6 -lwx_baseu_net-2.6 -lwx_baseu-2.6

The Project file:
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
        <FileVersion major="1" minor="4" />
        <Project>
                <Option title="wxSmith_project" />
                <Option compiler="gcc" />
                <Build>
                        <Target title="default">
                                <Option output="wxSmith_project" />
                                <Option type="0" />
                                <Option compiler="gcc" />
                                <Option projectResourceIncludeDirsRelation="0" />
                        </Target>
                </Build>
                <Compiler>
                        <Add option="`wx-config --cflags`" />
                </Compiler>
                <Linker>
                        <Add option="`wx-config --libs`" />
                </Linker>
                <Unit filename="app.cpp">
                        <Option compilerVar="CPP" />
                        <Option target="default" />
                </Unit>
                <Unit filename="app.h">
                        <Option compilerVar="CPP" />
                        <Option compile="0" />
                        <Option link="0" />
                        <Option target="default" />
                </Unit>
                <Unit filename="mainframe.cpp">
                        <Option compilerVar="CPP" />
                        <Option target="default" />
                </Unit>
                <Unit filename="mainframe.h">
                        <Option compilerVar="CPP" />
                        <Option compile="0" />
                        <Option link="0" />
                        <Option target="default" />
                </Unit>
                <Unit filename="wx_pch.h">
                        <Option compilerVar="CPP" />
                        <Option link="0" />
                        <Option weight="0" />
                        <Option target="default" />
                </Unit>
                <Unit filename="wxsmith/MainFrame.wxs">
                        <Option compilerVar="CPP" />
                        <Option compile="0" />
                        <Option link="0" />
                        <Option target="default" />
                </Unit>
        </Project>

But it still doesn't compile. I loos like it doesn't expand the backsticked part to the shell. Here the last Build Log:
Code
-------------- Build: default in wxSmith_project ---------------
g++ `wx-config --cflags`  -I.objs -I- -I.objs -I. -I/usr/include  -c wx_pch.h -o .objs/wx_pch.h.gch
cc1plus: note: obsolete option -I- used, please use -iquote instead
wx_pch.h:9:23: error: wx/wxprec.h: No such file or directory
wx_pch.h:16:20: error: wx/wx.h: No such file or directory
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings
 

takeshimiya

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #25 on: April 26, 2006, 07:11:58 pm »
But it still doesn't compile. I loos like it doesn't expand the backsticked part to the shell. Here the last Build Log:
Code
-------------- Build: default in wxSmith_project ---------------
g++ `wx-config --cflags`  -I.objs -I- -I.objs -I. -I/usr/include  -c wx_pch.h -o .objs/wx_pch.h.gch
cc1plus: note: obsolete option -I- used, please use -iquote instead
wx_pch.h:9:23: error: wx/wxprec.h: No such file or directory
wx_pch.h:16:20: error: wx/wx.h: No such file or directory
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings
 

Ok, found your problem. Backticks are expanding correctly, wx-config is working correctly.
The problem is that the precompiled headers are being generated in the object output dir (default). For that to work GCC needs some header paths. But it's more easy to change the precompiled headers strategy.

Just open the project in a text editor and add after <Option title="wxSmith_project" />:
Code: xml
<Option title="wxSmith_project" />
<Option pch_mode="0" />

Or the GUI way: go to menu Project->Properties and in Precompiled headers, change the strategy to Generate PCH in a directory alongside original header.
Generate PCH alongside original header should work too.


Another thing: the warning that appears there cc1plus: note: obsolete option -I- used, please use -iquote instead is being generated by GCC4, which now use -iquote instead of -I-.

takeshimiya

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #26 on: April 26, 2006, 07:23:23 pm »
BTW, all it needs to fix this is a call to project->SetModeForPCH(pchSourceDir); in wxSmith's wxswizard.cpp, which was in a patch I sent to byo some weeks ago.

But it's high likely that the C::B new wizard system will be used for wxSmith wizard, so just do that in the meantime. 

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #27 on: April 26, 2006, 07:33:17 pm »
Just open the project in a text editor and add after <Option title="wxSmith_project" />:
Code: xml
<Option title="wxSmith_project" />
<Option pch_mode="0" />

Or the GUI way: go to menu Project->Properties and in Precompiled headers, change the strategy to Generate PCH in a directory alongside original header.
Generate PCH alongside original header should work too.

That did it. Works like intended. Thank you very much.

Regards,

Andre