Problem compiling my own projects Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Paul1234
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Aug 03, 2005 9:04 am

Problem compiling my own projects

Post by Paul1234 » Wed Aug 03, 2005 9:31 am

Hi all,

I installed wxWidgets with no problems using
./configure --with-x11 --with-opengl
make
make install
ldconfig


I then set LD_LIBRARY_PATH and CPLUS_INCLUDE_PATH to the base directory.

I can 'make' all the sample projects and run them with no problems. However I then wrote a simple program and tried to compile using:
g++ MyProj.cpp 'wx-config --libs --cxxflags' -o MyProj

but I then get the error:
g++: wx-config --libs --cxxflags: no such file or directory

and a lot of errors below this. If I type wxconfig --libs --cxxflags at the command line it works fine and returns a string of options (I also tried copying these to the g++ command directly without success). Im using GCC 3.3.5 and KDE on slackware 10.1.

Anyone know what I'm doing wrong?

Thanks.

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Wed Aug 03, 2005 2:37 pm

Hi,

wx-config is a shell script. You need to either put the full path to this script or add the directory it's in to your PATH.

HTH

Chris

------------------------------------------------------------
Chinook Developer Studio
*Free multiplatform IDE for BSD.Linux.Solaris.Windows*
http://www.degarrah.com/chinookfree.php

Zephyr Automated Test Runner
*Cross platform automated functional and regression testing*
http://www.degarrah.com/zephyr.php
------------------------------------------------------------

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Wed Aug 03, 2005 2:57 pm

g++ MyProj.cpp 'wx-config --libs --cxxflags' -o MyProj
is not a valid call.

you call a program (g++)
with params:
  • MyProj.cpp
    'wx-config --libs --cxxflags'
    -o MyProj
the second parameter is not valid because this is a full command line.
either you use a make file for compiling your cpp file, or you set explicitely all the flags needed by g++.

you may do 'man gcc' or 'man g++' to have the full list/description of options you can use.

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Wed Aug 03, 2005 9:00 pm

its a valid command. you just need to change your ' to ` in order to have it execute the wx-config part in the shell.
C

------------------------------------------------------------
Chinook Developer Studio
*Free multiplatform IDE for BSD.Linux.Solaris.Windows*
http://www.degarrah.com/chinookfree.php

Zephyr Automated Test Runner
*Cross platform automated functional and regression testing*
http://www.degarrah.com/zephyr.php
------------------------------------------------------------

Paul1234
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Aug 03, 2005 9:04 am

Post by Paul1234 » Fri Aug 05, 2005 10:42 am

Hi again,

Thanks for your replies. I had included the path already for wx-config and created a symbolic link to the script within /bin. Cg was right and it was just that I had used ' instead of ` :x . Anyway it compiles fine now without problems!

I wanted to use wxwidgets rather than QT because I will be writing an OpenGL program which will be used in both Linux and Windows.

Thanks again,

Paul.

Post Reply