User forums > Help

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

(1/2) > >>

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-28and 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
--- Code: ---wx-config --list
--- End code ---
from commandline.

If wx-config is not found, you can put a symlink from
--- Code: ---/opt/lib/wx/config/gtk2-unicode-release-2.9
--- End code ---
to
--- Code: ---/usr/bin/wx-config
--- End code ---
.
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
--- Code: ---wx-config --prefix=/opt --list
--- End code ---
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

Navigation

[0] Message Index

[#] Next page

Go to full version