Possible Feeimage.mod error?!

BlitzMax Forums/Brucey's Modules/Possible Feeimage.mod error?!

Grisu(Posted April) [#1]
Hi!

Anyone else getting this error under GCC 6.3? Or is it caused by a faulty installation?

Compiling:PluginG3.cpp
In file included from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibTIFF4/tiffio.h:258:0,
                 from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibTIFF4/tiffiop.h:60,
                 from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/FreeImage/PluginG3.cpp:23:
C:/MinGW/mingw32/i686-w64-mingw32/include/stdio.h:541:23: error: conflicting declaration of 'int _snprintf(char*, size_t, const char*, ...)' with 'C' linkage
   _CRTIMP int __cdecl _snprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
                       ^~~~~~~~~
In file included from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibTIFF4/tiffiop.h:33:0,
                 from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/FreeImage/PluginG3.cpp:23:
C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibTIFF4/tif_config.h:84:18: note: previous declaration with 'C++' linkage
 #define snprintf _snprintf
                  ^
Build Error: failed to compile C:/BlitzMax/mod/bah.mod/freeimage.mod/src/FreeImage/PluginG3.cpp


Grisu


braxton(Posted April) [#2]
Hi Grisu,

In order to compile you will need to make the following changes to freeimage.mod/src/LibTIFF4/tif_config.h

As snprintf is already defined we need to avoid the redeclaration error or simply comment it out entirely

eg:
@Line 84:
/* # define snprintf _snprintf */

OR

@Line 83:
#ifdef _WIN32
# ifndef snprintf
# define snprintf _snprintf
# endif
#define lfind _lfind
#endif // _WIN32

Unfortunately there are a few more challenges when using mingw 6.3.0

MaxGui compiled windows x64 programs seem to create an invalid executable and give a 0xc0007b error

That is unless they are run from within the ide, which could possibly be due to a linking issue

Also x86 programs give the following message when attempting to build the final exe:

Could not determine MinGWCrtPath: Expecting 'D:/BlitzMaxNG/BlitzMax/MinGW32x86/lib/gcc/mingw32/6.3.0'
in my case the folder is actually
'D:/BlitzMaxNG/BlitzMax/MinGW32x86/lib/gcc/mingw32/i686-w64-mingw32'

and renaming it doesn't help unfortunately as it still cannot find it.

On Windows brl.dxgraphics, brl.d3d7max2d.mod, brl.d3d9max2d.mod, d3d9sdlgraphics.mod, & d3d9sdlmax2d.mod is currently not building with the latest bmk so in my case I had to omit these modules for the time being.

There are also several of Brucey's bah modules that won't build and appear to be incompatible with windows x64, and unfortunately that is a little over my head.


Derron(Posted April) [#3]
Think it will take some time until Brucey fixes these issues. As you might have recognized his latest activity is a bit "nearly-non-existent".

As he did not reply to my emails for some weeks now I am hoping he is just very busy with real life - or just is taking some outtime from digital life.


bye
Ron


braxton(Posted April) [#4]
Hi Derron,

I too hope that he is well, and having a nice relaxing break!

Brucey's BlitzMax-NG efforts are nothing short of amazing and very much appreciated!

I feel comfortable with BlitzMax it is like a favourite pair of shoes, I might try new ones on occasionally but I always seem to go back to them.

It is a really nice surprise whenever there is an update, and checking out the latest commit on GitHub is an experience in itself, seeing it evolve is awesome!

With build tools on windows, especially mingw it can be a bit problematic sometimes as it appears to be in a constant state of flux, llvm seems to be the same, it is cutting edge though and totally worth it,
depending on who you ask of course!


Grisu(Posted April) [#5]
Thanks Braxton and Derron for the help. I'm still using an updated version of BMX vanilla as I don't have the skills to port my project over to BMX NG. As the freeimage module isn't a vital component of my app, I can live without it.

I also hope that Brucey is up and well.