<div>hi, the project wants to link the dll named hello.dll, and it has a <font color="#1122cc">import library </font><font color="#1122cc">named hello.lib.</font></div><div>but when i do the Nmake command, it meet the fatal error,who can tell me what's wrong with it.</div>
<div>thanks a lot!</div><div> </div><div>my CMakeLists.txt in Project Dir:</div><div> </div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)<br>PROJECT(ANEWHELLO)<br>ADD_SUBDIRECTORY(src)</div><div> </div><div> CMakeLists.txt in src Dir:</div>
<div>INCLUDE_DIRECTORIES(../../hellouselib/lib)<br>LINK_DIRECTORIES($ANEWHELLO/lib)<br>ADD_EXECUTABLE(anewhello main.cpp)<br>TARGET_LINK_LIBRARIES(anewhello hello)</div><div> </div><div>here is the cmake output:</div><div>
__________________________________________________________________________________</div><div> </div><div>D:\Work\Projectcode\Cmake_example\anewhello\build>cmake -G "NMake Makefiles" ..</div><div> </div><div>CMake Warning (dev) at src/CMakeLists.txt:2 (LINK_DIRECTORIES):<br>
This command specifies the relative path</div><div> ../../hellouselib/build/lib</div><div> as a link directory.</div><div> Policy CMP0015 is not set: link_directories() treats paths relative to the<br> source dir. Run "cmake --help-policy CMP0015" for policy details. Use the<br>
cmake_policy command to set the policy and suppress this warning.<br>This warning is for project developers. Use -Wno-dev to suppress it.</div><div>-- Configuring done<br>-- Generating done<br>-- Build files have been written to: D:/Work/Projectcode/Cmake_example/anewhello<br>
/build</div><div>D:\Work\Projectcode\Cmake_example\anewhello\build>cmake -G "NMake Makefiles" ..<br>CMake Warning (dev) at src/CMakeLists.txt:2 (LINK_DIRECTORIES):<br> This command specifies the relative path</div>
<div> $ANEWHELLO/lib</div><div> as a link directory.</div><div> Policy CMP0015 is not set: link_directories() treats paths relative to the<br> source dir. Run "cmake --help-policy CMP0015" for policy details. Use the<br>
cmake_policy command to set the policy and suppress this warning.<br>This warning is for project developers. Use -Wno-dev to suppress it.</div><div>-- Configuring done<br>-- Generating done<br>-- Build files have been written to: D:/Work/Projectcode/Cmake_example/anewhello<br>
/build</div><div> </div><div>here is the Nmake output:</div><div> </div><div>Linking CXX executable anewhello.exe<br>LINK : fatal error LNK1104: 无法打开文件“hello.lib”<br>LINK Pass 1 failed. with 2<br>NMAKE : fatal error U1077: “"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe"”:<br>
return code “0xffffffff”<br>Stop.<br>NMAKE : fatal error U1077: “"d:\Program Files (x86)\Microsoft Visual Studio 9.0<br>\VC\BIN\nmake.exe"”: return code “0x2”<br>Stop.<br>NMAKE : fatal error U1077: “"d:\Program Files (x86)\Microsoft Visual Studio 9.0<br>
\VC\BIN\nmake.exe"”: return code “0x2”<br>Stop.</div><div> </div><div> </div>