Closed sspring closed 7 years ago
I haven't tried it in VS2013, but I know I built it recently in VS2015 with no problem. Have you already tried doing a clean build?
I did find one issue with the include path, which is fixed now. I don't believe it is related to the error you are seeing, but please pull down the latest sources and try again with a clean build and let me know how it goes.
The first problem goes below: Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation. All rights reserved.
cl /I. /Izlib-1.2.3\ /I..\lib /I..\include\afflib /I..\lzma443\C /I..\lzma443\C\7zip\Compress\LZMA_Alone /Iexpat-2.0.1\lib /I"C:\Program Files\Microsoft SDKs\Windows\v6.1"/Include /IC:\OpenSSL/Include /DWIN32 /DWIN32_NT /DMSC /D_CRT_SECURE_NO_DEPRECATE /DHAVE_CONFIG_WINDOWS_H /DHAVE_LIBCRYPTO /DHAVE_OPENSSL_EVP_H /DHAVE_WINDOWS_API/DHAVE_MEMMOVE /c /nologo /EHsc /RTC1 /RTCs /W2 /MT /O2 /D NDEBUG /Fp"afflib.pch" /Fo..\lib\aff_db.obj /c ..\lib\aff_db.cpp
cl : Command line error D8016 : '/RTC1' and '/O2' command-line options are incompatible NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.
I remove the /O2 option and run make.bat again. I face the second problem:
......balabala......... cl /I. /Izlib-1.2.3\ /I..\lib /I..\include\afflib /I..\lzma443\C /I..\lzma443\C\7zip\Compress\LZMA_Alone /Iexpat-2.0.1\lib /I"C:\Program Files\Microsoft SDKs\Windows\v6.1"/Include /IC:\OpenSSL/Include /DWIN32 /DWIN32_NT /DMSC /D_CRT_SECURE_NO_DEPRECATE /DHAVE_CONFIG_WINDOWS_H /DHAVE_LIBCRYPTO /DHAVE_OPENSSL_EVP_H /DHAVE_WINDOWS_API/DHAVE_MEMMOVE /c /nologo /EHsc /RTC1 /RTCs /W2 /MT /D NDEBUG /Fp"afflib.pch" /Fo..\lzma443\C\Common\Vector.obj /c ..\lzma443\C\Common\Vector.cpp Vector.cpp NMAKE : fatal error U1073: don't know how to make 'getopt.obj' Stop
ok,now I don't know how to solve this.
For the first problem, you'll want to remove /RTC1 (and /RTCs). Also, I went ahead and checked in a fix for that: 7fb1dda1cc27b093d222400122fd3041a2add9ca.
For the second problem, what happens if you just remove the getopt.obj from line 141 (of afflib.mak), so the line just reads like this:?
WIN32_OBJS =
I build afflib.lib with no error in the end if I throw the getopt.obj away. Another question is coming.Actually,I need to build afflib in MD(not MT) compile mode.so how can I get dll and lib file except I change the MT to MD from line 17(of afflib.mak).so the line would be like this: COMPILER_MODE = /MD /O2 /D NDEBUG
Add: I build with the command like this: make.bat afflib.lib
Sounds good. Yeah, I found my build scripts from when I was building it, and I too had always removed the getopt.obj.
The actual library, afflib.lib, doesn't need getopt, but I think the tools do.
I've never built the tools on Windows, but I think to do that you would just need to find an implementation of getopt for Windows (e.g., like this one maybe? https://github.com/Chunde/getopt-for-windows), and place getopt.h and getopt.c in the win32 folder.
But, hopefully like me you only need to build the actual library.
Yeah, to build in MD mode, just change /MT to /MD on that COMPILER_MODE line.
But that won't change it to a dll instead of a static library. You'll still get a static library. The /MT and /MD flags don't change a project from a static library to a dll. They change whether or not it uses Visual Studio run-time dlls or not.
afflib is not designed to build as a dll on Windows
Tell you the truth,I have been troubled of building afflib for almost one week. Thanks for your patience! Tip: I think it would be better if you can make a commit that put getopt.h and getopt.cpp into win32 directory.(I will come back if I have problem.)
You're welcome. Let me know if you have any more problems.
I will consider putting getopt.h and getopt.cpp into the win32 folder, but I may not be able to due to incompatible license.
Please update documents on compiling on win32 platform.I have tried to use vs2013 or mingw32(native compiler).But I get an error below when I link afflib.a: libafflib.a(crypto.o) : fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x15. Do you know the reason?