位置: 编程技术 - 正文
推荐整理分享Unsolved bug in fltk-1.1.10/src/filename_list.cxx for scandir --已解决!,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
今天编译fltk-1.1.居然出现error,这个版本我以前在笔记本上装过多次,只有cmake完g以后有一个警告而已,可以正常安装不影响。但是现在为啥这个版本在我这台组装台式机上面就报错,无法安装呢?估计这是个bug,并且已经被他们发现并揪出去了,因为我看最新版1.3.3的源代码里面/usr/local/src/fltk-1.1./src/filename_list.cxx这个函数大变样了。以后有时间的话再去追究一下这个问题的细节...这里只是记录一下这个错误,并未解决它。建议如果你也遇到这个问题,可以直接放弃安装这个版本,直接装新版本的,比如当前最新版fltk-1.3.3-source.tar.gz,没有任何警告和错误。编译环境:gcc-4.8。
错误如下:
[ %] Building CXX object src/CMakeFiles/fltk.dir/filename_isdir.o
[ %] Building CXX object src/CMakeFiles/fltk.dir/filename_list.o
/usr/local/src/fltk-1.1./src/filename_list.cxx: In function ‘int fl_filename_list(const char*, dirent***, int (*)(dirent**, dirent**))’:
/usr/local/src/fltk-1.1./src/filename_list.cxx::: error: invalid conversion from ‘int (*)(const void*, const void*)’ to ‘int (*)(const dirent**, const dirent**)’ [-fpermissive]
int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
^
In file included from /usr/local/src/fltk-1.1./FL/filename.H::0,
from /usr/local/src/fltk-1.1./src/filename_list.cxx::
/usr/include/dirent.h::: error: initializing argument 4 of ‘int scandir(const char*, dirent***, int (*)(const dirent*), int (*)(const dirent**, const dirent**))’ [-fpermissive]
extern int scandir (__const char *__restrict __dir,
^
make[2]: *** [src/CMakeFiles/fltk.dir/filename_list.o] Error 1
make[1]: *** [src/CMakeFiles/fltk.dir/all] Error 2
make: *** [all] Error 2
其它信息备案
=============================
源代码:
fltk-1.1.-source.tar.bz2或者fltk-1.1.-source.tar.gz,下载地址: *ON
BUILD_SHARED_LIBS *OFF
BUILD_TESTING *ON
CMAKE_BACKWARDS_COMPATIBILITY *2.4
CMAKE_BUILD_TYPE *
CMAKE_INSTALL_PREFIX */usr/local/fltk-1.1.
CMAKE_USE_PTHREADS *ON
FLTK_USE_SYSTEM_JPEG *OFF
FLTK_USE_SYSTEM_PNG *OFF
FLTK_USE_SYSTEM_ZLIB *OFF
USE_OPENGL *ON
cmake配置时,c键完成之后,出来g键; 按g键,出来一个警告:
CMake Warning (dev) at png/CMakeLists.txt: (ADD_LIBRARY): Policy CMP should be set before this line. Add code such as
if(COMMAND cmake_policy)
cmake_policy(SET CMP NEW)
endif(COMMAND cmake_policy)
as early as possible but after the most recent call to
cmake_minimum_required or cmake_policy(VERSION). This warning appears because target "fltk_png" links to some libraries for which the linker must search:
-lm
and other libraries with known full path: /usr/local/src/fltk-1.1./bin/libfltk_zlib.a
CMake is adding directories in the second list to the linker search path in case they are needed to find libraries from the first list (for backwards compatibility with CMake 2.4). Set policy CMP to OLD or NEW to enable or disable this behavior explicitly. Run "cmake --help-policy CMP" for more information. This warning is for project developers. Use -Wno-dev to suppress it.
我很确定这个警告不是问题的原因,因为我以前在笔记本上成功编译安装成功过,当时也报这个警告。
============================================================后来=========================
把gcc降级为gcc-4.6后,又重试了安装fltk-1.1.,还是报和之前一样的错误:
[ %] Building CXX object src/CMakeFiles/fltk.dir/filename_ext.o
[ %] Building CXX object src/CMakeFiles/fltk.dir/filename_isdir.o
[ %] Building CXX object src/CMakeFiles/fltk.dir/filename_list.o
/usr/local/src/fltk-1.1./src/filename_list.cxx: In function ‘int fl_filename_list(const char*, dirent***, int (*)(dirent**, dirent**))’:
/usr/local/src/fltk-1.1./src/filename_list.cxx::: error: invalid conversion from ‘int (*)(const void*, const void*)’ to ‘int (*)(const dirent**, const dirent**)’ [-fpermissive]
/usr/include/dirent.h::: error: initializing argument 4 of ‘int scandir(const char*, dirent***, int (*)(const dirent*), int (*)(const dirent**, const dirent**))’ [-fpermissive]
make[2]: *** [src/CMakeFiles/fltk.dir/filename_list.o] Error 1
make[1]: *** [src/CMakeFiles/fltk.dir/all] Error 2
make: *** [all] Error 2
ltu@pangolin:/usr/local/src/fltk-1.1./bin$
查了一会,如这里所说 %] Building CXX object src/CMakeFiles/fltk.dir/filename_isdir.o
[ %] Building CXX object src/CMakeFiles/fltk.dir/filename_list.o
/usr/local/src/fltk-1.1./src/filename_list.cxx: In function ‘int fl_filename_list(const char*, dirent***, int (*)(const dirent**, const dirent**))’:
/usr/local/src/fltk-1.1./src/filename_list.cxx::: error: invalid conversion from ‘int (*)(const void*, const void*)’ to ‘int (*)(const dirent**, const dirent**)’ [-fpermissive]
/usr/include/dirent.h::: error: initializing argument 4 of ‘int scandir(const char*, dirent***, int (*)(const dirent*), int (*)(const dirent**, const dirent**))’ [-fpermissive]
make[2]: *** [src/CMakeFiles/fltk.dir/filename_list.o] Error 1
make[1]: *** [src/CMakeFiles/fltk.dir/all] Error 2
make: *** [all] Error 2
ltu@pangolin:/usr/local/src/fltk-1.1./bin$
该错误未解决!!!
Update: 该错误已解决!fltk-1.1.已成功编译通过。
==========================================================
详细解决方法请点此处!
glGenTextures(GLsizei n, GLuint *textures)函数说明 glGenTextures(GLsizein,GLuint*textures)函数说明n:用来生成纹理名字的数量textures:存储纹理名称数组的第一个元素指针备注说明:glGenTextures函数根据纹理参数返
OpenGL学习之glBindTexture函数 在此记录一下glBindTexture函数的作用:glBindTexture函数实现了将调用glGenTextures函数生成的纹理的名字绑定到对应的目标纹理上。该函数的声明如下所示:vo
OpenGL中创建聚光灯的效果 OpenGL中创建聚光灯的效果现在,我们使用如下的数组来指定一个光源的位置://指定光源位置的数组GLfloatlightPos[]={0.0f,0.0f,.0f,1.0f};//设置光源0的位置glLi
标签: Unsolved bug in fltk-1.1.10/src/filename_list.cxx for scandir --已解决!
本文链接地址:https://www.jiuchutong.com/biancheng/373262.html 转载请保留说明!上一篇:OpenGL学习03_双缓冲DoubleBuffering(gdi双缓冲绘制)
下一篇:glGenTextures(GLsizei n, GLuint *textures)函数说明
友情链接: 武汉网站建设