PDA

View Full Version : [SOLVED] [C++] Trying to Include/Link librsvg



dodle
September 15th, 2010, 10:04 AM
I've been trying to learn how to use librsvg, but have been unable to include it in my projects. So to demonstrate my problem I just used the simple "Hello World!" program:


#include <iostream>
#include <librsvg/rsvg.h>
using namespace std;

int main()
{
cout << "Hello World!" << endl;
return 0;
}

I tried compiling like this, but it couldn't find librsvg:

$ g++ hello.cpp -o test
hello.cpp:2:26: error: librsvg/rsvg.h: No such file or directory

I thought that I needed to use a linker flag, but it just gave me the same result:

$ g++ hello.cpp -o test -lrsvg
hello.cpp:2:26: error: librsvg/rsvg.h: No such file or directory

So I found where librsvg resides and included that in the compiler line:

$ g++ hello.cpp -I/usr/include/librsvg-2 -o test
In file included from hello.cpp:2:
/usr/include/librsvg-2/librsvg/rsvg.h:29:35: error: gdk-pixbuf/gdk-pixbuf.h: No such file or directory
In file included from hello.cpp:2:
/usr/include/librsvg-2/librsvg/rsvg.h:31: error: ‘G_BEGIN_DECLS’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:53: error: ‘GQuark’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:65: error: ‘GObjectClass’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:67: error: ‘gpointer’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:71: error: ‘GObject’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:75: error: ‘gpointer’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:94: error: ‘gdouble’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:99: error: ‘gdouble’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:120: error: ‘gboolean’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:122: error: ‘gboolean’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:123: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:124: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:126: error: expected constructor, destructor, or type conversion before ‘char’
/usr/include/librsvg-2/librsvg/rsvg.h:131: error: ‘gboolean’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:132: error: ‘gboolean’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:134: error: ‘gboolean’ does not name a type
/usr/include/librsvg-2/librsvg/rsvg.h:138: error: expected constructor, destructor, or type conversion before ‘char’
/usr/include/librsvg-2/librsvg/rsvg.h:139: error: expected constructor, destructor, or type conversion before ‘char’
/usr/include/librsvg-2/librsvg/rsvg.h:140: error: expected constructor, destructor, or type conversion before ‘char’
/usr/include/librsvg-2/librsvg/rsvg.h:142: error: ISO C++ forbids declaration of ‘guint8’ with no type
/usr/include/librsvg-2/librsvg/rsvg.h:142: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:143: error: ISO C++ forbids declaration of ‘gchar’ with no type
/usr/include/librsvg-2/librsvg/rsvg.h:143: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:162: error: typedef ‘RsvgSizeFunc’ is initialized (use decltype instead)
/usr/include/librsvg-2/librsvg/rsvg.h:162: error: ‘gint’ was not declared in this scope
/usr/include/librsvg-2/librsvg/rsvg.h:162: error: ‘width’ was not declared in this scope
/usr/include/librsvg-2/librsvg/rsvg.h:162: error: ‘gint’ was not declared in this scope
/usr/include/librsvg-2/librsvg/rsvg.h:162: error: ‘height’ was not declared in this scope
/usr/include/librsvg-2/librsvg/rsvg.h:162: error: ‘gpointer’ was not declared in this scope
/usr/include/librsvg-2/librsvg/rsvg.h:164: error: ‘RsvgSizeFunc’ has not been declared
/usr/include/librsvg-2/librsvg/rsvg.h:165: error: ‘gpointer’ has not been declared
/usr/include/librsvg-2/librsvg/rsvg.h:165: error: ‘GDestroyNotify’ has not been declared
/usr/include/librsvg-2/librsvg/rsvg.h:169: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:170: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:172: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:174: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/librsvg-2/librsvg/rsvg.h:176: error: expected constructor, destructor, or type conversion before ‘*’ token
hello.cpp:3: error: expected constructor, destructor, or type conversion before ‘using’
hello.cpp: In function ‘int main()’:
hello.cpp:7: error: ‘cout’ was not declared in this scope
hello.cpp:7: error: ‘endl’ was not declared in this scope

It was now having trouble finding Gdk, so I also included that in the line:

$ g++ hello.cpp -I/usr/include/librsvg-2 -I/usr/include/gtk-2.0 -o test
In file included from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:31:18: error: glib.h: No such file or directory
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:33:25: error: glib-object.h: No such file or directory
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:35,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:35:21: error: gio/gio.h: No such file or directory
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:39,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-io.h:38:21: error: gmodule.h: No such file or directory
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:32,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-features.h:34: error: ‘guint’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-features.h:35: error: ‘guint’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-features.h:36: error: ‘guint’ does not name a type
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:35,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:40: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:44: error: expected constructor, destructor, or type conversion before ‘;’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:63: error: typedef ‘GdkPixbufDestroyNotify’ is initialized (use decltype instead)
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:63: error: ‘guchar’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:63: error: ‘pixels’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:63: error: ‘gpointer’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:81: error: ‘GQuark’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:85: error: ‘GType’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:98: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:100: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:108: error: ‘gboolean’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:132: error: ‘GError’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:136: error: ‘GError’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:140: error: ‘gboolean’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:141: error: ‘GError’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:143: error: ISO C++ forbids declaration of ‘guchar’ with no type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:143: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:153: error: ‘gint’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:154: error: expected primary-expression before ‘const’
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:155: error: ‘gboolean’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:156: error: ‘GError’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:156: error: ‘error’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:156: error: initializer expression list treated as compound expression
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:160: error: ‘guint32’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:170: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:176: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:185: error: ISO C++ forbids declaration of ‘gboolean’ with no type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:185: error: typedef ‘gboolean’ is initialized (use decltype instead)
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:185: error: ‘GdkPixbufSaveFunc’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:190: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:197: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:207: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:214: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:222: error: ‘GInputStream’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:222: error: ‘stream’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:223: error: ‘GCancellable’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:223: error: ‘cancellable’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:224: error: ‘GError’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:224: error: ‘error’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:224: error: initializer expression list treated as compound expression
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:226: error: ‘GInputStream’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:226: error: ‘stream’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:227: error: ‘gint’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:228: error: ‘gint’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:229: error: ‘gboolean’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:230: error: ‘GCancellable’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:230: error: ‘cancellable’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:231: error: ‘GError’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:231: error: ‘error’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:231: error: initializer expression list treated as compound expression
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:233: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:241: error: ‘gboolean’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:242: error: ‘guchar’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:242: error: ‘guchar’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:242: error: ‘guchar’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:254: error: ‘gfloat’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:255: error: ‘gboolean’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:260: error: ‘G_CONST_RETURN’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:264: error: ‘G_END_DECLS’ does not name a type
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:36,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:47: error: expected constructor, destructor, or type conversion before ‘;’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:66: error: ‘GdkInterpType’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:77: error: ‘GdkInterpType’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:89: error: ‘GdkInterpType’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:94: error: ‘guint32’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:95: error: ‘guint32’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:100: error: ‘GdkInterpType’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:105: error: ‘GdkInterpType’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:108: error: ‘guint32’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:109: error: ‘guint32’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:114: error: ‘gboolean’ has not been declared
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-transform.h:116: error: ‘G_END_DECLS’ does not name a type
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:37,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:52: error: ‘GType’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:58: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:62: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:63: error: variable or field ‘gdk_pixbuf_animation_unref’ declared void
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:63: error: ‘GdkPixbufAnimation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:63: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:66: error: ‘GdkPixbufAnimation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:66: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:67: error: ‘GdkPixbufAnimation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:67: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:68: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:69: error: ‘GdkPixbufAnimation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:69: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:71: error: ‘GdkPixbufAnimation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:71: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:72: error: expected primary-expression before ‘const’
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:72: error: initializer expression list treated as compound expression
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:73: error: ‘GType’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:76: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:77: error: ‘gboolean’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:149: error: ‘G_END_DECLS’ does not name a type
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:38,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:46: error: ‘GType’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:47: error: ‘GType’ does not name a type
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:49: error: expected constructor, destructor, or type conversion before ‘*’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:52: error: variable or field ‘gdk_pixbuf_simple_anim_add_frame’ declared void
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:52: error: ‘GdkPixbufSimpleAnim’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:52: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:53: error: expected primary-expression before ‘*’ token
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:53: error: ‘pixbuf’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:54: error: variable or field ‘gdk_pixbuf_simple_anim_set_loop’ declared void
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:54: error: ‘GdkPixbufSimpleAnim’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:54: error: ‘animation’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:55: error: ‘gboolean’ was not declared in this scope
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h:56: error: ‘gboolean’ does not name a type
In file included from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-io.h:36,
from /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:39,
from /usr/include/librsvg-2/librsvg/rsvg.h:29,
from hello.cpp:2:
/usr/include/stdio.h:30: error: expected constructor, destructor, or type conversion before ‘extern’

Now it complains that it cannot find "glib.h", and it just goes on. What is the right way to link to librsvg?

spjackson
September 15th, 2010, 10:51 AM
If you installed librsvg2-dev from the repos, then pkg-config is your friend.


$ g++ hello.cpp -o test `pkg-config --cflags --libs librsvg-2.0`

dwhitney67
September 15th, 2010, 12:31 PM
If you installed librsvg2-dev from the repos, then pkg-config is your friend.


$ g++ hello.cpp -o test `pkg-config --cflags --libs librsvg-2.0`

I don't recommend naming an executable as "test"; one with that name already exists in /usr/bin. One may draw incorrect conclusions when running their app, unless they are smart enough to run it as "./test".

spjackson
September 15th, 2010, 12:46 PM
I don't recommend naming an executable as "test"; one with that name already exists in /usr/bin. One may draw incorrect conclusions when running their app, unless they are smart enough to run it as "./test".
As that was the original poster's choice, I didn't change it, since it has no bearing whatsoever on the problem presented. If one is a novice lacking understanding of the environment in which one is working, then your point is valid; otherwise there's no problem.

dodle
September 15th, 2010, 06:42 PM
If you installed librsvg2-dev from the repos, then pkg-config is your friend.


$ g++ hello.cpp -o test `pkg-config --cflags --libs librsvg-2.0`

Thank you very much.