openjpeg icon indicating copy to clipboard operation
openjpeg copied to clipboard

Error in building under Mingw32-make

Open pcouderc12 opened this issue 2 years ago • 2 comments

Expected behavior and actual behavior.

Expected correct buidl for static lib, but get the error below ;

Steps to reproduce the problem.

`

under W10 ; cmake .. -G "MinGW Makefiles"

Modify (only): BUILD_SHARED_LIBS:BOOL=OFF CMAKE_BUILD_TYPE:STRING=Release

Then : :\dependencies\openjpeg\build>cmake .. CMake Deprecation Warning at CMakeLists.txt:10 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Z lib not found, activate BUILD_THIRDPARTY if you want build it (necessary to build libPNG) -- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) -- TIFF lib not found, activate BUILD_THIRDPARTY if you want build it -- Could NOT find LCMS2 (missing: LCMS2_LIBRARY LCMS2_INCLUDE_DIR) -- Could NOT find LCMS (missing: LCMS_LIBRARY LCMS_INCLUDE_DIR) -- LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it -- Configuring done -- Generating done -- Build files have been written to: D:/dependencies/openjpeg/build

D:\dependencies\openjpeg\build>mingw32-make Consolidate compiler generated dependencies of target openjp2 mingw32-make[2]: stat: bin/libopenjp2.a: Invalid argument [ 2%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/thread.c.obj [ 4%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/bio.c.obj [ 6%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/cio.c.obj [ 9%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/dwt.c.obj [ 11%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/event.c.obj [ 13%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/image.c.obj [ 16%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/invert.c.obj [ 18%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/j2k.c.obj [ 20%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/jp2.c.obj [ 23%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/mct.c.obj [ 25%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/mqc.c.obj [ 27%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/openjpeg.c.obj In file included from D:\dependencies\openjpeg\src\lib\openjp2\openjpeg.c:38:0: D:\dependencies\openjpeg\src\lib\openjp2\openjpeg.c: In function 'opj_skip_from_file': D:\dependencies\openjpeg\src\lib\openjp2\openjpeg.c:117:32: warning: conversion to 'long int' from 'OPJ_OFF_T {aka long long int}' may alter its value [-Wconversion] if (OPJ_FSEEK(p_user_data, p_nb_bytes, SEEK_CUR)) { ^ D:\dependencies\openjpeg\src\lib\openjp2\opj_includes.h:85:56: note: in definition of macro 'OPJ_FSEEK' define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence) ^~~~~~ D:\dependencies\openjpeg\src\lib\openjp2\openjpeg.c: In function 'opj_seek_from_file': D:\dependencies\openjpeg\src\lib\openjp2\openjpeg.c:126:32: warning: conversion to 'long int' from 'OPJ_OFF_T {aka long long int}' may alter its value [-Wconversion] if (OPJ_FSEEK(p_user_data, p_nb_bytes, SEEK_SET)) { ^ D:\dependencies\openjpeg\src\lib\openjp2\opj_includes.h:85:56: note: in definition of macro 'OPJ_FSEEK' define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence) ^~~~~~ [ 30%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/opj_clock.c.obj [ 32%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/pi.c.obj [ 34%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/t1.c.obj [ 39%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/tcd.c.obj [ 41%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/tgt.c.obj [ 44%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/function_list.c.obj [ 46%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/opj_malloc.c.obj [ 48%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/sparse_array.c.obj [ 51%] Linking C static library ......\bin\libopenjp2.a D:\MinGW\bin\ranlib.exe: Warning: could not locate '......\bin\libopenjp2.a'. reason: Invalid argument src\lib\openjp2\CMakeFiles\openjp2.dir\build.make:436: recipe for target 'bin/libopenjp2.a' failed mingw32-make[2]: *** [bin/libopenjp2.a] Error 1 CMakeFiles\Makefile2:220: recipe for target 'src/lib/openjp2/CMakeFiles/openjp2.dir/all' failed mingw32-make[1]: *** [src/lib/openjp2/CMakeFiles/openjp2.dir/all] Error 2 Makefile:154: recipe for target 'all' failed mingw32-make: *** [all] Error 2

D:\dependencies\openjpeg\build> `

Operating system

W10

openjpeg version

V2.4.0

pcouderc12 avatar Mar 22 '22 08:03 pcouderc12

What compiler toolchain are you using? openjpeg can be compiled without any error in msys2/mingw-w64 toolchain. See the build command here https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-openjpeg2/PKGBUILD

Biswa96 avatar May 15 '22 13:05 Biswa96

I have tried to compile using mingw32 toolcahin. But maybe the solution is to use msys2/mingw-w64 toolchain to compile for mingw32 architecture ?

pcouderc12 avatar Jun 16 '22 09:06 pcouderc12