<HTML dir=ltr><HEAD><TITLE>Re: [Liblas-devel] readLas linking problem</TITLE>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18854"></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText39572>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>
<DIV dir=ltr id=idOWAReplyText79283>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>More info...</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>I did an update which installed SP1 to Visual C++ 2005 Express.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Now the build complains:</FONT></DIV>
<DIV dir=ltr><FONT size=1>
<P>1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library</P>
<P></FONT> </P></DIV></DIV>
<DIV dir=ltr id=idSignature3020>
<DIV><FONT color=#000000 size=2 face=Arial>Using the /NODEFAULTLIB, of course, gives tons of unresolved references.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>If you link against liblas_i.lib instead you get all the C++ references unresolved -- didn't we determine before that the C++ functions were separate?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=1>
<P>1>------ Build started: Project: LASReader, Configuration: Debug Win32 ------</P>
<P>1>Linking...</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003BD) "public: __thiscall liblas::LASReader::LASReader(class std::basic_istream<char,struct std::char_traits<char> > &)" (??0LASReader@liblas@@$$FQAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003BE) "public: __thiscall liblas::LASReader::~LASReader(void)" (??1LASReader@liblas@@$$FQAE@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003BF) "public: class liblas::LASHeader const & __thiscall liblas::LASReader::GetHeader(void)const " (?GetHeader@LASReader@liblas@@$$FQBEABVLASHeader@2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003C0) "public: class liblas::LASPoint const & __thiscall liblas::LASReader::GetPoint(void)const " (?GetPoint@LASReader@liblas@@$$FQBEABVLASPoint@2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003C1) "public: bool __thiscall liblas::LASReader::ReadNextPoint(void)" (?ReadNextPoint@LASReader@liblas@@$$FQAE_NXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003C2) "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall liblas::LASHeader::GetFileSignature(void)const " (?GetFileSignature@LASHeader@liblas@@$$FQBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2028: unresolved token (0A0003C3) "public: unsigned long __thiscall liblas::LASHeader::GetPointRecordsCount(void)const " (?GetPointRecordsCount@LASHeader@liblas@@$$FQBEKXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: __thiscall liblas::LASReader::~LASReader(void)" (??1LASReader@liblas@@$$FQAE@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: class liblas::LASPoint const & __thiscall liblas::LASReader::GetPoint(void)const " (?GetPoint@LASReader@liblas@@$$FQBEABVLASPoint@2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: bool __thiscall liblas::LASReader::ReadNextPoint(void)" (?ReadNextPoint@LASReader@liblas@@$$FQAE_NXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: unsigned long __thiscall liblas::LASHeader::GetPointRecordsCount(void)const " (?GetPointRecordsCount@LASHeader@liblas@@$$FQBEKXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall liblas::LASHeader::GetFileSignature(void)const " (?GetFileSignature@LASHeader@liblas@@$$FQBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: class liblas::LASHeader const & __thiscall liblas::LASReader::GetHeader(void)const " (?GetHeader@LASReader@liblas@@$$FQBEABVLASHeader@2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>LASReader.obj : error LNK2019: unresolved external symbol "public: __thiscall liblas::LASReader::LASReader(class std::basic_istream<char,struct std::char_traits<char> > &)" (??0LASReader@liblas@@$$FQAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)</P>
<P>1>C:\Documents and Settings\s360740.DIFL1ITE0017341\My Documents\Visual Studio 2005\Projects\LASReader\Debug\LASReader.exe : fatal error LNK1120: 14 unresolved externals</P></FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial>Michael D. Black</FONT></DIV>
<DIV><FONT size=2 face=Arial>Senior Scientist</FONT></DIV>
<DIV><FONT size=2 face=Arial>Northrop Grumman Mission Systems</FONT></DIV>
<DIV> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> liblas-devel-bounces@lists.osgeo.org on behalf of Mateusz Loskot<BR><B>Sent:</B> Sat 12/19/2009 6:18 AM<BR><B>To:</B> cristovao_jdc@sapo.pt<BR><B>Cc:</B> liblas-devel@lists.osgeo.org<BR><B>Subject:</B> Re: [Liblas-devel] readLas linking problem<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>cristovao_jdc@sapo.pt pisze:<BR>> Hi Mateusz, thanks for your help,<BR>><BR>> I am using Microsoft Visual C++ 2008 Express Edition. I have already<BR>> done all of these steps:<BR>><BR>> -add liblas.lib as a additional library dependence;<BR><BR>OK<BR><BR>> -add msvcr80.dll and msvcrp80.dll to the Visual C++ bin folder<BR><BR>What do you do it for?<BR>It should not be necessary at all!<BR><BR>> Then I builded it, with the Visual C++ compiler(with no errors). But,<BR>> after that, when i tried to run it, i had a "Runtime Error R6034" -<BR>> "An application has made an attempt to load de C runtime library<BR>> incorrectly"<BR><BR>Do not manipulate any of C/C++ run-time libraries.<BR>Do not copy msvcr*dll anywhere.<BR>Rebuild, try to run again.<BR>If still not working, get free program called Dependency Walker<BR>(depends.exe, google will show you where it is available)<BR>and open your test program exe with depends.exe program and check<BR>if it reports any missing runtime libraries (DLL modules).<BR><BR>> I searched about this on the internet, and i found a connection with<BR>> the "manifests", but i can't solve the problem.<BR><BR>There is no need to touch manifest and copy C/C++ runtime libraries<BR>anywhere. If you build libLAS binary using NMAKE and makefile.vc files<BR>or Visual C++ projects, everything should be set correctly.<BR><BR><BR>p.s. Please, post your replies to liblas-devel mailing list too<BR>so others have chance to track the discussion.<BR><BR>Best regards,<BR>--<BR>Mateusz Loskot<BR><A href="https://webmail.ngc.com/exchweb/bin/redir.asp?URL=http://mateusz.loskot.net/" target=_blank>http://mateusz.loskot.net</A><BR>_______________________________________________<BR>Liblas-devel mailing list<BR>Liblas-devel@lists.osgeo.org<BR><A href="https://webmail.ngc.com/exchweb/bin/redir.asp?URL=http://lists.osgeo.org/mailman/listinfo/liblas-devel" target=_blank>http://lists.osgeo.org/mailman/listinfo/liblas-devel</A><BR></FONT></P></DIV></FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial></FONT> </DIV></DIV>
<DIV dir=ltr id=idSignature74790>
<DIV><FONT color=#000000 size=2 face=Arial>Michael D. Black</FONT></DIV>
<DIV><FONT size=2 face=Arial>Senior Scientist</FONT></DIV>
<DIV><FONT size=2 face=Arial>Northrop Grumman Mission Systems</FONT></DIV>
<DIV> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> liblas-devel-bounces@lists.osgeo.org on behalf of Black, Michael (IS)<BR><B>Sent:</B> Mon 12/21/2009 7:08 AM<BR><B>To:</B> Mateusz Loskot; cristovao_jdc@sapo.pt<BR><B>Cc:</B> liblas-devel@lists.osgeo.org<BR><B>Subject:</B> RE: [Liblas-devel] readLas linking problem<BR></FONT><BR></DIV>
<DIV dir=ltr>
<DIV dir=ltr id=idOWAReplyText52789>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>I duplicated his problem. With Visual C++ 2005 Express the default Debug build has the R6034 problem. The release build is fine. This is with linking against liblas.lib in the binary distribution.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>If you turn off the "Manifest" in the build the debug version gets further but comes up with "The application failed to initialize properly (0xc0000142)).
<DIV dir=ltr><FONT size=2 face=Arial>It's in Project/Properties/Linker/Manifest File/Generate Manifest</FONT></DIV></FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Clicking OK on that gives "Unhandled exception at 0x7d64c5be in LASReader.exe: 0XC0000142: DLL Initializaiton Failed"</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>P.S. I've been using liblas with Code::Blocks with no problem. First time I've tried Visual C++ with it (or the C++ interface -- I've been using the C interface).</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial></FONT> </DIV></DIV>
<DIV dir=ltr id=idSignature58813>
<DIV><FONT color=#000000 size=2 face=Arial>Michael D. Black</FONT></DIV>
<DIV><FONT size=2 face=Arial>Senior Scientist</FONT></DIV>
<DIV><FONT size=2 face=Arial>Northrop Grumman Mission Systems</FONT></DIV>
<DIV> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> liblas-devel-bounces@lists.osgeo.org on behalf of Mateusz Loskot<BR><B>Sent:</B> Sat 12/19/2009 6:18 AM<BR><B>To:</B> cristovao_jdc@sapo.pt<BR><B>Cc:</B> liblas-devel@lists.osgeo.org<BR><B>Subject:</B> Re: [Liblas-devel] readLas linking problem<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>cristovao_jdc@sapo.pt pisze:<BR>> Hi Mateusz, thanks for your help,<BR>><BR>> I am using Microsoft Visual C++ 2008 Express Edition. I have already<BR>> done all of these steps:<BR>><BR>> -add liblas.lib as a additional library dependence;<BR><BR>OK<BR><BR>> -add msvcr80.dll and msvcrp80.dll to the Visual C++ bin folder<BR><BR>What do you do it for?<BR>It should not be necessary at all!<BR><BR>> Then I builded it, with the Visual C++ compiler(with no errors). But,<BR>> after that, when i tried to run it, i had a "Runtime Error R6034" -<BR>> "An application has made an attempt to load de C runtime library<BR>> incorrectly"<BR><BR>Do not manipulate any of C/C++ run-time libraries.<BR>Do not copy msvcr*dll anywhere.<BR>Rebuild, try to run again.<BR>If still not working, get free program called Dependency Walker<BR>(depends.exe, google will show you where it is available)<BR>and open your test program exe with depends.exe program and check<BR>if it reports any missing runtime libraries (DLL modules).<BR><BR>> I searched about this on the internet, and i found a connection with<BR>> the "manifests", but i can't solve the problem.<BR><BR>There is no need to touch manifest and copy C/C++ runtime libraries<BR>anywhere. If you build libLAS binary using NMAKE and makefile.vc files<BR>or Visual C++ projects, everything should be set correctly.<BR><BR><BR>p.s. Please, post your replies to liblas-devel mailing list too<BR>so others have chance to track the discussion.<BR><BR>Best regards,<BR>--<BR>Mateusz Loskot<BR><A href="http://mateusz.loskot.net/">http://mateusz.loskot.net</A><BR>_______________________________________________<BR>Liblas-devel mailing list<BR>Liblas-devel@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/liblas-devel">http://lists.osgeo.org/mailman/listinfo/liblas-devel</A><BR></FONT></P></DIV></DIV></BODY></HTML>