News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Linux Error "No Target! You should use wx-config program for compilation flags!"

Started by AlexM, February 10, 2009, 04:00:03 PM

Previous topic - Next topic

AlexM

Hi I'm new to Linux and am trying to setup Code Blocks to compile cross platform c++ using the wxWidgets API. I've managed to get it to compile and work with windows and Visual Studio but am have trouble with Ubuntu and GTK. I've built and configured wxGTK 2.8.9 to my $HOME/opt and have set:
search folders in code blocks to:

  • opt/lib/wx/include/gtk2-ansi-release-2.8
  • opt/include/wx-28
and the compiler other options to:
`wx-config  --cflags`

but am still getting the error:
"No Target! You should use wx-config program for compilation flags!"


Please can someone help as I've been unable to find any solutions on the forums for this specific error and i'm sure its something simple I'm doing wrong.

Thank you!




Jenna

The problem is moste likely, that you have wxwisgets installed in a non standard directory tree.

Try wx-config --list from commandline.

If wx-config is not found, you can put a symlink from /opt/lib/wx/config/gtk2-unicode-release-2.9 to /usr/bin/wx-config.
Replace "gtk2-unicode-release-2.9" with the configuration you want to use as standard.

If you have a wx-config, but your compilation is not listed, try wx-config --prefix=/opt --list to see what available.

James Edgar

I got the same error on a Linux system.  However, `wx-config --cflags` was already defined when the project was setup.  Looking at the code where the error was flagged, there were a number of options including the following:

         !defined(__WXMOTIF__) && \            !defined(__WXMSW__)   && \            !defined(__WXPALMOS__)&& \            !defined(__WXGTK__)   && \

By adding     __WXGTK__  (I assume that is the default)  to the compiler settings defines, I got this error to go away.  Also, once this was done, several libraries had to be added in the linker settings.  These were:

libwx_baseu-2.8.so and libwx_gtk2u_aui-2.8.so

I had expected that `wx-config --libs` would handle this automatically, but apparently it just sets the directories.

Jenna

wx-config --libs does not set compiler-defines,that's done by wx-config --cxxflags.

What's the output of wx-config --list ?

James Edgar

Jens --

Thank you for replying.  It looks like I must have accidentally hit the use advanced options button during project setup.  As it says, this will create difficulties when compiling without taking the steps listed in my other post.

Thanks,

James

PS -- output of:

wx-config --list

produces:

Default config is gtk2-unicode-release-2.8

Default config will be used for output

physnoct

For a c++ project using wx-widgets, it seems that the `wx-config --cflags` should be `wx-config --cxxflags` instead.
I had the same problem, and making that change in the compiler options helped it compile further.

JP

gintasdx

Thanks James. That solved my problems by compiling simple WxWidgets demo. You also need to link a
libwx_gtk2u_core-2.8 library.

VonZorch

I had the same problem.  When I put 'wx-config --cxxflags' in compiler other options, I got an invalid command line option error.  What I did was copied the output of it from the terminal to compiler other options.  This got my project  to compile farther.

stahta01

Quote from: VonZorch on December 14, 2013, 05:14:21 AM
I had the same problem.  When I put 'wx-config --cxxflags' in compiler other options, I got an invalid command line option error.  What I did was copied the output of it from the terminal to compiler other options.  This got my project  to compile farther.

You do realize those are supposed to be back ticks NOT the normal single tick/quote!

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

floatingCloud

Quote from: physnoct on July 18, 2011, 02:44:21 AM
For a c++ project using wx-widgets, it seems that the `wx-config --cflags` should be `wx-config --cxxflags` instead.
I had the same problem, and making that change in the compiler options helped it compile further.

JP
That worked for me too. Thanks :)