Linux unqlite.h:651:15:错误:更改‘;pgno’;从‘;类型定义sxu64 pgno’;[-fpermissive]
刚刚下载了unqlite.c和unqlite.h,在Eclipse中创建了一个新项目,从网站上复制了一个示例,我得到了以下错误:Linux unqlite.h:651:15:错误:更改‘;pgno’;从‘;类型定义sxu64 pgno’;[-fpermissive],linux,eclipse,gcc,unqlite,Linux,Eclipse,Gcc,Unqlite,刚刚下载了unqlite.c和unqlite.h,在Eclipse中创建了一个新项目,从网站上复制了一个示例,我得到了以下错误: 21:37:51 **** Build of configuration Debug for project nosql **** make all Building file: ../main.cpp Invoking: Cross G++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"
21:37:51 **** Build of configuration Debug for project nosql ****
make all
Building file: ../main.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
In file included from ../main.cpp:49:0:
../unqlite.h:661:8: error: declaration of ‘pgno unqlite_page::pgno’ [-fpermissive]
pgno pgno; /* Page number for this page */
^
../unqlite.h:651:15: error: changes meaning of ‘pgno’ from ‘typedef sxu64 pgno’ [-fpermissive]
typedef sxu64 pgno;
^
subdir.mk:25: recipe for target 'main.o' failed
make: *** [main.o] Error 1
21:37:51 Build Finished (took 171ms)
本来就应该这么简单,但我不知道发生了什么。。。有人试过这个unqLite KV商店吗
我正在使用
gcc版本4.9.2(Debian 4.9.2-10)
干杯
- 您可以获得由lib作者生成的补丁,如下所示:
- 或者,您可以编辑第661行的unqlite.h文件,替换为:
pgno pgno;/*此页的页码*/
借
::pgno pgno;/*此页的页码*/
它将与G++编译器以及其他C++编译器一起使用。当然,您不能使用c编译器使用此编辑的头编译unqlite.c
如果您想了解有关此错误的更多信息,这可能是一个很好的链接:祝你有愉快的一天 你必须做一些努力才能让它工作是的。用C编译器编译C文件,修改上面的代码,并用extern'C'{unqlite.h}包围您的include。我相信这就是全部。看见