cuda中如何调用外部库函数的功能?
开发环境是ubuntu。编程语言用的是c++。
代码里面用到gdal库读写图像文件。
make的时候,出现一堆
main.cpp:(.text+0x71): undefined reference to `GDALAllRegister'
main.cpp:(.text+0x81): undefined reference to `GDALOpen'
main.cpp:(.text+0x97): undefined reference to `GDALDataset::GetRasterCount()'
main.cpp:(.text+0xa5): undefined reference to `GDALDataset::GetRasterXSize()'
main.cpp:(.text+0xb3): undefined reference to `GDALDataset::GetRasterYSize()'
main.cpp:(.text+0xf1): undefined reference to `GDALDataset::GetRasterBand(int)
这样的错误。
不知道是不是没有找到头文件所致。但是path里面是包含了gdal的头文件的。
我在windows下面编译正常。
gdal在linux下也通过congfigure,make,make install安装正常。
是否在编译自己利用gdal库开发的程序的时候需要设置什么?在哪里设呢?
因为makefile用了cuda里面的模板例子,我不知道是否要对makefile作修改?
在makefile里面加了
include gdal.h
include cpl_string.h
include cpl_conv.h
include cpl_multiproc.h
include gdal_priv.h
结果就在make的时候出现gdal.h:1: *** missing separator. Stop.错误。
不知怎么处理,请大家指点,谢谢!
感觉这个有点像如何在cuda中调用外部库编译的问题。