[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regarding "libssh-0.6.3 does not compile on Windows": AN WORKAROUND!


 

Folks, 

I was experimenting with libssh and I faced problems trying to compile
it on Windows. 

I am using MSVC compilers and I got the error: 

"CMake Error: CMake can not determine linker language for target:
ssh_threads_shared" 

which didn't allow me to carry on. 

After some investigation, I realized that cmake was able to build all
the necessary solutions/project to compile libssh using MSVC, however a
dependency project (ssh_threads_shared, in my case) was corrupted
(according to MSVC). After comparing the projects which were fine to the
project that was corrupted, I noted that MSVC didn't like to receive a
library project without files to build it. 

I read the CMakeLists,txt under srcthreads and I noted that
set(lib_ssh_SRCS) was empty (due to the facts I am using MSVC and,
therefore, I didn't supply pthreads as and dependency). 

To overcome this "project generation corruption", I added pthread.c file
to lib_ssh_SRCS and, as the file is "protected" with "#ifdef
HAVE_PTHREAD", the solution generated by cmake was correctly open and
build by MSVC. Then, I managed to build and test libssh. 

I hope this workaround could help someone facing a similar problem. 

Best regards, 

Tiago 

 

Archive administrator: postmaster@lists.cynapses.org