Linux C++
1、Gdal
1.1 visual studio 配置
- 配置属性 > C++目录 > 包含目录: /usr/local/include
- 配置属性 > C++目录 > 库目录: /usr/local/lib

- 配置属性 > 连接器 > 常规 > 附加库目录: /usr/local/lib

- 配置属性 > 输入 > 库依赖项:gdal

1.2 链接 Linux

1.3 测试
#include "gdal_priv.h"#include <iostream>using namespace std;int main(){ const char* pszFile; GDALAllRegister(); pszFile = "/home/test.tif"; GDALDataset* poDataset = (GDALDataset*)GDALOpen(pszFile, GA_ReadOnly); GDALRasterBand* poBand = poDataset->GetRasterBand(1); int xsize = poBand->GetXSize(); int ysize = poBand->GetYSize(); cout << xsize << endl; cout << ysize << endl; return 0;}