我已成功使用 CMake。然后我使用 MSYS2 遍历 BUILD 目录并输入make
. 构建进展顺利,但是当它扫描 FreeImage 的依赖项时 - 然后它失败了。
这是我拥有的编译器:
User1@User1-PC MSYS ~
$ gcc --version
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
现在警告 - 错误。make
对于所有抱怨的不同对象,我有一个不同的代码块。最后一个也将包含错误消息。
对象 1:
[ 1%] Building CXX object oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/FreeImage/Source/FreeImage/MultiPage.cpp.obj
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp: In function 'FIMULTIBITMAP* FreeImage_OpenMultiBitmap(FREE_IMAGE_FORMAT, const char*, BOOL, BOOL, BOOL, int)':
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:254:10: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<FreeImageIO> io (new FreeImageIO);
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:265:10: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<FIMULTIBITMAP> bitmap (new FIMULTIBITMAP);
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:266:10: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<MULTIBITMAPHEADER> header (new MULTIBITMAPHEADER);
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:299:11: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<CacheFile> cache_file (new CacheFile(cache_name, keep_cache_in_memory));
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp: In function 'FIMULTIBITMAP* FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT, FreeImageIO*, fi_handle, int)':
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:339:11: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<FIMULTIBITMAP> bitmap (new FIMULTIBITMAP);
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:340:11: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<MULTIBITMAPHEADER> header (new MULTIBITMAPHEADER);
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:341:11: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<FreeImageIO> tmp_io (new FreeImageIO (*io));
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:367:12: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<CacheFile> cache_file (new CacheFile("", TRUE));
^~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:80,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:53,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/CacheFile.h:28,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/MultiPage.cpp:33:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/unique_ptr.h:53:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
对象2:
[ 1%] Building CXX object oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/FreeImage/Source/FreeImage/Plugin.cpp.obj
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/Plugin.cpp: In function 'void FreeImage_Initialise(BOOL)':
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/Plugin.cpp:314:15: warning: 'char* strncat(char*, const char*, size_t)' specified bound 460 equals destination size [-Wstringop-overflow=]
strncat(buffer, find_data.name, MAX_PATH + 200);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
对象 3:
[ 1%] Building CXX object oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/FreeImage/Source/FreeImage/PluginEXR.cpp.obj
In file included from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.h:51,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.h:46,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/PluginEXR.cpp:33:
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:228:34: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
const Vec2 & normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:232:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<T> normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:440:34: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
const Vec3 & normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:444:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<T> normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:622:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
const Vec4 & normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:626:44: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<T> normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:714:30: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:723:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:738:28: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:747:35: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:762:30: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:771:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:786:28: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:795:35: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:809:30: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:818:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:833:28: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:842:35: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:1212:26: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc)
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:1249:33: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec2<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc)
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:1704:26: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc)
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:1743:33: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec3<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc)
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:2109:26: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc)
^~~~~
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/OpenEXR/Imath/ImathVec.h:2150:33: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Vec4<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc)
^~~~~
最终目标和 MAKE 错误:
[ 1%] Building CXX object oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/FreeImage/Source/FreeImage/PluginG3.cpp.obj
In file included from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/LibTIFF4/tiffio.h:258,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/LibTIFF4/tiffiop.h:60,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/PluginG3.cpp:23:
C:/mingw-w64-10.2/mingw64/x86_64-w64-mingw32/include/stdio.h:735:23: error: conflicting declaration of 'int _snprintf(char*, size_t, const char*, ...)' with 'C' linkage
_CRTIMP int __cdecl _snprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
^~~~~~~~~
In file included from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/LibTIFF4/tiffiop.h:33,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/PluginG3.cpp:23:
C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/LibTIFF4/tif_config.h:84:18: note: previous declaration with 'C++' linkage
#define snprintf _snprintf
^~~~~~~~~
In file included from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ext/string_conversions.h:43,
from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/basic_string.h:6361,
from C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/string:52,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/Utilities.h:44,
from C:/Users/User1/Desktop/OPENCAS/oce/oce-win-bundle/libs/FreeImage/Source/FreeImage/PluginG3.cpp:26:
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/cstdio:175:11: error: '::snprintf' has not been declared
using ::snprintf;
^~~~~~~~
C:/mingw-w64-10.2/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/cstdio:185:22: error: '__gnu_cxx::snprintf' has not been declared
using ::__gnu_cxx::snprintf;
^~~~~~~~
make[2]: *** [oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/build.make:1021: oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/__/libs/FreeImage/Source/FreeImage/PluginG3.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:2621: oce-win-bundle/FreeImage.cmake/CMakeFiles/FreeImage.dir/all] Error 2
make: *** [Makefile:182: all] Error 2