[Liblas-devel] readLas linking problem

Black, Michael (IS) Michael.Black2 at ngc.com
Mon Dec 21 08:31:01 EST 2009


More info...
 
I did an update which installed SP1 to Visual C++ 2005 Express.
 
Now the build complains:
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

 

Using the /NODEFAULTLIB, of course, gives tons of unresolved references.
 
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?
 
1>------ Build started: Project: LASReader, Configuration: Debug Win32 ------

1>Linking...

1>LASReader.obj : error LNK2028: unresolved token (0A0003BD) "public: __thiscall liblas::LASReader::LASReader(class std::basic_istream<char,struct std::char_traits<char> > &)" (??0LASReader at liblas@@$$FQAE at AAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2028: unresolved token (0A0003BE) "public: __thiscall liblas::LASReader::~LASReader(void)" (??1LASReader at liblas@@$$FQAE at XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2028: unresolved token (0A0003BF) "public: class liblas::LASHeader const & __thiscall liblas::LASReader::GetHeader(void)const " (?GetHeader at LASReader@liblas@@$$FQBEABVLASHeader at 2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2028: unresolved token (0A0003C0) "public: class liblas::LASPoint const & __thiscall liblas::LASReader::GetPoint(void)const " (?GetPoint at LASReader@liblas@@$$FQBEABVLASPoint at 2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2028: unresolved token (0A0003C1) "public: bool __thiscall liblas::LASReader::ReadNextPoint(void)" (?ReadNextPoint at LASReader@liblas@@$$FQAE_NXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

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 at LASHeader@liblas@@$$FQBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2028: unresolved token (0A0003C3) "public: unsigned long __thiscall liblas::LASHeader::GetPointRecordsCount(void)const " (?GetPointRecordsCount at LASHeader@liblas@@$$FQBEKXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2019: unresolved external symbol "public: __thiscall liblas::LASReader::~LASReader(void)" (??1LASReader at liblas@@$$FQAE at XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2019: unresolved external symbol "public: class liblas::LASPoint const & __thiscall liblas::LASReader::GetPoint(void)const " (?GetPoint at LASReader@liblas@@$$FQBEABVLASPoint at 2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2019: unresolved external symbol "public: bool __thiscall liblas::LASReader::ReadNextPoint(void)" (?ReadNextPoint at LASReader@liblas@@$$FQAE_NXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2019: unresolved external symbol "public: unsigned long __thiscall liblas::LASHeader::GetPointRecordsCount(void)const " (?GetPointRecordsCount at LASHeader@liblas@@$$FQBEKXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

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 at LASHeader@liblas@@$$FQBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2019: unresolved external symbol "public: class liblas::LASHeader const & __thiscall liblas::LASReader::GetHeader(void)const " (?GetHeader at LASReader@liblas@@$$FQBEABVLASHeader at 2@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>LASReader.obj : error LNK2019: unresolved external symbol "public: __thiscall liblas::LASReader::LASReader(class std::basic_istream<char,struct std::char_traits<char> > &)" (??0LASReader at liblas@@$$FQAE at AAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD at Z)

1>C:\Documents and Settings\s360740.DIFL1ITE0017341\My Documents\Visual Studio 2005\Projects\LASReader\Debug\LASReader.exe : fatal error LNK1120: 14 unresolved externals

Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: liblas-devel-bounces at lists.osgeo.org on behalf of Mateusz Loskot
Sent: Sat 12/19/2009 6:18 AM
To: cristovao_jdc at sapo.pt
Cc: liblas-devel at lists.osgeo.org
Subject: Re: [Liblas-devel] readLas linking problem



cristovao_jdc at sapo.pt pisze:
> Hi Mateusz, thanks for your help,
>
> I am using Microsoft Visual C++ 2008 Express Edition. I have already
>  done all of these steps:
>
> -add liblas.lib as a additional library dependence;

OK

> -add msvcr80.dll and msvcrp80.dll to the Visual C++ bin folder

What do you do it for?
It should not be necessary at all!

> Then I builded it, with the Visual C++ compiler(with no errors). But,
>  after that, when i tried to run it, i had a "Runtime Error R6034" -
> "An application has made an attempt to load de C runtime library
> incorrectly"

Do not manipulate any of C/C++ run-time libraries.
Do not copy msvcr*dll anywhere.
Rebuild, try to run again.
If still not working, get free program called Dependency Walker
(depends.exe, google will show you where it is available)
and open your test program exe with depends.exe program and check
if it reports any missing runtime libraries (DLL modules).

> I searched about this on the internet, and i found a connection with
> the "manifests", but i can't solve the problem.

There is no need to touch manifest and copy C/C++ runtime libraries
anywhere. If you build libLAS binary using NMAKE and makefile.vc files
or Visual C++ projects, everything should be set correctly.


p.s. Please, post your replies to liblas-devel mailing list too
so others have chance to track the discussion.

Best regards,
--
Mateusz Loskot
http://mateusz.loskot.net <https://webmail.ngc.com/exchweb/bin/redir.asp?URL=http://mateusz.loskot.net/> 
_______________________________________________
Liblas-devel mailing list
Liblas-devel at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/liblas-devel <https://webmail.ngc.com/exchweb/bin/redir.asp?URL=http://lists.osgeo.org/mailman/listinfo/liblas-devel> 


 
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: liblas-devel-bounces at lists.osgeo.org on behalf of Black, Michael (IS)
Sent: Mon 12/21/2009 7:08 AM
To: Mateusz Loskot; cristovao_jdc at sapo.pt
Cc: liblas-devel at lists.osgeo.org
Subject: RE: [Liblas-devel] readLas linking problem


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.
 
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)).  
It's in Project/Properties/Linker/Manifest File/Generate Manifest
 
Clicking OK on that gives "Unhandled exception at 0x7d64c5be in LASReader.exe: 0XC0000142: DLL Initializaiton Failed"
 
 
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).
 
 
 
 
 
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: liblas-devel-bounces at lists.osgeo.org on behalf of Mateusz Loskot
Sent: Sat 12/19/2009 6:18 AM
To: cristovao_jdc at sapo.pt
Cc: liblas-devel at lists.osgeo.org
Subject: Re: [Liblas-devel] readLas linking problem



cristovao_jdc at sapo.pt pisze:
> Hi Mateusz, thanks for your help,
>
> I am using Microsoft Visual C++ 2008 Express Edition. I have already
>  done all of these steps:
>
> -add liblas.lib as a additional library dependence;

OK

> -add msvcr80.dll and msvcrp80.dll to the Visual C++ bin folder

What do you do it for?
It should not be necessary at all!

> Then I builded it, with the Visual C++ compiler(with no errors). But,
>  after that, when i tried to run it, i had a "Runtime Error R6034" -
> "An application has made an attempt to load de C runtime library
> incorrectly"

Do not manipulate any of C/C++ run-time libraries.
Do not copy msvcr*dll anywhere.
Rebuild, try to run again.
If still not working, get free program called Dependency Walker
(depends.exe, google will show you where it is available)
and open your test program exe with depends.exe program and check
if it reports any missing runtime libraries (DLL modules).

> I searched about this on the internet, and i found a connection with
> the "manifests", but i can't solve the problem.

There is no need to touch manifest and copy C/C++ runtime libraries
anywhere. If you build libLAS binary using NMAKE and makefile.vc files
or Visual C++ projects, everything should be set correctly.


p.s. Please, post your replies to liblas-devel mailing list too
so others have chance to track the discussion.

Best regards,
--
Mateusz Loskot
http://mateusz.loskot.net <http://mateusz.loskot.net/> 
_______________________________________________
Liblas-devel mailing list
Liblas-devel at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/liblas-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/liblas-devel/attachments/20091221/116a3661/attachment-0001.html


More information about the Liblas-devel mailing list