[Liblas-devel] Linker errors with Windows import library in v1.2.1

James Domingo jdomingo at green-code.com
Fri Nov 13 21:05:25 EST 2009


I've created a simple console project in VC++ 2008 (express) with the
code from the libLAS C++ tutorial:

 #include <liblas/lasreader.hpp>
 #include <fstream>  // std::ifstream
 #include <iostream> // std::cout

 int main(int argc, char* argv[])
 {
   std::ifstream ifs;
   ifs.open(argv[1], std::ios::in | std::ios::binary);
   liblas::LASReader reader(ifs);
   liblas::LASHeader const& header = reader.GetHeader();
   std::cout << "Signature: " << header.GetFileSignature() << '\n';
   std::cout << "Points count: " << header.GetPointRecordsCount() << '\n';
   return 0;
 }

The code compiles and links successfully if I specify the static liblas
library as an additional dependency to the linker:

 Linker:
  Additional Dependencies: liblas.lib

However, if I change that dependency to the Windows import library
(liblas_i.lib) for the liblas1.dll, the linker reports unresolved symbol
errors:

 "public: __thiscall liblas::LASReader::~LASReader(void)"
 (??1LASReader at liblas@@QAE at XZ)
 
 "public: unsigned long __thiscall
 liblas::LASHeader::GetPointRecordsCount(void)const"
 (?GetPointRecordsCount at LASHeader@liblas@@QBEKXZ)

 "public: class std::basic_string<char,struct std::char_traits<char>,
 class std::allocator<char> > __thiscall
 liblas::LASHeader::GetFileSignature(void)const " 
 (?GetFileSignature at LASHeader@liblas@@QBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ) 

 "public: class liblas::LASHeader const & __thiscall
 liblas::LASReader::GetHeader(void)const "
 (?GetHeader at LASReader@liblas@@QBEABVLASHeader at 2@XZ)

 "public: __thiscall liblas::LASReader::LASReader(
 class std::basic_istream<char,struct std::char_traits<char> > &)"
 (??0LASReader at liblas@@QAE at AAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)

Is there something else that's needed to link with the libLAS dll?

Jimm
-- 
James Domingo
Green Code LLC


More information about the Liblas-devel mailing list