96 Star 489 Fork 77

GVPliu / LCUI

 / 详情

gcc –o test.o test `pkg-config --libs lcui` 报错 –o: 没有那个文件或目录

已完成
创建于  
2019-06-24 22:37

官网教程 https://docs.lcui.lc-soft.io/zh-cn/install/linux.html
配置

为编译器添加参数,指定 LCUI 的头文件和库文件的查找位置,例如:

gcc -c test.c `pkg-config --cflags lcui`
gcc –o test.o test `pkg-config --libs lcui`

执行结果如下:

kezj@kezj-PC:~/Downloads/LCUI/test$ gcc -c test.c `pkg-config --cflags lcui`
kezj@kezj-PC:~/Downloads/LCUI/test$ gcc –o test.o test `pkg-config --libs lcui`
gcc: error: –o: 没有那个文件或目录

–o 改为 -o,再执行

kezj@kezj-PC:~/Downloads/LCUI/test$ gcc -o test.o test `pkg-config --libs lcui`
test: file not recognized: 不可识别的文件格式
collect2: error: ld returned 1 exit status

然后不知如何解决。

评论 (1)

EX移动城堡 创建了任务
liu 修改了描述
展开全部操作日志

文档上的 gcc 参数顺序写错了,改成

gcc -o test test.o `pkg-config --libs lcui`

输入图片说明

liu 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
568 lc soft 1586692424
C
1
https://gitee.com/lc-soft/LCUI.git
git@gitee.com:lc-soft/LCUI.git
lc-soft
LCUI
LCUI

搜索帮助