Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build using MinGW #114

Closed
kmilos opened this issue Jan 4, 2024 · 3 comments
Closed

Unable to build using MinGW #114

kmilos opened this issue Jan 4, 2024 · 3 comments

Comments

@kmilos
Copy link

kmilos commented Jan 4, 2024

This is w/ 0.9.0 tarball.

Even w/ considerable CMakeLists.txt changes to enable MinGW build (e.g. WIN32 is misused as it covers not only MSVC, and a few others, shared in #94 (comment)), the final linking step of ojph_expand and ojph_compress fail w/

[34/35] Linking CXX executable ojph_expand.exe
FAILED: ojph_expand.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\ucrt64\bin\g++.exe -march=nocona -msahf -mtune=generic -O2 -pipe -fexceptions -Wall -Wextra -Wconversion -Wunused-parameter -DOJPH_ENABLE_TIFF_SUPPORT -O3 -DNDEBUG -pipe CMakeFiles/ojph_expand.dir/src/apps/ojph_expand/ojph_expand.cpp.obj CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io_sse41.cpp.obj CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io_avx2.cpp.obj -o ojph_expand.exe -Wl,--out-implib,libojph_expand.dll.a -Wl,--major-image-version,0,--minor-image-version,0  libopenjph.dll.a  C:/msys64/ucrt64/lib/libtiff.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/ojph_expand/ojph_expand.cpp.obj:ojph_expand.cp:(.rdata$.refptr._ZTVN4ojph10j2c_infileE[.refptr._ZTVN4ojph10j2c_infileE]+0x0): undefined reference to `vtable for ojph::j2c_infile'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x261e): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x262c): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x26bf): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x26e2): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x2724): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_expand.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x272e): more undefined references to `ojph::get_cpu_ext_level()' follow
collect2.exe: error: ld returned 1 exit status
[35/35] Linking CXX executable ojph_compress.exe
FAILED: ojph_compress.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\ucrt64\bin\g++.exe -march=nocona -msahf -mtune=generic -O2 -pipe -fexceptions -Wall -Wextra -Wconversion -Wunused-parameter -DOJPH_ENABLE_TIFF_SUPPORT -O3 -DNDEBUG -pipe CMakeFiles/ojph_compress.dir/src/apps/ojph_compress/ojph_compress.cpp.obj CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io_sse41.cpp.obj CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io_avx2.cpp.obj -o ojph_compress.exe -Wl,--out-implib,libojph_compress.dll.a -Wl,--major-image-version,0,--minor-image-version,0  libopenjph.dll.a  C:/msys64/ucrt64/lib/libtiff.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/ojph_compress/ojph_compress.cpp.obj:ojph_compress.:(.rdata$.refptr._ZTVN4ojph11j2c_outfileE[.refptr._ZTVN4ojph11j2c_outfileE]+0x0): undefined reference to `vtable for ojph::j2c_outfile'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x261e): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x262c): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x26bf): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x26e2): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x2724): undefined reference to `ojph::get_cpu_ext_level()'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ojph_compress.dir/src/apps/others/ojph_img_io.cpp.obj:ojph_img_io.cp:(.text+0x272e): more undefined references to `ojph::get_cpu_ext_level()' follow
collect2.exe: error: ld returned 1 exit status

This points to missing exported symbols.

@kmilos
Copy link
Author

kmilos commented Jan 4, 2024

The last errors relating to get_cpu_ext_level() might be already resolved in master by e4bfbf8, but I think the missing export of classes j2c_infile and j2c_infile is still relevant (i.e. entire class instated of selected members)?

@aous72
Copy link
Owner

aous72 commented Jan 4, 2024

I think the missing export of classes j2c_infile and j2c_infile is still relevant (i.e. entire class instated of selected members)

Thank you for highlighting this -- I did not know about it.

Kind regards,
Aous.

@kmilos
Copy link
Author

kmilos commented Jan 8, 2024

0.10.1 builds and links for me now, thanks!

@kmilos kmilos closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants