| [ Return to Bugs & Features | Roadmap 2.0 | SVN ⇄ GIT ]
STR #2235
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | None |
Summary: | gcc preprocessor directive "#warning" breaks MSVS fltk 2.0.x builds |
Version: | 2.0-current |
Created By: | simulacrum111 |
Assigned To: | spitzak |
Fix Version: | 2.0-current (SVN: v7680) |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | simulacrum111 11:09 Aug 13, 2009 |
| The GCC compiler suite provides a non-standard preprocessor directive:
#warning
The #warning directive is used in the FLTK 2.0 branch. This preprocessor directive is not supported by Microsoft's optimizing c++ compiler. When this directive is encountered it prevents the generation of *.sbr files - intermediate complilation files. When these *.sbr files are not found the compilation of FLTK 2.0 fails.
To allow developers who use the MSVS IDE to compile FLTK 2.0 please consider using the following preprocessor directive in place of "#warning" in MSVS projects:
#pragma message ( "message here" )
For example:
#warning we assume PixelType = 6 ARGB32 in test it is true for color images
- can be replaced with -
#ifdef __GNUC__ #warning we assume PixelType = 6 ARGB32 in test it is true for color images #elif defined(_MSC_VER) #pragma message ( "we assume PixelType = 6 ARGB32 in test it is true for color images" ) #endif
_______________
Pertaining to fltk v2.0.x-r6841:
Changes similar to the above to files Cursor.cxx line number 281 and Window_fullscreen.cxx line number 220 allowed MSVS to generate the *.sbr files for these translation units. This allowed for a successful compilation of FLTK 2.0 using MSVS.
Please consider using #warning with gcc and #pragma message with Microsoft's optimizing c++ compiler as general practice. | |
|
#2 | Techgee 14:19 Aug 15, 2009 |
| Having the same fatal build error with Visual C++ 6 (v2.0.x-r6841 build):
Compiling... Cursor.cxx D:\Development\fltk-2.0.x-r6841\src\Cursor.cxx(281) : fatal error C1021: invalid preprocessor command 'warning' Window_fullscreen.cxx D:\Development\fltk-2.0.x-r6841\src\Window_fullscreen.cxx(220) : fatal error C1021: invalid preprocessor command 'warning' Generating Code... Error executing cl.exe.
As simulacrum111 mentioned, replacing:
#warning comment
with
#ifdef __GNUC__ #warning comment #elif defined(_MSC_VER) #pragma message ( "comment" ) #endif
fixes the problem with the MSVC compiler, and I can confirm this with the VC6 version.
Note it generates a text message only in the compilation window, not a true compilation warning, but probably the best that can be done. Compilation window after above changes:
Compiling... Cursor.cxx Window_fullscreen.cxx we assume PixelType = 6 ARGB32 in test it is true for color images Generating Code... This method will not work on this system. (you can ignore this warning) Creating library... | |
|
#3 | bgbnbigben 01:59 Feb 06, 2011 |
| Fixed in Subversion repository.
Thanks to spitzak for this fix.... | |
[ Return to Bugs & Features ]
|
| |