Percy wrote:
I tried all that, ran Visual Studio as Administrator and this is what I got as 
the first error when I compiled:
1>fl_read_image.cxx
1>Fl_Progress.cxx
1>Fl_Preferences.cxx
1>..\..\src\Fl_Preferences.cxx(85) : fatal error C1021: invalid preprocessor 
command 'warning'

This one is now fixed in the subversion repository (r6988). You must
either load the newest svn version, an _older_ snapshot, or comment out this #warning statement in the source file. If you do the latter, then
you must also add ws2_32.lib to the linker libs, or you must remove or
replace the gethostname() statement as done in the appended patch file.

Albrecht
Index: src/Fl_Preferences.cxx
===================================================================
--- src/Fl_Preferences.cxx      (revision 6986)
+++ src/Fl_Preferences.cxx      (revision 6988)
@@ -82,7 +82,9 @@
           b.byte8, b.byte9, b.byte10, b.byte11, b.byte12, b.byte13, b.byte14, 
b.byte15);
   CFRelease(theUUID);
 #elif defined (WIN32)
+#if defined (__GNUC__)
 #warning MSWindows implementation missing!
+#endif // (__GNUC__)
   // UUID b;
   // UuidCreate(&b);
   unsigned char b[16];
@@ -103,7 +105,11 @@
   b[11] = (unsigned char)(a>>24);
   char name[80]; // last four bytes
   // BOOL GetComputerName(LPTSTR  lpBuffer, LPDWORD  nSize);
-  gethostname(name, 79);
+#if defined (__GNUC__)
+#warning gethostname needs winsock!
+#endif // (__GNUC__)
+  // gethostname(name, 79);    // A.S. temporarily replaced by:
+  strcpy (name,"localhost");   // A.S. FIXME: gethostname
   memcpy(b+12, name, 4);
   sprintf(uuidBuffer, 
"%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
           b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], 
@@ -135,6 +141,8 @@
           b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], 
           b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]);
 #endif
+
+  return uuidBuffer;
 }
 
 
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to