I have been trying to run the IUP graphic examples given under this link C or CPP examples
such as plot.C or mathglsamples.c under the MinGW X64 windows environment straight out of the source code adaption without modification per se. However the documentation is so poor that I ran into wall. After repeated attempts I finally get it going with IUP , CD and IM core dynamic library .
I am now happily sharing my successful configuration for standalone exe file to benefit and help those to avoid facing frustration and error as there are no explicit library requirements currently shared in the website.
It would be much easier to run this on the netbeans IDE just specify all those header files and library required .
Below is the Cmake , just have to ensure all those .dll library are copy into the same output folder where exe files are located .
# cmake_minimum_required(VERSION <specify CMake version here>)
cmake_minimum_required(VERSION 3.10)
project(IUP)
#set (CMAKE_LEGACY_CYGWIN_WIN32 0)
set(CMAKE_CXX_STANDARD 17)
set(IUPDir "C:/iup-3.24_Win64_dllw4_lib")
set(CDDir "C:/cd-5.11.1_Win64_dllw4_lib")
set (IMDir "C:/im-3.12_Win64_dllw4_lib")
include_directories(${IUPDir})
include_directories(${IUPDir}/include)
include_directories(CDDir)
include_directories(${CDDir}/include)
include_directories(${IMDir}/include)
link_directories(${IUPDir})
link_directories(${CDDir})
add_executable(IUP mathglsamples.c)
#add_executable(IUP plot.cpp)
find_package(iup.dll)
find_package(iupimglib.dll)
add_custom_command(TARGET IUP POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${IUPDir}/iup.dll"
"${IUPDir}/iupimglib.dll"
"${IUPDir}/iup_plot.dll"
"${IUPDir}/iupcontrols.dll"
"${IUPDir}/iupgl.dll"
"${IUPDir}/iupcd.dll"
"${IUPDir}/ftgl.dll"
"${IUPDir}/iup_mglplot.dll"
"${IUPDir}/iupim.dll"
"${IUPDir}/zlib1.dll"
"${CDDir}/cd.dll"
"${CDDir}/cdgl.dll"
"${CDDir}/freetype6.dll"
"${CDDir}/cdcontextplus.dll"
"${IMDir}/im.dll"
"${IMDir}/im_process.dll"
# <--this is in-file
$<TARGET_FILE_DIR:IUP>
)
target_include_directories(IUP PUBLIC ${IUPDir})
target_include_directories(IUP PUBLIC ${CDDir})
target_include_directories(IUP PUBLIC ${IMDir})
target_link_libraries (IUP PUBLIC
"${IUPDir}/iup.dll"
"${IUPDir}/iupimglib.dll"
"${IUPDir}/iup_plot.dll"
"${IUPDir}/iupcontrols.dll"
"${IUPDir}/iupgl.dll"
"${IUPDir}/iupcd.dll"
"${IUPDir}/ftgl.dll"
"${IUPDir}/iup_mglplot.dll"
"${IUPDir}/iupim.dll"
"${IUPDir}/zlib1.dll"
"${CDDir}/cd.dll"
"${CDDir}/cdgl.dll"
"${CDDir}/freetype6.dll"
"${CDDir}/cdcontextplus.dll"
"${IMDir}/im.dll"
"${IMDir}/im_process.dll"
)
thanks