Answer the question
In order to leave comments, you need to log in
Why don't MinGW and VS17 want to link detours.lib?
Hello. I'm trying to detour the function according to the guide, here's the code: *click github* . Actually, everything is fine, besides the fact that neither VS2017 nor the project with CMake + MinGW give the following errors:
D:/Detour-master/dll/dllmain.cpp:46: undefined reference to `DetourTransactionBegin'
cmake_minimum_required(VERSION 3.9)
project(dll)
find_library(psapi "D:/ProgrammingNew/Win-builds/mingw/lib/libpsapi.a")
find_library(detours "D:/Detour-master/dll/detours.lib") # <------------------------ вот
set(CMAKE_CXX_FLAGS "-fpermissive -w")
set(CMAKE_CXX_STANDARD 17)
add_library(dll SHARED
sigscan.h
dllmain.cpp
)
target_link_libraries(dll psapi)
#target_link_libraries(dll detours) # <------------------------ вот два
d:/programmingnew/win-builds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldetours
d:/programmingnew/win-builds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible D:/Detour-master/dll/detours.lib when searching for -ldetours
d:/programmingnew/win-builds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible D:/Detour-master/dll/detours.lib when searching for -ldetours
d:/programmingnew/win-builds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible D:/Detour-master/dll\detours.lib when searching for -ldetours
d:/programmingnew/win-builds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldetours
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question