當前位置:首頁 » 編程軟體 » 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源碼

    找不到頭文件,既然頭文件還在,那就是路徑設置了,在工程屬性裡面找到包含文件路徑,將你需要的頭文件所在路徑添加進去就行

熱點內容
scratch少兒編程課程 發布:2025-04-16 17:11:44 瀏覽:617
榮耀x10從哪裡設置密碼 發布:2025-04-16 17:11:43 瀏覽:345
java從入門到精通視頻 發布:2025-04-16 17:11:43 瀏覽:60
php微信介面教程 發布:2025-04-16 17:07:30 瀏覽:287
android實現陰影 發布:2025-04-16 16:50:08 瀏覽:779
粉筆直播課緩存 發布:2025-04-16 16:31:21 瀏覽:330
機頂盒都有什麼配置 發布:2025-04-16 16:24:37 瀏覽:193
編寫手游反編譯都需要學習什麼 發布:2025-04-16 16:19:36 瀏覽:781
proteus編譯文件位置 發布:2025-04-16 16:18:44 瀏覽:346
土壓縮的本質 發布:2025-04-16 16:13:21 瀏覽:574