I can't compile a 32-bit application for Windows XP support

198 views Asked by At

I am trying to compile an app that I want to run on Windows XP.

My code utilizes the Boost library.

I have downloaded the mingw32 toolchain, alongside the i686 version of Boost.

Compiles fine and runs, but when I try to run it on Windows XP, I get an error

the procedure entry point gettickcount64 could not be located kernel32.dll

I have tried searching around, I can't seem to find the solution, or understand what I need to change.

Here is my CMakeLists.txt

set(CMAKE_CXX_STANDARD 11)

set(Boost_LIBRARY_DIRS ${BOOST_ROOT}/libs)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_RELEASE_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_NO_WARN_NEW_VERSIONS ON)
find_package(Boost 1.79.0 REQUIRED COMPONENTS system filesystem)

if (Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
    add_executable(DoJaject main.cpp)
    target_include_directories(DoJaject PUBLIC ${Boost_INCLUDE_DIRS})
    target_link_libraries(DoJaject PRIVATE Boost::filesystem Boost::system)
endif ()

set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -static-libgcc -static-libstdc++")

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")

I use CLion as my editor if that is something that could help

0

There are 0 answers