jmeubank / tdm-gcc

TDM-GCC is a cleverly disguised GCC compiler for Windows!
https://jmeubank.github.io/tdm-gcc/
587 stars 50 forks source link

compiling FreeImage #15

Open sonoro1234 opened 4 years ago

sonoro1234 commented 4 years ago

Hi,

Downloaded tdm64-gcc-9.2.0.exe and installed. Trying to compile FreeImage I am getting this error

[  0%] Building CXX object CMakeFiles/FreeImage.dir/Source/FreeImage/FreeImage.cpp.obj
In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/windows.h:9,
                 from C:\LuaGL\gitsources\FreeImageORIG\Source\FreeImage\FreeImage.cpp:28:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/unknwnbase.h: In member function 'HRESULT IUnknown::QueryInterface(Q**)':
C:/TDM-GCC-64/x86_64-w64-mingw32/include/unknwnbase.h:84:29: error: '__mingw_uuidof' was not declared in this scope; did
 you mean '__mingw_wcstof'?
   84 |       return QueryInterface(__uuidof(Q), (void **)pp);
      |                             ^~~~~~~~

Is there something I can do to solve it?

Thanks Victor Bombi

jmeubank commented 3 years ago

https://github.com/jmeubank/mingw-w64/blob/master/mingw-w64-headers/crt/_mingw.h.in#L560

sonoro1234 commented 3 years ago

with mingw32-make VERBOSE=1 the command line shown is

C:\TDM-GCC-64\bin\g++.exe  -DDISABLE_PERF_MEASUREMENT -DFreeImage_EXPORTS -DNO_LCMS -DOPJ_STATIC -DWINVER=0x0500 -D__ANSI__ @CMakeFiles/FreeImage.dir/includes_CXX.rsp -O2 -g -DNDEBUG   -std=gnu++98 -o CMakeFiles\FreeImage.dir\Source\FreeImage\FreeImage.cpp.obj -c C:\LuaGL\gitsources\FreeImageORIG\Source\FreeImage\FreeImage.cpp

adding -save-temps to the command line FreeImage.ii is generated (.txt added for uploading)

FreeImage.ii.txt

* Is `__cplusplus` defined?

I cant be sure, but I guess it is, because a cpp file is compiled by g++.exe?

sonoro1234 commented 3 years ago

I have tried with just released tdm-gcc I have checked that __cplusplus is defined modifying the source with

#if defined(__cplusplus)
#warning "__cplusplus is defined"
#else
#warning "__cplusplus is NOT defined"
#endif