1:打開 terminal
sudo apt-get install build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt 4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils
2:如果打開的時候報錯,出現以下錯誤提示:
無法覆蓋文件 /home/linuxer/.config/QtProject/qtcreator/qtversion.xml : Permission ......
解決方法如下:開打終端
sudo chown -R usrname:usrname .config/
3:
在選項–工具–構建與運行–配置好
構建套件–gcc
查看qt versions ,如果自動檢測沒有,需要 手動檢測
編輯器–Gcc 編輯器(此處最好選擇gcc編輯器)
4:下面介紹的運行程序方法不是界面運行(點擊鼠標),而是通過 terminal來運行
1:打開terminal
2:ls
3:mkdir my_pro
4:ls
5:cd my_pro
6:mkdir hello
7:ls
8:cd hello
9:touch hello.cpp
10:qmake -project(出現hello.pro)
11:ls
12:qtcreator hello.pro &
此時打開了 qtcreator界面,寫入程序
編譯--打開源文件--寫入程序)
14:qmake
(出現了makefile 文件)
15:make(出現了hello.o)
16:ls
17: . /hello
程序截圖
ls
1388 mkdir my_pro
1389 ls
1390 cd my_pro
1391 ls
1392 mkdir hello
1393 cd hello
1394 touch hello.cpp
1395 qmake -project
1396 ls
1397 qtcreator hello.pro&
1398 ls
1399 qmake
1400 make
1401 ls
1402 ./hello
5:運行出現的問題:
“Error in \” Util.asciify(\”build-test1-pc-Debug\”)\”: TypeError: Property ‘asciify’ of object Core::Internal::UtilsJsExtension(0xdb7dc0) is not a function”
解決方法:
更換構建目錄
在構建和運行頁面的最下方,便是指定構建目錄的地方。
在這裏我們可以看到,將我們的構建目錄改爲
../build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}
再運行
ok!回去睡覺