出错信息如下:
gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -D_REENTRANT -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT nanohttp.lo -MD -MP -MF .deps/nanohttp.Tpo -c nanohttp.c -fPIC -DPIC -o .libs/nanohttp.o
nanohttp.c: In function 'xmlNanoHTTPFetch__internal_alias':
nanohttp.c:1558: warning: ignoring return value of 'write', declared with attribute warn_unused_result
nanohttp.c: In function 'xmlNanoHTTPSave__internal_alias':
nanohttp.c:1597: warning: ignoring return value of 'write', declared with attribute warn_unused_result
In function 'open',
inlined from 'xmlNanoHTTPSave__internal_alias' at nanohttp.c:1588:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[1]: *** [nanohttp.lo] Error 1
make[1]: Leaving directory `/home/winetcn/libxml2-2.6.30'
make: *** [install-recursive] Error 1
解决方法:
打开目录下的nanohttp.c,第1588行由
fd = open(filename, O_CREAT | O_WRONLY);更换为
fd = open(filename, O_CREAT | O_WRONLY,0777);
参考资料:
http://temix.blog.163.com/blog/static/364133200810237854799/
偶遇gcc-4.3 fcntl2.h错误
/usr/include/bits/fcntl2.h:51: 错误: 调用‘__open_missing_mode’,声明有错误属性:open with O_CREAT in second argument needs 3 arguments
网上查了一下,说是gcc-4.3对语法检查严格的结果,找到出错的那一句,在我编译的程序里是这句
int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC);
将之改为
int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0777);
就OK了
参考资料:
http://linux.chinaunix.net/techdoc/system/2008/11/08/1044060.shtml
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/286565
分享到:
相关推荐
Ubuntu11.10 libxml2-dev 安装包 libxml2_2.7.8.dfsg-4_i386.deb libxml2-dev_2.7.8.dfsg-4_i386.deb python-libxml2_2.7.8.dfsg-4_i386.deb zlib1g_1.2.3.4.dfsg-3ubuntu3_i386.deb zlib1g-dev_1.2.3.4.dfsg-3...
Libxml2 (2.9.8)库在Windows下的编译批处理文件。将本文件下载到源码目录win32子目录中,然后点击执行即可完成编译。 在执行之前,需要根据实际情况修改批处理中的文件目录。
libxml2-2.9.8源码及编译方法,libxml2-2.9.8源码及编译方法
使用mingw4.9.2编译后的libxml2-2.7.7安装包,包括lib、bin、include等
arm交叉编译的libxml2库文件 含两个文件夹,直接可以用
最近一段时间,在android上想用c++处理xml数据,在网上找了半天资料,大多数教程都是在编译android系统的时候顺便把libxml2和libiconv源码放到系统指定路径下编译出来。可是没干过这样的事,也不想这么做。最后还是...
Ubuntu下C语言使用libxml2库创建、解析xml文件,包括对节点的增、删、改、查等
WIndows环境下的libxml2库,在网上找到的基本上都是32位的,自己根据源码手动编译了64位的库,包括libxml2.dll以及libxml2.lib,基于源码版本2.9.0以及iconv-1.9.1的依赖 已经通过验证,并且在应用程序中使用
不同版本Linux下基于libxml2的C编译问题解决,解决libxml2的makefile编译问题,使用的是软链接。
编译好的libxml 2.9.9,包含动态库和链接库文件。
libxml2-dev_2.9.1+dfsg1-3ubuntu4.7_amd64.deb
VS2015编译的libxml2的64位库,版本是2.7.2。libxml2是一个用来解析XML文档的函数库。它用 C 语言写成,并且能被多种语言所调用,如 C、C++、XSH、C#、Python、Kylix、Delphi、Ruby、PHP 等。它最初是为 GNOME 开发...
libxml2-utils_2.9.1+dfsg1-3ubuntu4.7_amd64.deb
libxml2.so.2
GNU libxml2-2.7.3,BCB 6.0环境下编译,包含头文件,动态链接库,lib文件以及文档和代码示例,分发应用程序需要包含Borland的多线程动态库。
将libxml2 2.7.8 代码建立了VS2008编译工程,并增加了15个测试程序代码。确实需要的请下载
既可以支撑QGIS在MacOS环境下的编译工作,也可以进行libXML2的二次研发。 四、其他说明 在MacOS环境下,基于Qt Creator进行编译的libXML2开源库。包含有头文件include、库文件dylib等,提供了Debug、Release版本。 ...
既可以支撑QGIS在Windows环境下的编译工作,也可以进行libXML2的二次研发。 四、其他说明 在Windows环境下,基于Qt Creator进行编译的libXML2开源库。包含有头文件include、库文件lib、动态库dll等,提供了Debug、...
libxml2_2.9.1+dfsg1-3ubuntu4.7_amd64.deb
xml的一个PPT和libxml2的一个教程和海思hi35xx的编译配置文件