lxdream.org :: Issues
lxdream 0.9.1
released Jun 29
Download Now

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000073lxdreamOtherpublic2012-05-14 10:242012-07-02 08:23
Reportereinheitlix 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000073: mercurial version fails to compile due to undefined G_DIR_SEPARATOR
DescriptionThis bug affects the current revision (1285) of the mercurial repo. It also happens for me with the 0.9.1 source avalable from
http://www.lxdream.org/count.php?file=lxdream-0.9.1.tar.gz [^]

When I run './configure' then 'make', the compilation aborts due to the following errors:

---
lxpaths.c: In function ‘get_absolute_path’:
lxpaths.c:116:47: error: ‘G_DIR_SEPARATOR’ undeclared (first use in this function)
lxpaths.c:116:47: note: each undeclared identifier is reported only once for each function it appears in
lxpaths.c: In function ‘get_filename_at’:
lxpaths.c:129:53: error: ‘G_DIR_SEPARATOR’ undeclared (first use in this function)
---

and after fixing that file, same thing happens elsewhere:

---
drivers/cdrom/cd_gdi.c: In function ‘gdi_image_read_toc’:
drivers/cdrom/cd_gdi.c:76:5: warning: implicit declaration of function ‘g_path_get_dirname’ [-Wimplicit-function-declaration]
drivers/cdrom/cd_gdi.c:76:13: warning: assignment makes pointer from integer without a cast [enabled by default]
drivers/cdrom/cd_gdi.c:126:67: error: ‘G_DIR_SEPARATOR’ undeclared (first use in this function)
drivers/cdrom/cd_gdi.c:126:67: note: each undeclared identifier is reported only once for each function it appears in
---

I am running Ubuntu 12.04 (64bit). For me G_DIR_SEPARATOR is defined in the file /usr/include/glib-2.0/glib/gfileutils.h

I am no coder, but my solution was to add the line
#include <glib/gfileutils.h>
at the beginning of the files lxpaths.c and drivers/cdrom/cd_gdi.c.

Also, glib.h seems to include all other glib/g*.h files, including glib/gfileutils.h. So an alternative solution is to replace the lines
#include <glib/gfileutils.h>
#include <glib/gstrfuncs.h>
at the beginning of the files lxpaths.c and drivers/cdrom/cd_gdi.c with simply:
#include <glib.h>

I don't know which is better. I tried both solutions and they both work. It's probably a question of style. As I said, I am no coder :-) I have attached a patch that implements the former solution (as it looked more minimalistic).

Cheers,

Malte
Additional InformationBy the way, in this bug tracker one cannot select "0.9.1" nor "mercurial" as "Product Version" when reporting an issue. It stops at 0.9; it would be cool if this was fixed since most issues reported will probably affect one of these two versions.
TagsNo tags attached.
Milestone
Attached Filespatch file icon g_dir_separator.patch [^] (708 bytes) 2012-05-14 10:24 [Show Content]

- Relationships

-  Notes
(0000089)
einheitlix (reporter)
2012-05-14 10:33

In the second solution described above, I of course meant to replace the lines:
#include <glib/gutils.h>
#include <glib/gstrfuncs.h>

and not
#include <glib/gfileutils.h>
#include <glib/gstrfuncs.h>

Sorry for the typo.
(0000090)
einheitlix (reporter)
2012-07-02 08:23

This bug has been fixed with commit 1286 and can be closed.

- Issue History
Date Modified Username Field Change
2012-05-14 10:24 einheitlix New Issue
2012-05-14 10:24 einheitlix File Added: g_dir_separator.patch
2012-05-14 10:33 einheitlix Note Added: 0000089
2012-07-02 08:23 einheitlix Note Added: 0000090
.