| View previous topic :: View next topic |
| Author |
Message |
pmatos Veteran

Joined: 06 Jun 2003 Posts: 1220 Location: Cambridge, UK
|
Posted: Wed Jul 27, 2005 10:54 pm Post subject: libsoup error (probably bug???) [SOLVED] |
|
|
Hi all,
Emerged libsoup-2.2.3-r1. I've created a file to try libsoup out:
| Code: | #include <iostream>
#include <libsoup/soup-session-sync.h>
using namespace std;
#define SOUP_CONNECTION_ORIGIN_URI "http://webservices.amazon.co.uk/onca/soap?Service=AWSECommerceService"
int main() {
SoupConnection * sc = soup_connection_new("SOUP_CONNECTION_ORIGIN_URI");
soup_connection_connect_sync(sc);
soup_connection_disconnect(sc);
return 0;
} |
With this code I get the following error:
| Code: | $ g++ soup-connect.cc -o soup-connect -lsoup
soup-connect.cc:2:39: libsoup/soup-session-sync.h: No such file or directory
soup-connect.cc: In function `int main()':
soup-connect.cc:10: error: `SoupConnection' undeclared (first use this
function)
soup-connect.cc:10: error: (Each undeclared identifier is reported only once
for each function it appears in.)
soup-connect.cc:10: error: `sc' undeclared (first use this function)
soup-connect.cc:10: error: `soup_connection_new' undeclared (first use this
function)
soup-connect.cc:12: error: `soup_connection_connect_sync' undeclared (first use
this function)
soup-connect.cc:14: error: `soup_connection_disconnect' undeclared (first use
this function) |
Checking where the package is installed I see that the include files are at:
| Code: |
/usr/include/libsoup-2.2/libsoup
/usr/include/libsoup-2.2/libsoup/soup-message-queue.h
/usr/include/libsoup-2.2/libsoup/soup-message.h
/usr/include/libsoup-2.2/libsoup/soup-message-filter.h
...
|
Well, so I changed to:
| Code: | | #include <libsoup-2.2/libsoup/soup-session-sync.h> |
but this generates the following error:
| Code: | $ g++ soup-connect.cc -o soup-connect -lsoup
In file included from soup-connect.cc:2:
/usr/include/libsoup-2.2/libsoup/soup-session-sync.h:9:32: libsoup/soup-types.h: No such file or directory
/usr/include/libsoup-2.2/libsoup/soup-session-sync.h:10:34: libsoup/soup-session.h: No such file or directory
In file included from soup-connect.cc:2:
...
|
Well, so I think that libsoup is being installed in incorrect places. It should be in | Code: | | /usr/include/libsoup | and not | Code: | | /usr/include/libsoup-2.2/libsoup/ |
There's no bug report in bugs.gentoo.org which I find strange. Any ideas? Should I report this?
Last edited by pmatos on Sat Jul 30, 2005 2:08 pm; edited 1 time in total |
|
| Back to top |
|
 |
chtephan Apprentice


Joined: 03 Feb 2004 Posts: 265 Location: Offenburg, Germany
|
Posted: Wed Jul 27, 2005 11:15 pm Post subject: |
|
|
There's a special mechanism how you can figure out which compiler and linker flags to use.
For the compiler (include) flags: pkg-config --cflags libsoup-2.2
For the linker flags: pkg-config --libs libsoup-2.2
If you are calling the compiler directly, it would look like this:
g++ -O2 -o binary source.cc `pkg-config --cflags --libs libsoup-2.2`
The output returns this on my system:
leto:/home/chtephan > pkg-config --cflags --libs libsoup-2.2
-I/usr/include/libsoup-2.2 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lsoup-2.2 -lgnutls -lgcrypt -lgpg-error -lxml2 -lpthread -lz -lm -lglib-2.0
The -I/usr/include/libsoup-2.2 adds that directory to the include path.
"#include <libsoup/blabla.h>" is correct. Gentoo likes to separate these to avoid clashes with different versions. |
|
| Back to top |
|
 |
pmatos Veteran

Joined: 06 Jun 2003 Posts: 1220 Location: Cambridge, UK
|
Posted: Sat Jul 30, 2005 2:07 pm Post subject: |
|
|
| chtephan wrote: | There's a special mechanism how you can figure out which compiler and linker flags to use.
For the compiler (include) flags: pkg-config --cflags libsoup-2.2
For the linker flags: pkg-config --libs libsoup-2.2
If you are calling the compiler directly, it would look like this:
g++ -O2 -o binary source.cc `pkg-config --cflags --libs libsoup-2.2`
The output returns this on my system:
leto:/home/chtephan > pkg-config --cflags --libs libsoup-2.2
-I/usr/include/libsoup-2.2 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lsoup-2.2 -lgnutls -lgcrypt -lgpg-error -lxml2 -lpthread -lz -lm -lglib-2.0
The -I/usr/include/libsoup-2.2 adds that directory to the include path.
"#include <libsoup/blabla.h>" is correct. Gentoo likes to separate these to avoid clashes with different versions. |
That's it! Thanks |
|
| Back to top |
|
 |
|