I'm trying to use libMcrypt as a static lib for windows. My code is already using the dll port for it found here. There does not exists a 'vcproj/solution' for the project so I did not know how to go about to compile it directly using visual studio. ( I was getting abundant errors when I tried to create one and compile)
However, I could cross compile using MingW and get a windows dll which worked fine. I found the instructions here. I then compiled a static lib for the same giving --enable=static as an option to configure. It created a .a and .la file successfully.
But when I'm trying to use the compile lib, I'm getting the following linker errors in my project
libmcrypt.lib(loki97.o) : warning LNK4229: invalid directive '/aligncomm:_prm,5' encountered; ignored
libmcrypt.lib(loki97.o) : warning LNK4229: invalid directive '/aligncomm:_sb2,5' encountered; ignored
libmcrypt.lib(loki97.o) : warning LNK4229: invalid directive '/aligncomm:_sb1,5' encountered; ignored
LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj)
Creating library ..\..\..\bin\myProj.lib and object ..\..\..\bin\myProj.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
libmcrypt.lib(blowfish-compat.o) : error LNK2001: unresolved external symbol ___chkstk_ms
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__is_block_algorithm
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__mcrypt_algorithm_version
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__mcrypt_decrypt
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__mcrypt_encrypt
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__mcrypt_get_algo_iv_size
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__mcrypt_get_algorithms_name
myProj.exp : error LNK2001: unresolved external symbol arcfour_LTX__mcrypt_get_block_size
- From the 1st two errors, I feel it is a CRT mismatch error. How can I give the option to gcc to build static lib without CRT? (I'm not sure if I'm thinking correct)
- Or can I use the .a file, extract obj files and recreate a lib from it?
- Has anyone compile a static lib for libMcrypt on Windows
Thanks a lot for your help!