gnupic: Re: [gnupic] Re: FreeBSD and gpsim


Previous by date: 9 Jan 2006 11:29:50 +0000 Correction to gpsim examples, Chen Xiao Fan
Next by date: 9 Jan 2006 11:29:50 +0000 Re: [gnupic] Re: FreeBSD and gpsim, Xiaofan Chen
Previous in thread: 9 Jan 2006 11:29:50 +0000 Re: [gnupic] Re: FreeBSD and gpsim, Scott Dattalo
Next in thread: 9 Jan 2006 11:29:50 +0000 Re: [gnupic] Re: FreeBSD and gpsim, Xiaofan Chen

Subject: Re: [gnupic] Re: FreeBSD and gpsim
From: Xiaofan Chen ####@####.####
Date: 9 Jan 2006 11:29:50 +0000
Message-Id: <a276da400601090329m5ad3e8c0y6c72ebccb51d2cd@mail.gmail.com>

On 1/8/06, Scott Dattalo ####@####.#### wrote:
> The other day you said that you were having problems compiling the file
> src/os_dependent.cc and that you made some changes to fix that. I suspect
> those changes are causing the problem you're seeing. Would it be possible
> to return os_dependent back to its unmodified state? I can then work with
> you on resolving the conflicts there.
>
> I believe at issue here is that dlerror() returns a const char * which at
> some point is passed to another function as a plain (i.e. non-const) char
> *. You may want to first try adding the key word const to the
> 'get_library_module()' function signature:
>

Hi Scott,
Thanks for the help and yes your are right.

The whole problem comes from the definition of dlerror()
under FreeBSD. It is defined as "const char *     dlerror(void);" Therefore
the following code  in os_dependent.c gives the problem since it
casts the return value of dlerror() which is a const char * as a plain char *.

char * get_error_message() {
#ifndef _WIN32
	return dlerror();
#else
  return g_win32_error_message(GetLastError());
#endif
}

What I do is to change this to const char* and change the definitions
of "char** pszError" to "const char ** pszError" and this causes the
problem of  undefined reference.

If I am using the original code, the error message is as following as I
reported in previous email.

gmake[2]: Entering directory `/home/xiaofan/Desktop/build/gpsim-0.21.11/src'
if /usr/local/bin/bash ../libtool --mode=compile --tag=CXX g++
-DHAVE_CONFIG_H - I. -I. -I.. -DXTHREADS -DXUSE_MTSAFE_API
-I/usr/local/include/atk-1.0 -I/usr/loc al/include/cairo
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include 
-I/usr/X11R6/include/gtk-2.0 -I/usr/X11R6/lib/gtk-2.0/include
-I/usr/X11R6/incl ude/pango-1.0 -I/usr/X11R6/include
-I/usr/local/include/freetype2 -I/usr/local/i nclude      -g -O2 -MT
os_dependent.lo -MD -MP -MF ".deps/os_dependent.Tpo" -c - o
os_dependent.lo os_dependent.cc; \
then mv -f ".deps/os_dependent.Tpo" ".deps/os_dependent.Plo"; else rm
-f ".deps/ os_dependent.Tpo"; exit 1; fi
  g++ -DHAVE_CONFIG_H -I. -I. -I.. -DXTHREADS -DXUSE_MTSAFE_API
-I/usr/local/incl ude/atk-1.0 -I/usr/local/include/cairo
-I/usr/local/include/glib-2.0 -I/usr/loca l/lib/glib-2.0/include
-I/usr/X11R6/include/gtk-2.0 -I/usr/X11R6/lib/gtk-2.0/inc lude
-I/usr/X11R6/include/pango-1.0 -I/usr/X11R6/include
-I/usr/local/include/fr eetype2 -I/usr/local/include -g -O2 -MT
os_dependent.lo -MD -MP -MF .deps/os_dep endent.Tpo -c os_dependent.cc
 -fPIC -DPIC -o .libs/os_dependent.o
os_dependent.cc: In function `char* get_error_message()':
os_dependent.cc:352: error: invalid conversion from `const char*' to `char*'
gmake[2]: *** [os_dependent.lo] Error 1
gmake[2]: Leaving directory `/home/xiaofan/Desktop/build/gpsim-0.21.11/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/xiaofan/Desktop/build/gpsim-0.21.11'
gmake: *** [all] Error 2

Regards,
Xiaofan

Previous by date: 9 Jan 2006 11:29:50 +0000 Correction to gpsim examples, Chen Xiao Fan
Next by date: 9 Jan 2006 11:29:50 +0000 Re: [gnupic] Re: FreeBSD and gpsim, Xiaofan Chen
Previous in thread: 9 Jan 2006 11:29:50 +0000 Re: [gnupic] Re: FreeBSD and gpsim, Scott Dattalo
Next in thread: 9 Jan 2006 11:29:50 +0000 Re: [gnupic] Re: FreeBSD and gpsim, Xiaofan Chen


Powered by ezmlm-browse 0.20.