首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用make构建诺基亚HEIF库

无法使用make构建诺基亚HEIF库
EN

Stack Overflow用户
提问于 2020-01-21 17:56:03
回答 1查看 95关注 0票数 0

我正在尝试用https://github.com/nokiatech/heif构建HEIF库,但是没有成功。

我已经安装了CMake和最新版本的MinGW。我正在按照步骤来构建这个库,但是我得到了一个错误。

第一步,是这样的:

代码语言:javascript
复制
cd heif/build
cmake --help
cmake ../srcs -G"<Generator listed by above command for your target platform>"

工作,但第二步,这是:

代码语言:javascript
复制
cmake --build .

似乎正在工作,但当它完成了41%时,我得到了这个错误:

代码语言:javascript
复制
C:\Users\dantelo\Documents\heif-master\srcs\reader\heifstreamfile.cpp: In constructor 'HEIF::FileStream::FileStream(const char*)':
C:\Users\dantelo\Documents\heif-master\srcs\reader\heifstreamfile.cpp:44:9: error: 'fopen_s' was not declared in this scope
     fopen_s(&m_file, filename, "rb");
     ^~~~~~~
C:\Users\dantelo\Documents\heif-master\srcs\reader\heifstreamfile.cpp:44:9: note: suggested alternative: 'fopen'
     fopen_s(&m_file, filename, "rb");
     ^~~~~~~
     fopen
reader\CMakeFiles\heif_static.dir\build.make:93: recipe for target 'reader/CMakeFiles/heif_static.dir/heifstreamfile.cpp.obj' failed
mingw32-make.exe[2]: *** [reader/CMakeFiles/heif_static.dir/heifstreamfile.cpp.obj] Error 1
mingw32-make.exe[2]: Leaving directory 'C:/Users/dantelo/Documents/heif-master/build'
CMakeFiles\Makefile2:233: recipe for target 'reader/CMakeFiles/heif_static.dir/all' failed
mingw32-make.exe[1]: *** [reader/CMakeFiles/heif_static.dir/all] Error 2
mingw32-make.exe[1]: Leaving directory 'C:/Users/dantelo/Documents/heif-master/build'
Makefile:85: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2

我用的是Windows10,以防万一。我不知道为什么会发生这种事。感谢您的任何帮助

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-01-21 19:31:49

fopen_s似乎只存在于微软提供的C库中,即在MSVC中。来源:Is there a way to use fopen_s() with GCC or at least create a #define about it?

你最好的选择就是切换到MSVC,因为你的代码显然从来没有用MinGW测试过,因为它不能被后者编译。

或者,如果你觉得幸运,你可以使用一些#define技巧将fopen_s转换成标准的fopen (参见链接问题中的答案),并希望这是代码中唯一的不兼容。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59838467

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档