Re: [Nbd] Probs compiling nbd-2.9.24 on CentOS 6.0, 64bit - undefined reference to `g_key_file_get_int64'
- To: Daniel Schwager <Daniel.Schwager@...207...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] Probs compiling nbd-2.9.24 on CentOS 6.0, 64bit - undefined reference to `g_key_file_get_int64'
- From: Wouter Verhelst <w@...112...>
- Date: Thu, 3 Nov 2011 22:49:20 +0100
- Message-id: <20111103214920.GG10172@...3...>
- In-reply-to: <EB31672367A401439CD5A4A10889D57B04855CCE@...661...>
- References: <EB31672367A401439CD5A4A10889D57B04855CCE@...661...>
On Thu, Nov 03, 2011 at 09:07:31PM +0100, Daniel Schwager wrote:
> Hi Wouter,
>
> I tried to compile the current nbd 2.9.24 on
> a centos 6.0, 64bit system and get the following error:
>
> [root@...956... /opt/nbd-2.9.24/src/nbd-2.9.24]$ make install
> ....
> make[1]: Entering directory `/opt/nbd-2.9.24/src/nbd-2.9.24'
> gcc -std=gnu99 -g -O2 -I/usr/include/glib-2.0
> -I/usr/lib64/glib-2.0/include -g -O2 -o nbd-server
> nbd_server-nbd-server.o -lglib-2.0
> nbd_server-nbd-server.o: In function `parse_cfile':
> /opt/nbd-2.9.24/src/nbd-2.9.24/nbd-server.c:911: undefined reference to
> `g_key_file_get_int64'
> collect2: ld returned 1 exit status
> make[1]: *** [nbd-server] Error 1
>
> The current installed glib's are
> glibc-headers-2.12-1.7.el6_0.5.x86_64
> glib2-2.22.5-5.el6.x86_64
You need glib2 2.26 or higher for the get_int64 call. You may need to
upgrade.
Alternatively, you can apply the following patch:
diff --git a/nbd-server.c b/nbd-server.c
index afb82de..4f2b1f2 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -899,6 +899,7 @@ GArray* parse_cfile(gchar* f, bool have_global, GError** e) {
g_assert(p[j].ptype==PARAM_INT||p[j].ptype==PARAM_STRING||p[j].ptype==PARAM_BOOL||p[j].ptype==PARAM_INT64);
switch(p[j].ptype) {
case PARAM_INT:
+ case PARAM_INT64:
ival = g_key_file_get_integer(cfile,
groups[i],
p[j].paramname,
@@ -907,15 +908,6 @@ GArray* parse_cfile(gchar* f, bool have_global, GError** e) {
*((gint*)p[j].target) = ival;
}
break;
- case PARAM_INT64:
- i64val = g_key_file_get_int64(cfile,
- groups[i],
- p[j].paramname,
- &err);
- if(!err) {
- *((gint64*)p[j].target) = i64val;
- }
- break;
case PARAM_STRING:
sval = g_key_file_get_string(cfile,
groups[i],
but note that if you do this, the 'filesize' config file parameter will
not function correctly.
--
The volume of a pizza of thickness a and radius z can be described by
the following formula:
pi zz a
Reply to: