Fatal error C1047 in release only
My project is using Visual Studio 2012 and I am using libfftw-3.3.lib as coming from my page. When I build my project in debug it links and compiles very well and I end up with a working application. When I set it to release mode, the linker gives me the following error:
2>LINK : fatal error C1047: The object or library file '../IncludeLibs/libfftw-3.3-x86.lib' was created with an older compiler than other objects; rebuild old objects and libraries
2>LINK : fatal error LNK1257: code generation failed
When I set my project to .lib output, even in release mode, it works, but not as a .dll or .exe
Any idea what's going on, or what I can do to fix this issue?
Edit: my linker settings, debug:
/OUT:"G:\GlukoseScanner\GlucoseScanner\Debug\MachineLearning.exe" /MANIFEST /NXCOMPAT /PDB:"G:\GlukoseScanner\GlucoseScanner\Debug\MachineLearning.pdb" /DYNAMICBASE "../debug/GlucoseDLL.lib" "shlwapi.lib" "../PicoScope/ps5000a.lib" "../C/cbw32.lib" "../DSO2250_SDK/Lib/SDK2250DLL.lib" "../IncludeLibs/libfftw-3.3-x86.lib" "../IncludeLibs/libfftwf-3.3-x86.lib" "mlpack.lib" "winmm.lib" "opengl32.lib" "glu32.lib" "..\..\armadillo-4.400.1\build\Release\armadillo.lib" "..\..\armadillo-4.400.1\examples\lib_win32\libblas.lib" "..\..\armadillo-4.400.1\examples\lib_win32\liblapack.lib" "..\libxml2\libxml2-2.7.8.win32\lib\libxml2.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /INCREMENTAL /PGD:"G:\GlukoseScanner\GlucoseScanner\Debug\MachineLearning.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Debug\MachineLearning.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
Release links:
/OUT:"G:\GlukoseScanner\GlucoseScanner\Release\MachineLearning.exe" /MANIFEST /LTCG /NXCOMPAT /PDB:"G:\GlukoseScanner\GlucoseScanner\Release\MachineLearning.pdb" /DYNAMICBASE "../release/GlucoseDLL.lib" "shlwapi.lib" "../PicoScope/ps5000a.lib" "../C/cbw32.lib" "../DSO2250_SDK/Lib/SDK2250DLL.lib" "../IncludeLibs/libfftw-3.3-x86.lib" "../IncludeLibs/libfftwf-3.3-x86.lib" "mlpack.lib" "winmm.lib" "opengl32.lib" "glu32.lib" "..\..\armadillo-4.400.1\build\Release\armadillo.lib" "..\..\armadillo-4.400.1\examples\lib_win32\libblas.lib" "..\..\armadillo-4.400.1\examples\lib_win32\liblapack.lib" "..\libxml2\libxml2-2.7.8.win32\lib\libxml2.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"G:\GlukoseScanner\GlucoseScanner\Release\MachineLearning.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\MachineLearning.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
source to share
Any idea what's going on?
Yes:
The object or library file "../IncludeLibs/libfftw-3.3-x86.lib" was created using an older compiler than other objects
What can I do to fix this problem?
You can:
restore old objects and libraries
It looks like the debug build is linked to different library versions than release. The easiest way would be to download the source code for the library you are using and build it with the same build system that you use to build your project.
It rarely happens that you have to download binaries and try to link them. You will run into all the problems if they were not compiled with the same settings and a compatible compiler / linker like the one re trying to use.
source to share