注意 - 编译代码时,确保使用 C ++ 11。 你可以通过以下命令从命令行执行此操作:
cmd中执行
g++ -std=c++11 tests.cpp
执行完上述命令后会在tests.cpp的同级目录下生成a.exe,然后点击运行即可
该项目由如下文件组成
projectDirectory
debugging_helpers.cpp
helpers.cpp
localizer.cpp
simulate.cpp
tests.cpp
如上文件与下面maps文件夹为并列关系
maps
|----half_red.txt
|---m1.txt
|---m2.txt
上面各CPP文件的依赖关系如下
tests.cpp->simulate.cpp->localizer.cpp->helpers.cpp
|-debugging_helpers.cpp
按上述命令行编译后会在projectDirectory文件夹中生成一个a.exe可执行二进制文件