FLTK logo

STR #2994

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]

STR #2994

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:2 - Specific to an operating system
Subsystem:Core Library
Summary:Newer version of MinGW attempts to redefine _stricmp()
Version:1.3.2
Created By:wernsey
Assigned To:AlbrechtS
Fix Version:1.3.3 (SVN: v10044)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 wernsey
12:00 Oct 16, 2013
Hi,

I downloaded the latest version of MinGW (which uses GCC 4.8.1) tonight and wanted to upgrade to the latest version of FLTK (1.3.2) as well.

The library couldn't compile (during the fluid part of the build process) because the header flstring.h attempts to redefine _stricmp().

I temporarily resolved the issue by replacing line 43 in flstring.h
    #    define strcasecmp(s,t) _stricmp((s), (t))
with this one:
    #    define HAVE_STRCASECMP 1

I've also tried FLTK 1.3.0 and it had the same problem.

This is the compiler error:
-------------------------------------------------------

Compiling factory.cxx...
In file included from factory.cxx:33:0:
../src/flstring.h:44:37: error: 'int _stricmp' redeclared as different kind of symbol
 #    define strcasecmp(s,t) _stricmp((s), (t))
                                     ^
factory.cxx:46:1: note: in expansion of macro 'strcasecmp'
 strcasecmp(const char *s, const char *t) {
 ^
-------------------------------------------------------
 
 
#2 AlbrechtS
09:28 Jan 03, 2014
Fixed in Subversion repository.

The problem with this issue is that recent MinGW runtime versions don't have strcasecmp() as a function, but use

#define strcasecmp _stricmp

instead. This way configure does not find strcasecmp, but the existing #define collides with the definition in fluid/factory.cxx.

The provided fix in svn r 10044 is intended as a temporary fix, until a better solution is found (or the configure tests get adjusted or ...).
 
 
#3 AlbrechtS
09:30 Jan 03, 2014
Werner (and/or others), please confirm, if this fixes the issue, so that this STR can be closed within the next days.  
 
#4 wernsey
10:46 Jan 08, 2014
Hi, thank you.

I just checked out revision 10048 from SVN.

From the MSYS shell, I ran
$ autoconf
$ ./configure
$ make

and received the following compiler error:
------------------------------------

Compiling gifImage.cxx...
gifImage.cxx: In member function 'virtual bool fltk::gifImage::fetch()':
gifImage.cxx:105:7: error: 'colormap' was not declared in this scope
   U32 colormap[256];
       ^

------------------------------------

It turns out that
#undef U16
#undef U32
#undef U64

It seems that the configure scripts did not set the U32 properly. I worked around the issue by replacing the U32 line with
#define U32 unsigned int

After that, everything comppiled successfully.

Regards,
Werner
 
 
#5 wernsey
10:46 Jan 08, 2014
Hi, thank you.

I just checked out revision 10048 from SVN.

From the MSYS shell, I ran
$ autoconf
$ ./configure
$ make

and received the following compiler error:
------------------------------------

Compiling gifImage.cxx...
gifImage.cxx: In member function 'virtual bool fltk::gifImage::fetch()':
gifImage.cxx:105:7: error: 'colormap' was not declared in this scope
   U32 colormap[256];
       ^

------------------------------------

It turns out that the config.h contains:
#undef U16
#undef U32
#undef U64

It seems that the configure scripts did not set the U32 properly. I worked around the issue by replacing the U32 line with
#define U32 unsigned int

After that, everything comppiled successfully.

Regards,
Werner
 
 
#6 AlbrechtS
05:16 Jan 11, 2014
How did you check out the svn version, maybe with a Windows svn client (e.g. tortoise svn?).

We got reports that some of the configure scripts (or *.in files) had cr/lf line endings when checked out with a Windows svn client, and then configure can fail in unexpected ways.

My MinGW/MSYS configure looks like this:
$ grep U[0-9] config.h
 * U16, U32, U64:
 * Types used by fl_draw_image.  One of U32 or U64 must be defined.
 * U16 is optional but FLTK will work better with it!
#define U16 unsigned short
#define U32 unsigned
/* #undef U64 */

Could you please try to fix the line endings with dos2unix (d2u), using something like

$ d2u *.in

and try again?
 
 
#7 AlbrechtS
16:45 Feb 03, 2014
This STR has not been updated by the submitter for two or more weeks and has been closed as required by the FLTK Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR.

Closing this STR.

The original issue *was* fixed in svn r 10044.

If the issue concerning U32 persists, please feel free to open another STR, and answer the above question(s).
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.