場景1:編譯普通C++代碼
/*hello_world.cpp*/
#include <iostream>
using namespace std;
int main() {
cout << "Hello, world!" << endl;
return 0;
}
編譯
g++ xxx.cpp
默認生成名爲a.out
的可執行文件g++ xxx.cpp -o exe_filename
生成名爲exe_filename
的可執行文件- Windows的可執行文件一般爲
.exe
文件/Linux下可執行文件並沒有文件拓展名
場景2:編譯OpenCV (C++)工程【不使用CMake】
場景3:編譯OpenCV (C++)工程【使用CMake】