当前位置:首页 » 编程软件 » qtcreator如何编译其它程序

qtcreator如何编译其它程序

发布时间: 2022-04-25 19:49:22

⑴ QTcreator能在windows中交叉编译arm平台程序吗

这个估计没必要,安装一个虚拟机,然后安装一个桌面版的里linux系统,再在系统中安装一个vim编辑器,再安装一个gdb调试器,最后再arm-linux-gcc就可以编译c文件了,要是你的很多源程序文件都在windows系统中,你可以设置Windows与Linux共享文件。这些东西在网上都可以找到教程,刚开始可能觉得Linux系统很不方便,但是要熟悉Linux系统就必须经常呆在Linux系统中,希望能帮到你。

⑵ 如何用qtreator编译linux 模块

wanglj@localhost testQT]$ make
g++ -o testQT main.o -L/opt/Qt5.1.1/5.1.1/gcc_64/lib -lqt-mt -lXext -lX11 -lm
main.o: In function `main':
/home/wanglj/testQT/main.cpp:6: undefined reference to `QApplication::QApplication(int&, char**, int)'

⑶ qtcreator工程编译的应用程序可以在哪些操

在Qt Creator中使用OpenCV库 (Windows 7系统下编译成功)
编译OpenCV2.0
1 下载tdm-mingw-1.908.0-4.4.1-2并安装,安装完毕添加bin到系统路径。
2 安装Opencv2.0 windows版本
3 安装CMake
4 打开CMake,配置源码与目标路径,选择MinGW Makefiles,生成目标Makefile
5 进入设置好的目标路径,make,直至生成所有的库
配置Qt Creator
Qt开发的程序一般需要借助qmake生成makefile文件。由于qmake在解析路径的时候不能识别空格, 因此需要确保OpenCV的安装路径中不能包含空格(C:/Program Files/OpenCV是不行的)。
在创建工程文件的时候(这里假设为hello.pro,后缀为pro),向工程中添加以下语句:
INCLUDEPATH+=D:/Qt/OpenCV-2.0.0/include/opencv
LIBS+=D:/Qt/OpenCV-2.0.0/lib/libcv200.dll.a/
D:/Qt/OpenCV-2.0.0/lib/libcxcore200.dll.a/
D:/Qt/OpenCV-2.0.0/lib/libml200.dll.a/
D:/Qt/OpenCV-2.0.0/lib/libcvaux200.dll.a/
D:/Qt/OpenCV-2.0.0/lib/libhighgui200.dll.a
这样,在Qt中就可以使用Opencv 2.0 了

打开CMake,试一下,发现没法完成configure!原因是CMAKE_MAKE_PROGRAM没找到,这个简单,修改该项为D:/Qt/2011.04/mingw/bin(您自个看着改)。
继续Configure,什么还出错?弹出一大堆什么dll找不到!!
好吧,我直接把D:/Qt/2011.04/mingw/bin放到环境变量中去。
Delete Catch以后再来一次,这下好了,连CMAKE_MAKE_PROGRAM都不用改了,自动找到。成功configure。
然后Generate一下。

⑷ 如何在QTcreator5.1.1中添加其他版本的QT如何才能用这个开发QT4.8.5

在Qt选项页面内

  1. 点击Qt版本->添加->指定相应版本的qmake.exe文件(该文件在安装的Qt版本文件夹下的bin文件夹内)。之后可以在Qt版本页面内看到默认的“版本名称”和“qmake路径”,“版本名称”可以修改。



    ⑸ linux下qtcreator怎么配置c++的编译器

    编译器:GCC编译器可以用来编译C和C++源程序,C编译器通过文件的后缀来判断是C程序还是C++程序。一般来说C源文件的后缀为“.C”,而C++源文件的后缀为“.C”或“C++”。
    但GCC编译器只能编译C++源程序,不能与使用的库连接,因此用G++来完成C++程序的编译与连接,该程序会自动调用GCC来编译。


    Linux里环境变量的设置,有如下几种方法:


    (1)直接在终端里输入export后面加要设的变量,例如QT:
    ExportQTDIR=$PWD/qt-2.3.2
    其中,pwd是用来显当前路径的命令,在其前面加上$,则表示QT的目标目录在当前目录下的“qt-2.3.2”里,当然“$PWD”也可以用绝对路径来代替。这种方法所设的环境变量在下次开机后不再有效,而且换个shell也不会有效,只是临时的。
    (2)在etc/profile里添加环境变量,比如:
    exportQTDIR=/usr
    exportLD_LIBRARY_PATH=$QTDIR/lib
    exportQT_QWS_FONTDIR=$QTDIR/lib/fonts
    exportQWS_DISPLAY="LinuxFb:/dev/fb0"
    (3)修改.bashrc,如果需要给某个用户权限使用这些环境变量,只需修改其个人用户家目录下的.bashrc文件就可以了。
    (4)用以上面两种方法设置好环境变量后记得重启


    以上使用QT为例

    ⑹ qtcreator可以编译普通c++文件吗

    打开QtCreator,文件->新建文件或项目->Application->Qt 控制台应用

    建好工程之后,在main.cpp

    文件中就可以编写C++控制台应用程序了

    譬如:main.cpp内容如下:

    #include<QCoreApplication>
    #include<iostream>

    intmain(intargc,char*argv[])
    {
    QCoreApplicationa(argc,argv);

    std::cout<<"HelloWorld!"<<std::endl;


    returna.exec();
    }

    执行结果:

    与普通C++工程无区别

    ⑺ 错误:Qt Creator 需要设置一个编译器来构建.在构建套件选项里设置一个编译

    主要是qtcreator未检索到系统主要常用目录和环境变量下的目录中检索到可以使用的有效编译系统,因此发生此错误,如果你自定义安装了编译环境和工具集,应当在选项->编译环境中指定编译器的位置,qtcreator会自己确定类型。

    ⑻ 如何利用QTcreator 开发Wt程序

    从一个简单的helloword开始吧
    pro文件

    #-------------------------------------------------
    #
    # Project created by QtCreator 2010-11-18T12:10:20
    #
    #-------------------------------------------------
    QT -= core
    QT -= gui
    TARGET = hello.wt
    LIBS += -L/usr/local/lib -lwt -lwthttp
    CONFIG += console
    CONFIG -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp
    main.cpp
    #include <Wt/WApplication>
    #include <Wt/WBreak>
    #include <Wt/WContainerWidget>
    #include <Wt/WLineEdit>
    #include <Wt/WPushButton>
    #include <Wt/WText>
    #include <boost/version.hpp>
    using namespace Wt;
    /*
    * A simple hello world application class which demonstrates how to react
    * to events, read input, and give feed-back.
    */
    class HelloApplication : public WApplication
    {
    public:
    HelloApplication(const WEnvironment& env);
    private:
    WLineEdit *nameEdit_;
    WText *greeting_;
    void greet();
    };
    /*
    * The env argument contains information about the new session, and
    * the initial request. It must be passed to the WApplication
    * constructor so it is typically also an argument for your custom
    * application constructor.
    */
    HelloApplication::HelloApplication(const WEnvironment& env)
    : WApplication(env)
    {
    setTitle("Hello"); // application title
    root()->addWidget(new WText("Your name, please ? ")); // show some text
    nameEdit_ = new WLineEdit(root()); // allow text input
    nameEdit_->setFocus(); // give focus
    WPushButton *b = new WPushButton("Greet me.", root()); // create a button
    b->setMargin(5, Left); // add 5 pixels margin
    root()->addWidget(new WBreak()); // insert a line break
    greeting_ = new WText(root()); // empty text
    /*
    * Connect signals with slots
    *
    * - simple Wt-way
    */
    b->clicked().connect(this, &HelloApplication::greet);
    /*
    * - using an arbitrary function object (binding values with boost::bind())
    */
    nameEdit_->enterPressed().connect
    (boost::bind(&HelloApplication::greet, this));
    }
    void HelloApplication::greet()
    {
    /*
    * Update the text, using text input into the nameEdit_ field.
    */
    greeting_->setText("Hello there, " + nameEdit_->text());
    }
    WApplication *createApplication(const WEnvironment& env)
    {
    /*
    * You could read information from the environment to decide whether
    * the user has permission to start a new application
    */
    return new HelloApplication(env);
    }
    int main(int argc, char **argv)
    {
    /*
    * Your main method may set up some shared resources, but should then
    * start the server application (FastCGI or httpd) that starts listening
    * for requests, and handles all of the application life cycles.
    *
    * The last argument to WRun specifies the function that will instantiate
    * new application objects. That function is executed when a new user surfs
    * to the Wt application, and after the library has negotiated browser
    * support. The function should return a newly instantiated application
    * object.
    */
    return WRun(argc, argv, &createApplication);
    }
    这就是helloword 的工程文件
    现在编译肯定是无法运行的
    然后在运行环境中添加wt的共享库地址 好了 现在打开浏览器 输入0.0.0.0:8080 点击编译运行
    成功 ,这样开发起来效率不知道高出n倍吧,诶,不知道wt 什么时候才能在国内普及呢

    ⑼ QtCreator怎么添加编译参数

    QtCreator添加编译参数方法:
    在pro文件里添加:QMAKE_CXXFLAGS += -m128bit-long-double如果是C工程或者有C文件也用那就也加上:QMAKE_CFLAGS += -m128bit-long-doublepro文件很灵活

    ⑽ 怎么样编译qtcreator源码

    找不到头文件,既然头文件还在,那就是路径设置了,在工程属性里面找到包含文件路径,将你需要的头文件所在路径添加进去就行

热点内容
我的世界java版各个服务器地址 发布:2025-04-16 13:43:43 浏览:983
如何设置用网页登录服务器 发布:2025-04-16 13:42:21 浏览:735
sql变量类型 发布:2025-04-16 13:37:36 浏览:894
linux内存过高 发布:2025-04-16 13:32:25 浏览:661
改用linux 发布:2025-04-16 13:30:49 浏览:164
逍遥安卓目录在哪里 发布:2025-04-16 13:15:31 浏览:951
论文编译用哪个符号 发布:2025-04-16 13:09:46 浏览:722
数据库图表 发布:2025-04-16 13:09:46 浏览:307
安卓系统图库文件夹是哪个 发布:2025-04-16 12:57:39 浏览:107
银行卡加密码失败是什么意思 发布:2025-04-16 12:55:58 浏览:378