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

[qt5-imageformats] build failure #10338

Closed
longhuan2018 opened this issue Mar 7, 2020 · 5 comments · Fixed by #10644
Closed

[qt5-imageformats] build failure #10338

longhuan2018 opened this issue Mar 7, 2020 · 5 comments · Fixed by #10644
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@longhuan2018
Copy link
Contributor

Host Environment

  • OS: windows 10
  • Compiler: vs2017

To Reproduce
Steps to reproduce the behavior:
./vcpkg install qt5[latest]:x64-windows

Failure logs

qwebphandler.obj : error LNK2019: unresolved external symbol WebPNewInternal referenced in function WebPMuxNew
qwebphandler.obj : error LNK2019: unresolved external symbol WebPMuxDelete referenced in function "public: virtual bool __cdecl QWebpHandler::write(class QImage const &)" (?write@QWebpHandler@@UEAA_NAEBVQImage@@@Z)
qwebphandler.obj : error LNK2019: unresolved external symbol WebPMuxSetChunk referenced in function "public: virtual bool __cdecl QWebpHandler::write(class QImage const &)" (?write@QWebpHandler@@UEAA_NAEBVQImage@@@Z)
qwebphandler.obj : error LNK2019: unresolved external symbol WebPMuxSetImage referenced in function "public: virtual bool __cdecl QWebpHandler::write(class QImage const &)" (?write@QWebpHandler@@UEAA_NAEBVQImage@@@Z)
qwebphandler.obj : error LNK2019: unresolved external symbol WebPMuxAssemble referenced in function "public: virtual bool __cdecl QWebpHandler::write(class QImage const &)" (?write@QWebpHandler@@UEAA_NAEBVQImage@@@Z)
..\..\..\..\plugins\imageformats\qwebpd.dll : fatal error LNK1120: 5 unresolved externals
@longhuan2018 longhuan2018 added the category:port-bug The issue is with a library, which is something the port should already support label Mar 7, 2020
@longhuan2018
Copy link
Contributor Author

I found that after compiling libwebp, 4 library files will be generated, namely webp.lib, webpdemux.lib, webpdecoder.lib, libwebpmux.lib, and the WebPNewInternal method is in the libwebpmux.lib library file.
But in the portfile.cmake file of qt5-imageformats, only webp and webpdemux are referenced.

find_library(WEBP_RELEASE NAMES webp PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) 
find_library(WEBP_DEBUG NAMES webpd webp PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(WEBPDEMUX_RELEASE NAMES webpdemux PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) 
find_library(WEBPDEMUX_DEBUG NAMES webpdemuxd webpdemux PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
# Depends on opengl in default build but might depend on giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows) 
# which would require extra libraries to be linked e.g. giflib freeglut sdl1 other ones are already linked

#Dependent libraries
find_library(LZMA_RELEASE lzma PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(LZMA_DEBUG lzmad lzma PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

set(OPT_REL "TIFF_LIBS=${TIFF_RELEASE} ${LZMA_RELEASE}"
            "WEBP_LIBS=${WEBP_RELEASE} ${WEBPDEMUX_RELEASE}" 
            "JASPER_LIBS=${JASPER_RELEASE} ${FREEGLUT_RELEASE}") # This will still fail if LIBWEBP is installed with all available features due to the missing additional dependencies
set(OPT_DBG "TIFF_LIBS=${TIFF_DEBUG} ${LZMA_DEBUG}"
            "WEBP_LIBS=${WEBP_DEBUG} ${WEBPDEMUX_DEBUG}"
            "JASPER_LIBS=${JASPER_DEBUG} ${FREEGLUT_DEBUG}")

I think this is the cause of the problem,When I added a reference to the libwebpmux library, the problem was resolved

find_library(WEBP_RELEASE NAMES webp PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) 
find_library(WEBP_DEBUG NAMES webpd webp PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(WEBPDEMUX_RELEASE NAMES webpdemux PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) 
find_library(WEBPDEMUX_DEBUG NAMES webpdemuxd webpdemux PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(WEBP_MUX_RELEASE NAMES libwebpmux PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) 
find_library(WEBP_MUX_DEBUG NAMES libwebpmuxd libwebpmux PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
# Depends on opengl in default build but might depend on giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows) 
# which would require extra libraries to be linked e.g. giflib freeglut sdl1 other ones are already linked

#Dependent libraries
find_library(LZMA_RELEASE lzma PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(LZMA_DEBUG lzmad lzma PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

set(OPT_REL "TIFF_LIBS=${TIFF_RELEASE} ${LZMA_RELEASE}"
            "WEBP_LIBS=${WEBP_RELEASE} ${WEBPDEMUX_RELEASE} ${WEBP_MUX_RELEASE}" 
            "JASPER_LIBS=${JASPER_RELEASE} ${FREEGLUT_RELEASE}") # This will still fail if LIBWEBP is installed with all available features due to the missing additional dependencies
set(OPT_DBG "TIFF_LIBS=${TIFF_DEBUG} ${LZMA_DEBUG}"
            "WEBP_LIBS=${WEBP_DEBUG} ${WEBPDEMUX_DEBUG} ${WEBP_MUX_DEBUG}"
            "JASPER_LIBS=${JASPER_DEBUG} ${FREEGLUT_DEBUG}")
qt_submodule_installation(BUILD_OPTIONS ${CORE_OPTIONS} BUILD_OPTIONS_RELEASE ${OPT_REL} BUILD_OPTIONS_DEBUG ${OPT_DBG})

@JackBoosY
Copy link
Contributor

@Neumann-A Could you please have a look?

Thanks.

@Neumann-A
Copy link
Contributor

@JackBoosY: This is already fixed in #10009

@longhuan2018
Copy link
Contributor Author

Ok, then i will close this issue

@JackBoosY
Copy link
Contributor

Please keep this issue open before #10009 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants