makefile
main: main.cpp detours/detours.lib
CL /std:c++17 /EHsc /Fe:bin\test /I . /I detours/ /W2 /O2 /LD $** user32.lib
当我遇到错误
LINK : fatal error LNK1181: cannot open input file "bin.obj"
make: *** [Makefile:2: main] Error 2
为什么他要打开bin.obj? Bin是文件夹,CL不会从bin创建obj。 如何解决此问题?
更新,这是makefile中的完整代码。第二行有列表。在这里,我从输出中删除了bin文件夹。
main: main.cpp detours/detours.lib
CL /std:c++17 /EHsc /Fe:test /I . /I detours/ /W2 /O2 /LD $** user32.lib
如果我从makefile的输出中删除bin文件夹,而从目录中删除了bin文件夹,则会收到错误LINK : fatal error LNK1181: cannot open input file "detours.obj"
输出
make -f Makefile
CL /std:c++17 /EHsc /Fe:test /I . /I detours/ /W2 /O2 /LD * user32.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28107 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
Microsoft (R) Incremental Linker Version 14.23.28107.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.dll
/dll
/implib:test.lib
detours
helper.h
main.obj
main.obj
Makefile
packets.h
functions.h
user32.lib
LINK : fatal error LNK1181: cannot open input file 'detours.obj'
make: *** [Makefile:2: main] Error 2