You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have a problem trying to compile OpenCascade according to your instructions here. The only difference is that I use MinGW installed with Qt. The compilation stops with this error
[ 5%] Building C object oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir
/__/libs/FreeImage/Source/LibJXR/image/sys/strcodec.c.obj
d:/oce/oce-win-bundle/libs/FreeImage/Source/LibJXR/image/sys/strcodec.c:674:5: error: conflicting types for '_byteswap_ulong' U32 _byteswap_ulong(U32 bits)
In file included from d:/oce/oce-win-bundle/libs/FreeImage/Source/LibJXR/image/sys/windowsmediaphoto.h:35:0,
from d:/oce/oce-win-bundle/libs/FreeImage/Source/LibJXR/image/sys/strcodec.h:35,
from d:/oce/oce-win-bundle/libs/FreeImage/Source/LibJXR/image/sys/strcodec.c:28:
d:/Programs/Qt/Qt5.5.0/Tools/mingw492_32/i686-w64-mingw32/include/stdlib.h:356:25: note: previous declaration of '_byteswap_ulong' was here
unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
^
oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/build.make:9238: recipe
for target `oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/Free
Image/Source/LibJXR/image/sys/strcodec.c.obj' failed
make[2]: *** [oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/Fr
eeImage/Source/LibJXR/image/sys/strcodec.c.obj] Error 1
CMakeFiles/Makefile2:1149: recipe for target 'oce-win-bundle/FreeImage.cmake/CMa
keFiles/FreeImage.dir/all' failed
make[1]: *** [oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/all] Error
2
Makefile:160: recipe for target `all' failed
make: *** [all] Error 2
Everything completes successfully if I don't specify FreeImage dependency with cmake, but I need this library. Could you help me to solve this problem?
The text was updated successfully, but these errors were encountered:
I have found the conflicting _byteswap_ulong in D:\oce\oce-win-bundle\libs\FreeImage\Source\LibJXR\image\sys\strcodec.c and just commented its definition. This action helped me to compile the code with FreeImage.
Maybe there is some bug in preprocessor checks? Here is the code
//================================================================
// Memory access functions
//================================================================
#if (defined(WIN32) && !defined(UNDER_CE) && (!defined(__MINGW32__) || defined(__MINGW64_TOOLCHAIN__) || defined(__MINGW64__))) || (defined(UNDER_CE) && defined(_ARM_))
// WinCE ARM and Desktop x86
#else
// other platform
#ifdef _BIG__ENDIAN_
#define _byteswap_ulong(x) (x)
#else // _BIG__ENDIAN_
U32 _byteswap_ulong(U32 bits)
{
U32 r = (bits & 0xffu) << 24;
r |= (bits << 8) & 0xff0000u;
r |= ((bits >> 8) & 0xff00u);
r |= ((bits >> 24) & 0xffu);
return r;
}
#endif // _BIG__ENDIAN_
#endif
Hello! I have a problem trying to compile OpenCascade according to your instructions here. The only difference is that I use MinGW installed with Qt. The compilation stops with this error
Everything completes successfully if I don't specify FreeImage dependency with cmake, but I need this library. Could you help me to solve this problem?
The text was updated successfully, but these errors were encountered: