不使用QT IDE 使用windows(vs) linux(eclipse) 下开发
2016-03-18 13:07
525 查看
linux:
Eclipse配置
新建一个C/C++工程
添加一个CPP文件 main.cpp
写入
1添加qt的包含目录
编译提示错误
error "You must build your code with position independent code if Qt was built with -reduce-relocations. "
解决方案 勾选 Position Indenpendent Code
编译错误 没有添加库
main.cpp:6: undefined reference to `QApplication::QApplication(int&, char**, int)
。。。。。。。。。。
解决方法。添加库文件
如果还提示Qtxxx so缺少依赖库。
and (from libQt5Core.so) a dozen errors like:
解决
windows:
windows下可以通过qt addon 插件。也可以像linux上面一样 添加你自己的cpp然后通过rcc uic moc 编译需要的文件。然后构建
Eclipse配置
新建一个C/C++工程
添加一个CPP文件 main.cpp
写入
#include "stdio.h" #include <QtWidgets/QApplication> #include <QtWidgets/QLabel> int main(int argc ,char * argv[]) { QApplication app(argc,argv); QLabel *label = new QLabel("Hello Qt!"); label->show(); printf("qt main"); return app.exec(); }
1添加qt的包含目录
编译提示错误
error "You must build your code with position independent code if Qt was built with -reduce-relocations. "
解决方案 勾选 Position Indenpendent Code
编译错误 没有添加库
main.cpp:6: undefined reference to `QApplication::QApplication(int&, char**, int)
。。。。。。。。。。
解决方法。添加库文件
如果还提示Qtxxx so缺少依赖库。
libicui18n.so.48, needed by /home/xxxxxxxx/install/Qt/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
and (from libQt5Core.so) a dozen errors like:
/home/xxx/install/Qt/lib/libQt5Core.so:-1: error: undefined reference to ucnv_fromUnicode_48'
解决
windows:
windows下可以通过qt addon 插件。也可以像linux上面一样 添加你自己的cpp然后通过rcc uic moc 编译需要的文件。然后构建
相关文章推荐
- linux命令(6)crontab的用法和解析
- Linux正则表达式归纳总结(学习笔记)
- Linux内核中_IO,_IOR,_IOW,_IOWR宏的用法与解析
- Linux gcc gdb 编译调试程序
- Linux打印串口数据
- centos防火墙操作
- 如何在Linux上搭建VisualSVN Server(svn服务端)
- 简单讲解Linux系统中PS1默认提示符的设置
- centos php5.5 5.6 安装
- Linux find命令详解和实例说明
- 嵌入式Linux系统运行流程图
- Linux防火墙:iptables禁IP与解封IP常用命令
- [置顶] 【Linux利用远程SSH连接】SecureCRT中文出现乱码解决办法 Linux服务器技术
- linux 基础——根文件系统中的目录
- linux 任务计划,crontab、at 、anacron
- linux(Ubuntu)中安装配置JDK
- linux内核学习
- Linux系统中查看硬件信息与运行状态的方法总结
- Linux 技巧:让进程在后台可靠运行的几种方法
- Linux内核配置系统-Kconfig和Makefile参数讲解