任天堂图形库的编译问题

shylake 2003-08-22 11:27:32
我把它的EXAMPLE重新编译后,就跑不起来了,为什么呢?高手来帮我指点下!
...全文
140 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
DanXer 2003-08-22
  • 打赏
  • 举报
回复
好的,这个问题有点麻烦,我尽量说清楚点。
1.如果编译时使用./configure --enable-static.就会生成两个版本的release库
一个静态库/usr/local/lib/liballeg.a;一个动态库/usr/local/lib/liballeg.so.4.0.3
也可以./configure --enable-dbglib --enable-static生成两个版本的debug库,这时文件名好像稍有不同,/usr/local/lib/liballd.a,/usr/local/lib/liballd.so.4.0.3(我没有测试debug版,文件名我是在doc里看到的)。
2.同时编译后会生成allegro-config脚本。放到某个bin目录下了。
3.自己编写程序连接allegro库时就存在连接那个版本的库的问题,allegro建议,如果连接静态库(文件/usr/local/lib/liballeg.a,gcc标志-lalleg)那么其它的X驱动,SVGALib也要使用静态库版本,如果使用allegro共享库版本(文件/usr/local/lib/liballeg.a,ldopen("alleg.so.4.0")),就同其他库没有关系了,其他库可以使用任何版本。
4.由于库的复杂性,allegro附带了allegro-config:连接配置脚本。
使用方法:
root# allegro-config --env //配置编译游戏程序的环境,主要是设置一些变量,默认情况下应该已配置好,如果没有也可以allegro-config --env >> ~/.bashrc_profile。
root# allegro-config //显示可用选项

编译程序时(包括demo和examples和你自己编写的程序)
root# gcc -o demo demo.c `allegro-config --libs` //使用release版共享库
root# gcc -o demo demo.c `allegro-config --libs release` //同上
root# gcc -o demo demo.c `allegro-config --libs debug` //使用debug版共享库
root# gcc -o demo demo.c `allegro-config --static release` //使用release版静态库
root# gcc -o demo demo.c `allegro-config --share release` //使用release版共享库
其它以此类推。allegro-config后面的选项可以直接运行allegro-config来查询。

注意:上边`allegro-config --libs`的两个单引号不是单引号(').而是TAB键上边,1左边的键。


我已测试过没有问题,可以编译任何程序。

23,110

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧