I've got the following file tree:
C:.
│ CMakeLists.txt
│ myLibraryHeader.h
│ test.c
│
└───myLib
├───win32
│ myLibrary.a
│
└───win64
myLibrary.a
And the following CMake file:
cmake_minimum_required(VERSION 2.8)
project(myProject)
link_directories(myLib/win32)
add_executable(main test.c)
target_link_libraries(main myLib/win32/myLibrary.a)
myLibraryHeader.h
is the header, while the implementation is in the .a
files.
test.c
uses functions declared in myLibraryHeader.h
.
However, when I try to compile it using VS2013 compiler, I get this error:
Error 1 error LNK1104: cannot open file 'myLibrary.lib'
What is the reason that VS is looking for a .lib file instead of .a file?
How can it be fixed?