Re: Problems in compiling gupnp source code



On Sun, 2013-06-02 at 18:13 +0200, Poalo Vecchiotti wrote:
Hello all of you,
I'm Paolo and I'm mailing you because I'm following the tutorial on
the website:
https://developer.gnome.org/gupnp/unstable/client-tutorial.html
I've written all the source code in a .cpp text file. I put this text
file in a folder called prova1 and I copied in this folder the
following folders:
glib-2.35.9
gupnp-0.20.2
gssdp-0.14.2
libsoup-2.24.0
libxml-1.8.17
which I downloaded from gupnp website.


Then I tried to run the program with the command:

~/Desktop/Paolo/prova1$ g++ cp1.cpp -o cpprova -I (all the folders
with the relative headers ) -L (all the folders containing libraries);


now libraries must be linked with -llibraries ; the problem is
I really don't manage to do it.

What's the best way to link what the program needs to run?

The "usual" way on to linux, bsd, etc. do this is to use a tool called
pkg-config which assumes you installed all the libraries to a place
known place known to pkg-config. What platform are you on?

g++ cp1.cpp $(pkg-config --cflags gupnp-1.0) -o cpprova $(pkg-config
--libs gupnp-1.0 gssdp-1.0)

Which takes care of generating all the neccessary -I, -L and -l flags.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]