场景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】