Forum Post
Index > Lgi > Newcomer questions

Author/Date Newcomer questions
Nuno Lucas
01/03/2004 2:26am
I downloaded the library and browsed the sources and got very impressed.
I am interested on using this library on a program of mine but have some questions:

1) Is there anyone working on a Windows CE port?
This is the type of library that would benefit many CE programmers out there.

2) Any idea or hint of possible problems on doing the port?
I don't have much time to make the port, so it may prove to not be worthy to do it right now.

3) Why the implementation of standard functions like strcmp() or stricmp()?
They would make my possible port to Windows CE easier, but I don't get why they are being used in windows (I can understand it can be a reason for the stricmp class of functions).

4) On using the library for my application I will also use SQLite ( Is there interest on a driver for sqlite in Lgi?
I will have to do it, anyway, so don't mind to share it (I already made the sqlite port to WinCE -

5) The download of Lgi says is v1.98 (stable release), but lgi.h of the downloaded zip file says its v1.95. Something I should know?

6) Still no plans to regulary update the semi-dead site?
I'm a big fan of CVS.

Well, I think that's enough questions for now, hope not boring anyone and thanks for any replies.

~Nuno Lucas

P.S.- sorry for any english errors I am sure I have done.
Nuno Lucas
01/03/2004 2:49am
Just know tried to compile on VS .NET 7.1 (2003) and had to make some changes (besides disabling the optional libs in LgiConfig.h):

1) GColourReduce.cpp and GPath.cpp call sqrt() with an int.

The C++ library declares 3 sqrt() functions, taking long double, double or float.
The compiler chokes on the code (lines 47 and 1964), because he doesn't know what function to call.
A simple cast to double solves the problem (I don't trust floats, and long doubles are overkill).

2) GString.cpp implementation of strcmp() and stricmp() chokes with the standard functions.
I just #ifdef'ed the functions implementation.

~Nuno Lucas
01/03/2004 5:59pm
1) Not that I know of. I've never used CE or have a machine that runs it.

2) No idea.

3) Mainly because some implementations in standard libraries are broken (ie BeOS). So they should be #ifdef'ed out on platforms that have a working copy in their libc.

4) sqlite: Man that would be nice. I am planning a data binding feature for Lgi so that you could implement forms and so on. But I havn't done it yet.

5) No I just didn't update the header... I forgot the version was in there.

6) Yes, I tried to upload the current source about 2 weeks ago over SSH but didn't get it to work. I'll try again this week. I'm a bit of a SSH noob, although I know plenty of cvs.


1+2) I'll fix those in the code at my end. Unless you want to send me a patch or something.

Thanks for the feedback.

Nuno Lucas
01/03/2004 11:50pm
The diff of what I have done to compile on VS 7.1:

Index: Gdc2/GColourReduce.cpp
RCS file: G:/cvsnt/cvs/lgi/_Common/Gdc2/GColourReduce.cpp,v
retrieving revision
diff -u -r1.1.1.1 GColourReduce.cpp
--- Gdc2/GColourReduce.cpp 29 Feb 2004 18:47:46 -0000
+++ Gdc2/GColourReduce.cpp 1 Mar 2004 04:12:22 -0000
@@ -44,7 +44,7 @@
int db = a->ab - b->ab;

// final result
- return sqrt((dr*dr) + (dg*dg) + (db*db));
+ return sqrt( static_cast((dr*dr) + (dg*dg) + (db*db)) );

bool CreatePalette(GPalette *Out, GSurface *In, int DestSize)

Index: Gdc2/Path/GPath.cpp
RCS file: G:/cvsnt/cvs/lgi/_Common/Gdc2/Path/GPath.cpp,v
retrieving revision
diff -u -r1.1.1.1 GPath.cpp
--- Gdc2/Path/GPath.cpp 29 Feb 2004 18:47:46 -0000
+++ Gdc2/Path/GPath.cpp 1 Mar 2004 04:11:48 -0000
@@ -1961,7 +1961,7 @@
// work out colour

// sqrt gee can we get rid of this
- Ci = sqrt(dxsq+dysq) / Radius;
+ Ci = sqrt( static_cast(dxsq+dysq) ) / Radius;

// clamp colour to the ends of the Lut
if (Ci < 0) c = Lut[0];

Index: Text/GString.cpp
RCS file: G:/cvsnt/cvs/lgi/_Common/Text/GString.cpp,v
retrieving revision
diff -u -r1.1.1.1 GString.cpp
--- Text/GString.cpp 29 Feb 2004 18:47:47 -0000
+++ Text/GString.cpp 1 Mar 2004 07:35:02 -0000
@@ -103,6 +103,7 @@
return NULL;

+#if !defined(WIN32)
int strcmp(char *a, char *b)
int c = -1;
@@ -136,6 +137,7 @@
return c;
+#endif // !defined(WIN32)

#ifndef WIN32
char *strupr(char *a)

All I know is that it compiles ok now. As a newbee on this library I'm still learning how to use it.

~Nuno Lucas
01/03/2004 11:56pm
I've applied those changes here. Thanks.

I had another go at uploading Lgi to sourceforge but it said I had to wait 6 hours to get my SSH key added to their servers. So I'm waiting...
Nuno Lucas
01/03/2004 11:58pm
The form filtered out the static_cast expression, just complet it please (I used a double, but you know better).
Anyway, a simple C cast will do the job. Its just a stylish convention (and makes searching for casts easier when debuging).

~Nuno Lucas
Nuno Lucas
02/03/2004 12:01am
oops, already answered, thanks.

~Nuno Lucas
03/05/2004 6:32am
I also found out that for new projects you shouldn't forget to enable RTTI, otherwise you will get errors. Furthermore I got some errors with GHtml (stack corruption et al) but when compiling in Release-mode everything worked fine...