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

Offline rowck001

  • Single posting newcomer
  • *
  • Posts: 9
How to setup wxwidgets in code::blocks Linux
« on: April 24, 2006, 07:37:08 am »
Ok - I switched to Linux   8) (I have DialogBlocks and wxWidgets installed)

How do I set up the code::blocks environment to use this library in Linux??

I installed as root for make install in wxwidgets complie - so I assume it went into /usr/local/share

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: How to setup wxwidgets in code::blocks Linux
« Reply #1 on: April 24, 2006, 02:21:33 pm »
Open up a console and type:
Code: [Select]
wx-config --versionIf you see something as an output then we 're on the right track.
To your project now:
Project->Build Options->Compiler->Other Options add `wx-config --cflags` in there
Project->Build Options->Linker->Other Options add `wx-config --libs` in there
One final thing (don't know if this one is fixed). There is a bug that won't let the linker options work correctly so also do the following:
Project->Properties->Generate pch in a directory alongside... (the first option from above)
Enjoy...

P.S. what linux distro are you using? You don't *really* need to build wxWidgets from source, installing wxGTK from your distro's repository should be enough.
Life would be so much easier if we could just look at the source code.

Offline rowck001

  • Single posting newcomer
  • *
  • Posts: 9
Re: How to setup wxwidgets in code::blocks Linux
« Reply #2 on: April 25, 2006, 09:21:30 am »
Thanks for the help

I am using Ubuntu Breezy and using its wxlibs deb packages doesnt give me the wxgtk....so.0 lib file so thats why I built from source

Incidently, should I have compiled as monolithic or shared library?

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: How to setup wxwidgets in code::blocks Linux
« Reply #3 on: April 25, 2006, 09:40:36 am »
Generally prefer shared libraries. I don't really like the monolithic build, but I can understand the purpose of it in windows. In linux you can choose to go either way. If you want to get the C::B proposed build just take a look at the wiki.
Life would be so much easier if we could just look at the source code.

Offline rowck001

  • Single posting newcomer
  • *
  • Posts: 9
Re: How to setup wxwidgets in code::blocks Linux
« Reply #4 on: April 25, 2006, 10:58:47 am »
Thanks for the help yop - but it doesnt work - after putting in the options you specified i still get this output from anf wxwidgets project:

Compiling: main.cpp
g++: `wx-config: No such file or directory
g++: `wx-config: No such file or directory
cc1plus: error: unrecognized command line option "-fcflags`"
cc1plus: error: unrecognized command line option "-fcflags`"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

wxwidgets works like a charm in kdevelop (straight out of the box) but not code::blocks

probably not a good idea to sprout code::blocks as cross-platform as it clearly doesnt work apart from trivial console applications in linux!

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How to setup wxwidgets in code::blocks Linux
« Reply #5 on: April 25, 2006, 11:15:51 am »
Thanks for the help yop - but it doesnt work - after putting in the options you specified i still get this output from anf wxwidgets project:

Compiling: main.cpp
g++: `wx-config: No such file or directory
g++: `wx-config: No such file or directory
cc1plus: error: unrecognized command line option "-fcflags`"
cc1plus: error: unrecognized command line option "-fcflags`"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

wxwidgets works like a charm in kdevelop (straight out of the box) but not code::blocks

probably not a good idea to sprout code::blocks as cross-platform as it clearly doesnt work apart from trivial console applications in linux!

You've come across a known bug in C::B RC2 which has been fixed long ago. A little forum search would have revealed that... :roll:

There are two ways you can get it working:
-Go to Settings->Compiler->Other and set the build mode to "GNU make". Backticks will work with it.
or
-Download and install a nightly build.

I recommend the later.

Offline rowck001

  • Single posting newcomer
  • *
  • Posts: 9
Re: How to setup wxwidgets in code::blocks Linux
« Reply #6 on: April 25, 2006, 03:28:11 pm »
OK! I'm running Linux ... so I'll get a nightly Build which only is available for Windows!!  Hmmmm...... sounds like a good option  :x
 I guess kdevelop is looking good!

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: How to setup wxwidgets in code::blocks Linux
« Reply #7 on: April 25, 2006, 03:52:12 pm »
compile your own copy of SVN revision like i do for win
everyting is ok, works just fine


just do the things thats wrote here http://wiki.codeblocks.org/index.php?title=Nightly_Cookbook

sorry for my poor english

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How to setup wxwidgets in code::blocks Linux
« Reply #8 on: April 25, 2006, 05:30:54 pm »
OK! I'm running Linux ... so I'll get a nightly Build which only is available for Windows!!  Hmmmm...... sounds like a good option  :x
 I guess kdevelop is looking good!
Could you instead take at least 1 minute for reading?
There are nightly builds being made for Redhat FC4 and Ubuntu 5.10, and that is linux.
If you don't have any of those distros you can compile it from svn yourself as PsYhLo pointed out.

If you don't want to do anything of that (!) I gave you another solution... Change the build system to "GNU make".

A side note: KDevelop doesn't works for me out of the box, but I can't complain as I haven't readed anything about it.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: How to setup wxwidgets in code::blocks Linux
« Reply #9 on: April 25, 2006, 05:35:43 pm »
OK! I'm running Linux ... so I'll get a nightly Build which only is available for Windows!!  Hmmmm...... sounds like a good option  :x
 I guess kdevelop is looking good!
i think you should use KDevelop, it's really better for you, they also have a good forum where you can ask for help there !

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #10 on: April 25, 2006, 08:14:02 pm »
You've come across a known bug in C::B RC2 which has been fixed long ago. A little forum search would have revealed that... :roll:

There are two ways you can get it working:
-Go to Settings->Compiler->Other and set the build mode to "GNU make". Backticks will work with it.
or
-Download and install a nightly build.

I recommend the later.

I have a nightly build (from yesterday) and i also have this problem. But the setting 'Settings->Compiler->Other->build mode is grayed out, so i can not change it. What can i do?

Thanks in advance,

Andre

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How to setup wxwidgets in code::blocks Linux
« Reply #11 on: April 25, 2006, 09:43:24 pm »
I have a nightly build (from yesterday) and i also have this problem. But the setting 'Settings->Compiler->Other->build mode is grayed out, so i can not change it. What can i do?
No, that problem was solved after RC2 for C::B build method, so it should work with it. The "GNU make" build method was removed after RC2 too.

In your case, it's likely that you don't have wx-config installed.
Issue
Quote
wx-config --version
in a shell, and if it outputs something, it means that it is installed.
If it's not installed, you'll need to download a package that contains that script, usually called "wx-common".

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #12 on: April 25, 2006, 10:18:56 pm »
In your case, it's likely that you don't have wx-config installed.
Issue
Quote
wx-config --version
in a shell, and if it outputs something, it means that it is installed.
If it's not installed, you'll need to download a package that contains that script, usually called "wx-common".

The package wx-common is installed, wx-config --version says 2.6.1. I've made the settings yop told in the second post of this thread. But it seems that wx-config can not be found. Ouput of the build command:
Code: [Select]
-------------- Build: default in wxSmith_project ---------------
g++ `wx-config --cflags` wx-config --cflags  -I.objs -I- -I.objs -I. -I/usr/include  -c app.cpp -o .objs/app.o
g++: wx-config: No such file or directory
cc1plus: note: obsolete option -I- used, please use -iquote instead
cc1plus: error: unrecognized command line option "-fcflags"
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 0 warnings

In another Thread you also said
As a note to anyone using RC2, this can be solved as:

Quote
Go to Settings->Compiler->Other and set the build mode to "GNU make". Backticks work with it.

But i can not alter these settings as its grayed out. Should i switch away from the nightly build to RC2?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How to setup wxwidgets in code::blocks Linux
« Reply #13 on: April 25, 2006, 11:00:47 pm »
But i can not alter these settings as its grayed out. Should i switch away from the nightly build to RC2?
No, you're experiencing a different problem.
This thread may help you: http://forums.codeblocks.org/index.php?topic=2195.0

Andre

  • Guest
Re: How to setup wxwidgets in code::blocks Linux
« Reply #14 on: April 25, 2006, 11:20:06 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