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> > &)" 
(??0lasrea...@liblas@@$$f...@aav?$basic_istream@du?$char_tra...@d@std@@@std@@@Z)
 referenced in function "int __cdecl main(int,char * * const)" 
(?main@@$$hyahhqa...@z)

1>LASReader.obj : error LNK2028: unresolved token (0A0003BE) "public: 
__thiscall liblas::LASReader::~LASReader(void)" 
(??1lasrea...@liblas@@$$f...@xz) referenced in function "int __cdecl 
main(int,char * * const)" (?main@@$$hyahhqa...@z)

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

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

1>LASReader.obj : error LNK2028: unresolved token (0A0003C1) "public: bool 
__thiscall liblas::LASReader::ReadNextPoint(void)" 
(?readnextpo...@lasreader@liblas@@$$FQAE_NXZ) referenced in function "int 
__cdecl main(int,char * * const)" (?main@@$$hyahhqa...@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 " 
(?getfilesignat...@lasheader@liblas@@$$fqbe?av?$basic_str...@du?$char_traits@d...@std@@v?$alloca...@d@2@@std@@XZ)
 referenced in function "int __cdecl main(int,char * * const)" 
(?main@@$$hyahhqa...@z)

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

1>LASReader.obj : error LNK2019: unresolved external symbol "public: __thiscall 
liblas::LASReader::~LASReader(void)" (??1lasrea...@liblas@@$$f...@xz) 
referenced in function "int __cdecl main(int,char * * const)" 
(?main@@$$hyahhqa...@z)

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

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

1>LASReader.obj : error LNK2019: unresolved external symbol "public: unsigned 
long __thiscall liblas::LASHeader::GetPointRecordsCount(void)const " 
(?getpointrecordsco...@lasheader@liblas@@$$FQBEKXZ) referenced in function "int 
__cdecl main(int,char * * const)" (?main@@$$hyahhqa...@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 " 
(?getfilesignat...@lasheader@liblas@@$$fqbe?av?$basic_str...@du?$char_traits@d...@std@@v?$alloca...@d@2@@std@@XZ)
 referenced in function "int __cdecl main(int,char * * const)" 
(?main@@$$hyahhqa...@z)

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

1>LASReader.obj : error LNK2019: unresolved external symbol "public: __thiscall 
liblas::LASReader::LASReader(class std::basic_istream<char,struct 
std::char_traits<char> > &)" 
(??0lasrea...@liblas@@$$f...@aav?$basic_istream@du?$char_tra...@d@std@@@std@@@Z)
 referenced in function "int __cdecl main(int,char * * const)" 
(?main@@$$hyahhqa...@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: [email protected] on behalf of Mateusz Loskot
Sent: Sat 12/19/2009 6:18 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [Liblas-devel] readLas linking problem



[email protected] 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
[email protected]
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: [email protected] on behalf of Black, Michael (IS)
Sent: Mon 12/21/2009 7:08 AM
To: Mateusz Loskot; [email protected]
Cc: [email protected]
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: [email protected] on behalf of Mateusz Loskot
Sent: Sat 12/19/2009 6:18 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [Liblas-devel] readLas linking problem



[email protected] 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
[email protected]
http://lists.osgeo.org/mailman/listinfo/liblas-devel


_______________________________________________
Liblas-devel mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/liblas-devel

Reply via email to