Qt Creator头文件链接问题

zhangxing1008 2016-05-22 10:15:00
在利用Qt对一个激光雷达进行开发过程中,程序运行不成功。。。。。。提示头文件包含有问题,一些函数未申明的引用,但是我确定我已经准确添加了头文件路径

...全文
232 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
lqbk1 2016-05-23
  • 打赏
  • 举报
回复
gcc (Linux, MinGW)

  If you need to change the default installation directory, change the PREFIX variable
  in the following file:
     urg_library-X.X.X/current/Makefile.release

  This is the default setting, change it to suit your needs:
PREFIX = /usr/local
#PREFIX = /mingw

  To compile and install, perform the following steps:
  $ make
  # make install

  To learn how to use the library, see the Makefile and source codes on the following folder:
    urg-library-X.X.X/samples/
这个和楼上的图都说得很明白了呀...... 楼主没单独用mingw的命令行编译过东西?
zhangxing1008 2016-05-23
  • 打赏
  • 举报
回复
引用 3 楼 lqbk1 的回复:
理论上,Urg_driver类的源码在Urg_driver.cpp内,构建时被编译进了urg_cpp.lib里
而楼主似乎已经将适用于vs2010的lib添加到了依赖项.......

楼主的Qt Creator内设置的编译器是?

Qt Creator内设置的编译器为Mingw. 一直链接不成功,我也怀疑是库的问题,需要在Qt中编译适用于Qt的库吗?下面是从所给资料中找到的一下东西,但是没有看懂怎么编译啊
zhangxing1008 2016-05-23
  • 打赏
  • 举报
回复
引用 11 楼 lqbk1 的回复:
[quote=引用 8 楼 zhangxing1008 的回复:] [quote=引用 5 楼 lqbk1 的回复:]
gcc (Linux, MinGW)

  If you need to change the default installation directory, change the PREFIX variable
  in the following file:
     urg_library-X.X.X/current/Makefile.release

  This is the default setting, change it to suit your needs:
PREFIX = /usr/local
#PREFIX = /mingw

  To compile and install, perform the following steps:
  $ make
  # make install

  To learn how to use the library, see the Makefile and source codes on the following folder:
    urg-library-X.X.X/samples/
这个和楼上的图都说得很明白了呀...... 楼主没单独用mingw的命令行编译过东西?
是这样的,如果我想在Windows系统下的Qt Creator中开发,应该怎么编译呢?[/quote] 装近期版本的mingw,应该会把msys一并也装上,搜搜机子mingw安装目录的各个子目录,看能不能找到一个叫msys.bat的文件,双击后会打开一个类似cmd的终端,cd到urg_lib的makefile所在目录,然后依次执行make和make install[/quote] 好的,谢谢,试一试吧
lqbk1 2016-05-23
  • 打赏
  • 举报
回复
引用 8 楼 zhangxing1008 的回复:
[quote=引用 5 楼 lqbk1 的回复:]
gcc (Linux, MinGW)

  If you need to change the default installation directory, change the PREFIX variable
  in the following file:
     urg_library-X.X.X/current/Makefile.release

  This is the default setting, change it to suit your needs:
PREFIX = /usr/local
#PREFIX = /mingw

  To compile and install, perform the following steps:
  $ make
  # make install

  To learn how to use the library, see the Makefile and source codes on the following folder:
    urg-library-X.X.X/samples/
这个和楼上的图都说得很明白了呀...... 楼主没单独用mingw的命令行编译过东西?
是这样的,如果我想在Windows系统下的Qt Creator中开发,应该怎么编译呢?[/quote] 装近期版本的mingw,应该会把msys一并也装上,搜搜机子mingw安装目录的各个子目录,看能不能找到一个叫msys.bat的文件,双击后会打开一个类似cmd的终端,cd到urg_lib的makefile所在目录,然后依次执行make和make install
zhangxing1008 2016-05-23
  • 打赏
  • 举报
回复
引用 9 楼 qq423399099 的回复:
试试让QT自己生成.pro中的语句
右键项目--添加库--静态库
PS:完成之后记得删掉DEBUG目录,然后重新生成试试

哎,并不行啊。。。。。要疯了。。。。。
小灸舞 2016-05-23
  • 打赏
  • 举报
回复
试试让QT自己生成.pro中的语句
右键项目--添加库--静态库
PS:完成之后记得删掉DEBUG目录,然后重新生成试试
zhangxing1008 2016-05-23
  • 打赏
  • 举报
回复
引用 5 楼 lqbk1 的回复:
gcc (Linux, MinGW)

  If you need to change the default installation directory, change the PREFIX variable
  in the following file:
     urg_library-X.X.X/current/Makefile.release

  This is the default setting, change it to suit your needs:
PREFIX = /usr/local
#PREFIX = /mingw

  To compile and install, perform the following steps:
  $ make
  # make install

  To learn how to use the library, see the Makefile and source codes on the following folder:
    urg-library-X.X.X/samples/
这个和楼上的图都说得很明白了呀...... 楼主没单独用mingw的命令行编译过东西?
是这样的,如果我想在Windows系统下的Qt Creator中开发,应该怎么编译呢?
zhangxing1008 2016-05-23
  • 打赏
  • 举报
回复
引用 5 楼 lqbk1 的回复:
gcc (Linux, MinGW)

  If you need to change the default installation directory, change the PREFIX variable
  in the following file:
     urg_library-X.X.X/current/Makefile.release

  This is the default setting, change it to suit your needs:
PREFIX = /usr/local
#PREFIX = /mingw

  To compile and install, perform the following steps:
  $ make
  # make install

  To learn how to use the library, see the Makefile and source codes on the following folder:
    urg-library-X.X.X/samples/
这个和楼上的图都说得很明白了呀...... 楼主没单独用mingw的命令行编译过东西?
应该怎么编译呢?在cmd.exe中编译?
zhangxing1008 2016-05-23
  • 打赏
  • 举报
回复
引用 5 楼 lqbk1 的回复:
gcc (Linux, MinGW)

  If you need to change the default installation directory, change the PREFIX variable
  in the following file:
     urg_library-X.X.X/current/Makefile.release

  This is the default setting, change it to suit your needs:
PREFIX = /usr/local
#PREFIX = /mingw

  To compile and install, perform the following steps:
  $ make
  # make install

  To learn how to use the library, see the Makefile and source codes on the following folder:
    urg-library-X.X.X/samples/
这个和楼上的图都说得很明白了呀...... 楼主没单独用mingw的命令行编译过东西?
哎,没有啊,正在努力学习中……
lqbk1 2016-05-22
  • 打赏
  • 举报
回复
理论上,Urg_driver类的源码在Urg_driver.cpp内,构建时被编译进了urg_cpp.lib里 而楼主似乎已经将适用于vs2010的lib添加到了依赖项....... 楼主的Qt Creator内设置的编译器是?
zhangxing1008 2016-05-22
  • 打赏
  • 举报
回复
引用 1 楼 lqbk1 的回复:
光添加头文件是不够的,还需要添加对应的依赖库 看看帮助文档吧,它会告诉你还需要什么lib
依赖库我也添加了的。。。。。。在pro文件中有添加路径和.lib 文件
lqbk1 2016-05-22
  • 打赏
  • 举报
回复
光添加头文件是不够的,还需要添加对应的依赖库 看看帮助文档吧,它会告诉你还需要什么lib

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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