将LASlib编译为动态库的最佳方法

时间:2017-03-02 13:21:22

标签: c++ dll visual-studio-2015 static-libraries lidar

我想将LASlib编译为dll。该库存储在github中。通常,LASlib被编译为静态库。我为library compilation in Visual Studio 2015做了指令,静态库编译成功了。但这种方式对我来说并不好,因为我想在开发解决方案中使用LASlib,它将是一个dll文件。我想将LASlib编译为Windows dll。

我尝试了很多想法,但没有任何想法不能很好地运作。我使用Visual Studio 2015,我选择配置类型为dll文件。此外,链接LASzip已添加到Linker。但是这个步骤不能成功编译。我把我的列表下面的错误。我该怎么做才能编译LASlib dll?

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::seek_next(class LASreader *)" (?seek_next@LASindex@@QEAA_NPEAVLASreader@@@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::intersect_circle(double,double,double)" (?intersect_circle@LASindex@@QEAA_NNNN@Z)    Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::intersect_tile(float,float,float)" (?intersect_tile@LASindex@@QEAA_NMMM@Z)   Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::intersect_rectangle(double,double,double,double)" (?intersect_rectangle@LASindex@@QEAA_NNNNN@Z)  Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::read(char const *)" (?read@LASindex@@QEAA_NPEBD@Z)   Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASindex::~LASindex(void)" (??1LASindex@@QEAA@XZ)   Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASindex::LASindex(void)" (??0LASindex@@QEAA@XZ)    Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASzip::~LASzip(void)" (??1LASzip@@QEAA@XZ) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASzip::LASzip(void)" (??0LASzip@@QEAA@XZ)  Laslib  C:\Users\Vmdev\Documents\Laslib\lasreaderbuffered.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::setup(unsigned short *,class LASitem * *,unsigned char,unsigned short,unsigned short)" (?setup@LASzip@@QEAA_NPEAGPEAPEAVLASitem@@EGG@Z)    Laslib  C:\Users\Vmdev\Documents\Laslib\lasreaderbuffered.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::read(class ByteStreamIn *)" (?read@LASindex@@QEAA_NPEAVByteStreamIn@@@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::done(void)" (?done@LASreadPoint@@QEAA_NXZ)   Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::check_end(void)" (?check_end@LASreadPoint@@QEAA_NXZ) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::read(unsigned char * const *)" (?read@LASreadPoint@@QEAA_NPEBQEAE@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::seek(unsigned int,unsigned int)" (?seek@LASreadPoint@@QEAA_NII@Z)    Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::init(class ByteStreamIn *)" (?init@LASreadPoint@@QEAA_NPEAVByteStreamIn@@@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::setup(unsigned int,class LASitem const *,class LASzip const *)" (?setup@LASreadPoint@@QEAA_NIPEBVLASitem@@PEBVLASzip@@@Z)    Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASreadPoint::~LASreadPoint(void)" (??1LASreadPoint@@QEAA@XZ)   Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASreadPoint::LASreadPoint(void)" (??0LASreadPoint@@QEAA@XZ)    Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: char const * __cdecl LASzip::get_error(void)const " (?get_error@LASzip@@QEBAPEBDXZ) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::check(void)" (?check@LASzip@@QEAA_NXZ) Laslib  C:\Users\Vmdev\Documents\Laslib\lasreader_las.obj   1   
Error   LNK2001 unresolved external symbol "public: void __cdecl ArithmeticDecoder::done(void)" (?done@ArithmeticDecoder@@QEAAXXZ)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl ArithmeticDecoder::init(class ByteStreamIn *,bool)" (?init@ArithmeticDecoder@@QEAA_NPEAVByteStreamIn@@_N@Z)    Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticDecoder::~ArithmeticDecoder(void)" (??1ArithmeticDecoder@@QEAA@XZ)    Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticDecoder::ArithmeticDecoder(void)" (??0ArithmeticDecoder@@QEAA@XZ) Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: int __cdecl IntegerCompressor::decompress(int,unsigned int)" (?decompress@IntegerCompressor@@QEAAHHI@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: void __cdecl IntegerCompressor::initDecompressor(void)" (?initDecompressor@IntegerCompressor@@QEAAXXZ)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl IntegerCompressor::~IntegerCompressor(void)" (??1IntegerCompressor@@QEAA@XZ)    Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl IntegerCompressor::IntegerCompressor(class ArithmeticDecoder *,unsigned int,unsigned int,unsigned int,unsigned int)" (??0IntegerCompressor@@QEAA@PEAVArithmeticDecoder@@IIII@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13reader.obj 1   
Error   LNK2001 unresolved external symbol "public: void __cdecl IntegerCompressor::compress(int,int,unsigned int)" (?compress@IntegerCompressor@@QEAAXHHI@Z)   Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: void __cdecl IntegerCompressor::initCompressor(void)" (?initCompressor@IntegerCompressor@@QEAAXXZ)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl IntegerCompressor::IntegerCompressor(class ArithmeticEncoder *,unsigned int,unsigned int,unsigned int,unsigned int)" (??0IntegerCompressor@@QEAA@PEAVArithmeticEncoder@@IIII@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: void __cdecl ArithmeticEncoder::done(void)" (?done@ArithmeticEncoder@@QEAAXXZ)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl ArithmeticEncoder::init(class ByteStreamOut *)" (?init@ArithmeticEncoder@@QEAA_NPEAVByteStreamOut@@@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticEncoder::~ArithmeticEncoder(void)" (??1ArithmeticEncoder@@QEAA@XZ)    Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticEncoder::ArithmeticEncoder(void)" (??0ArithmeticEncoder@@QEAA@XZ) Laslib  C:\Users\Vmdev\Documents\Laslib\laswaveform13writer.obj 1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::done(void)" (?done@LASwritePoint@@QEAA_NXZ) Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::chunk(void)" (?chunk@LASwritePoint@@QEAA_NXZ)   Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::write(unsigned char const * const *)" (?write@LASwritePoint@@QEAA_NPEBQEBE@Z)   Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::init(class ByteStreamOut *)" (?init@LASwritePoint@@QEAA_NPEAVByteStreamOut@@@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::setup(unsigned int,class LASitem const *,class LASzip const *)" (?setup@LASwritePoint@@QEAA_NIPEBVLASitem@@PEBVLASzip@@@Z)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASwritePoint::~LASwritePoint(void)" (??1LASwritePoint@@QEAA@XZ)    Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: __cdecl LASwritePoint::LASwritePoint(void)" (??0LASwritePoint@@QEAA@XZ) Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::request_version(unsigned short)" (?request_version@LASzip@@QEAA_NG@Z)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::set_chunk_size(unsigned int)" (?set_chunk_size@LASzip@@QEAA_NI@Z)  Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::is_standard(unsigned char *,unsigned short *)" (?is_standard@LASzip@@QEAA_NPEAEPEAG@Z) Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::setup(unsigned short,class LASitem const *,unsigned short)" (?setup@LASzip@@QEAA_NGPEBVLASitem@@G@Z)   Laslib  C:\Users\Vmdev\Documents\Laslib\laswriter_las.obj   1   
Error   LNK1120 47 unresolved externals Laslib  C:\Users\Vmdev\Documents\built\Laslib\x64\Release\LASlib.dll    1   

修改

我在评论中提到的preprocesor定义添加到mydef.hpp文件中此代码如下所示:

#ifdef LASLIB_DLL
#define LASLIB_DLL __declspec(dllexport)
#else
#define LASLIB_DLL __declspec(dllimport)
#endif

并且每个导出的类看起来像,例如:

class LASLIB_DLL LASreader
{
public:
  LASheader header;
  LASpoint point;

  I64 npoints;
  I64 p_count;
...
}

但我遇到了很多错误:

Severity    Code    Description Project File    Line    Suppression State
    Error   LNK1120 54 unresolved externals LasTools_lib    C:\Users\Vmdev\Documents\built\LasTools_lib\x64\Release\LASlib.dll  1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl ArithmeticDecoder::init(class ByteStreamIn *,bool)" (?init@ArithmeticDecoder@@QEAA_NPEAVByteStreamIn@@_N@Z)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl ArithmeticEncoder::init(class ByteStreamOut *)" (?init@ArithmeticEncoder@@QEAA_NPEAVByteStreamOut@@@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::intersect_circle(double,double,double)" (?intersect_circle@LASindex@@QEAA_NNNN@Z)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::intersect_rectangle(double,double,double,double)" (?intersect_rectangle@LASindex@@QEAA_NNNNN@Z)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::intersect_tile(float,float,float)" (?intersect_tile@LASindex@@QEAA_NMMM@Z)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::read(char const *)" (?read@LASindex@@QEAA_NPEBD@Z)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::read(class ByteStreamIn *)" (?read@LASindex@@QEAA_NPEAVByteStreamIn@@@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASindex::seek_next(class LASreader *)" (?seek_next@LASindex@@QEAA_NPEAVLASreader@@@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::check_end(void)" (?check_end@LASreadPoint@@QEAA_NXZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::done(void)" (?done@LASreadPoint@@QEAA_NXZ)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::init(class ByteStreamIn *)" (?init@LASreadPoint@@QEAA_NPEAVByteStreamIn@@@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::read(unsigned char * const *)" (?read@LASreadPoint@@QEAA_NPEBQEAE@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::seek(unsigned int,unsigned int)" (?seek@LASreadPoint@@QEAA_NII@Z)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASreadPoint::setup(unsigned int,class LASitem const *,class LASzip const *)" (?setup@LASreadPoint@@QEAA_NIPEBVLASitem@@PEBVLASzip@@@Z)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::chunk(void)" (?chunk@LASwritePoint@@QEAA_NXZ)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::done(void)" (?done@LASwritePoint@@QEAA_NXZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::init(class ByteStreamOut *)" (?init@LASwritePoint@@QEAA_NPEAVByteStreamOut@@@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::setup(unsigned int,class LASitem const *,class LASzip const *)" (?setup@LASwritePoint@@QEAA_NIPEBVLASitem@@PEBVLASzip@@@Z)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASwritePoint::write(unsigned char const * const *)" (?write@LASwritePoint@@QEAA_NPEBQEBE@Z)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::check(void)" (?check@LASzip@@QEAA_NXZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::is_standard(unsigned char *,unsigned short *)" (?is_standard@LASzip@@QEAA_NPEAEPEAG@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::request_version(unsigned short)" (?request_version@LASzip@@QEAA_NG@Z)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::setup(unsigned short *,class LASitem * *,unsigned char,unsigned short,unsigned short)" (?setup@LASzip@@QEAA_NPEAGPEAPEAVLASitem@@EGG@Z)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreaderbuffered.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::setup(unsigned short,class LASitem const *,unsigned short)" (?setup@LASzip@@QEAA_NGPEBVLASitem@@G@Z)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: bool __cdecl LASzip::set_chunk_size(unsigned int)" (?set_chunk_size@LASzip@@QEAA_NI@Z)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: char const * __cdecl LASzip::get_error(void)const " (?get_error@LASzip@@QEBAPEBDXZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: int __cdecl IntegerCompressor::decompress(int,unsigned int)" (?decompress@IntegerCompressor@@QEAAHHI@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: void __cdecl ArithmeticDecoder::done(void)" (?done@ArithmeticDecoder@@QEAAXXZ)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: void __cdecl ArithmeticEncoder::done(void)" (?done@ArithmeticEncoder@@QEAAXXZ)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: void __cdecl IntegerCompressor::compress(int,int,unsigned int)" (?compress@IntegerCompressor@@QEAAXHHI@Z)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: void __cdecl IntegerCompressor::initCompressor(void)" (?initCompressor@IntegerCompressor@@QEAAXXZ)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: void __cdecl IntegerCompressor::initDecompressor(void)" (?initDecompressor@IntegerCompressor@@QEAAXXZ)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticDecoder::ArithmeticDecoder(void)" (??0ArithmeticDecoder@@QEAA@XZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticDecoder::~ArithmeticDecoder(void)" (??1ArithmeticDecoder@@QEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticEncoder::ArithmeticEncoder(void)" (??0ArithmeticEncoder@@QEAA@XZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl ArithmeticEncoder::~ArithmeticEncoder(void)" (??1ArithmeticEncoder@@QEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl IntegerCompressor::IntegerCompressor(class ArithmeticDecoder *,unsigned int,unsigned int,unsigned int,unsigned int)" (??0IntegerCompressor@@QEAA@PEAVArithmeticDecoder@@IIII@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl IntegerCompressor::IntegerCompressor(class ArithmeticEncoder *,unsigned int,unsigned int,unsigned int,unsigned int)" (??0IntegerCompressor@@QEAA@PEAVArithmeticEncoder@@IIII@Z) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13writer.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl IntegerCompressor::~IntegerCompressor(void)" (??1IntegerCompressor@@QEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswaveform13reader.obj   1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASindex::LASindex(void)" (??0LASindex@@QEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASindex::~LASindex(void)" (??1LASindex@@QEAA@XZ)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASreadPoint::LASreadPoint(void)" (??0LASreadPoint@@QEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASreadPoint::~LASreadPoint(void)" (??1LASreadPoint@@QEAA@XZ)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASwritePoint::LASwritePoint(void)" (??0LASwritePoint@@QEAA@XZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASwritePoint::~LASwritePoint(void)" (??1LASwritePoint@@QEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswriter_las.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASzip::LASzip(void)" (??0LASzip@@QEAA@XZ)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreaderbuffered.obj 1   
    Error   LNK2001 unresolved external symbol "public: __cdecl LASzip::~LASzip(void)" (??1LASzip@@QEAA@XZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) const LASreader::`vftable'" (__imp_??_7LASreader@@6B@)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreader.obj 1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) public: bool __cdecl LASreader::read_point(void)" (__imp_?read_point@LASreader@@QEAA_NXZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreaderbuffered.obj 1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) public: class LASindex * __cdecl LASreader::get_index(void)const " (__imp_?get_index@LASreader@@QEBAPEAVLASindex@@XZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreaderpipeon.obj   1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) public: virtual bool __cdecl LASreader::has_layers(void)const " (__imp_?has_layers@LASreader@@UEBA_NXZ)   LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\lasreaderbuffered.obj 1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) public: virtual void __cdecl LASwriter::update_inventory(class LASpoint const *)" (__imp_?update_inventory@LASwriter@@UEAAXPEBVLASpoint@@@Z)  LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswritercompatible.obj   1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) public: virtual __cdecl LASwriter::~LASwriter(void)" (__imp_??1LASwriter@@UEAA@XZ)    LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswritercompatible.obj   1   
    Error   LNK2001 unresolved external symbol "__declspec(dllimport) public: __cdecl LASwriter::LASwriter(void)" (__imp_??0LASwriter@@QEAA@XZ) LasTools_lib    C:\Users\Vmdev\Documents\LasTools_lib\laswritercompatible.obj   1   

我还尝试使用作者代码编译来表示dll:

#define _WIN32 //I added this line

#ifndef _WIN32
#define LASLIB_DLL
#else  // _WIN32
#ifdef COMPILE_AS_DLL
#define LASLIB_DLL __declspec(dllexport)
#elif USE_AS_DLL
#define LASLIB_DLL __declspec(dllimport)
#else
#define LASLIB_DLL 
#endif
#endif // _WIN32

但也没有工作。

你有什么想法吗?

0 个答案:

没有答案