Menu

#342 Fix missing DLL error when opening

1.0
closed
nobody
2025-12-06
2025-12-05
DENG GOLD
No

When compiling in dynamic library mode, running the generated .exe file from Frontend results in a missing DLL error. This can be resolved by modifying the frontend/CMakeLists.txt file.

Add the following code

----------------------------------------------------------

if(ZINT_SHARED)

zint.dll

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_BINARY_DIR}/backend/$<config>/zint.dll"
"${CMAKE_BINARY_DIR}/frontend/$<config>/"
) </config></config>

libpng16.dll

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_BINARY_DIR}/backend/lpng/$<config>/libpng16.dll"
"${CMAKE_BINARY_DIR}/frontend/$<config>/"
) </config></config>

zlib.dll

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD

COMMAND ${CMAKE_COMMAND} -E copy

"${CMAKE_BINARY_DIR}/backend/lpng/zlib/$<config>/zlib.dll"</config>

"${CMAKE_BINARY_DIR}/frontend/$<config>/"</config>

)
else()

endif()

-------------------------------------------------------

Since the error that occurred when compiling with PNG was also fixed, libpng16.dll and zlib.dll are not needed.

Discussion

  • Git Lost

    Git Lost - 2025-12-06
    • status: open --> closed
     
  • Git Lost

    Git Lost - 2025-12-06

    Please engage on ticket #341

     
    • DENG GOLD

      DENG GOLD - 2025-12-06

      OK

       

Log in to post a comment.