[vtkusers] Link error when building VTK with boost support in Visual Studio 2010

Hong Yi hongyi at renci.org
Sat Dec 11 22:52:27 EST 2010


Thanks, Jeff.

I don't get this error (i.e., fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_44.lib') any more after I turned off Windows 7 Account Access Control and rebuilt everything, so this error was caused by windows 7 Account Access Control. However, I got the following 3 linking errors:

8>BoostArrayLogWeighting.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkBoostLogWeighting * __cdecl vtkBoostLogWeighting::New(void)" (__imp_?New at vtkBoostLogWeighting@@SAPAV1 at XZ) referenced in function "public: static class vtkSmartPointer<class vtkBoostLogWeighting> __cdecl vtkSmartPointer<class vtkBoostLogWeighting>::New(void)" (?New@?$vtkSmartPointer at VvtkBoostLogWeighting@@@@SA?AV1 at XZ)
8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkBoostRandomSparseArraySource * __cdecl vtkBoostRandomSparseArraySource::New(void)" (__imp_?New at vtkBoostRandomSparseArraySource@@SAPAV1 at XZ) referenced in function "public: static class vtkSmartPointer<class vtkBoostRandomSparseArraySource> __cdecl vtkSmartPointer<class vtkBoostRandomSparseArraySource>::New(void)" (?New@?$vtkSmartPointer at VvtkBoostRandomSparseArraySource@@@@SA?AV1 at XZ)
8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall vtkBoostRandomSparseArraySource::SetExtents(class vtkArrayExtents const &)" (__imp_?SetExtents at vtkBoostRandomSparseArraySource@@QAEXABVvtkArrayExtents@@@Z) referenced in function "int __cdecl BoostArrayRandomSparseArraySource(int,char * * const)" (?BoostArrayRandomSparseArraySource@@YAHHQAPAD at Z)
8>C:\Users\hongyi.HONGYI-W510\VTK-CMake\bin\RelWithDebInfo\InfovisBoostArrayCxxTests.exe : fatal error LNK1120: 3 unresolved externals

Any suggestions on what additional libs I should include in the link property setup to make above three symbols resolved?

Another not-directly-related question: I have written a simple example using VTK and QT and it only works with release configuration with VTK built and installed with release configuration also. When I run the example with debug configuration, I got an error message "this application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors." I am new to VTK and read from the web that VTK should be installed with release configuration since the debug configuration does not work well, is that a true statement? I am currently using visual studio 2010 to build VTK 5.6 version. If I want my VTK+QT example to work with debug configuration, is there anything special I should do and be aware of? Thanks for any suggestions and guidelines on this.

Hong


From: Jeff Baumes [mailto:jeff.baumes at kitware.com]
Sent: Friday, December 10, 2010 1:00 PM
To: Hong Yi
Cc: VTK Users
Subject: Re: [vtkusers] Link error when building VTK with boost support in Visual Studio 2010

The flag is only available if you turn on certain other flags, so it sounds like it is not on. What library is being linked when you get this error?

Jeff
On Fri, Dec 10, 2010 at 12:08 PM, Hong Yi <hongyi at renci.org<mailto:hongyi at renci.org>> wrote:
I did not find VTK_USE_PARALLEL_BGL flag, only find VTK_USE_PARALLEL flag which is turned off. Two relevant flags, VTK_USE_BOOST and VTK_USE_TEXT_ANALYSIS flags, are turned on with VTK_USE_PARALLEL flag off. I am using CMake 2.8.3 and VTK 5.6. Is there an exact flag called VTK_USE_PARALLEL_BGL? I checked a couple of times but could not find it, for some reason...

Many thanks for the info,

Hong

From: Jeff Baumes [mailto:jeff.baumes at kitware.com<mailto:jeff.baumes at kitware.com>]
Sent: Friday, December 10, 2010 11:20 AM
To: Hong Yi
Cc: VTK Users
Subject: Re: [vtkusers] Link error when building VTK with boost support in Visual Studio 2010

Did you turn on VTK_USE_PARALLEL_BGL for processing graphs in parallel? That is the only reason it should be looking for the serialization library. If you turn off that flag it should be fine (in case you turned it on accidentally).

Jeff
On Fri, Dec 10, 2010 at 10:37 AM, Hong Yi <hongyi at renci.org<mailto:hongyi at renci.org>> wrote:
Hello,

I am trying to build VTK with boost support in Visual Studio 2010. I generated VTK solution/projects successfully using CMake, but when I build VTK solution in VS 2010, I got the following link error:

fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_44.lib'

I installed boost C++ library (version 1.44) using installer<http://www.boostpro.com/products/free> provided by BoostPro Computing<http://www.boostpro.com>. I selected all multi-threaded build variants when installing boost.

I cannot find any useful suggestions by googling to solve this link error and hope to get some advice from the list.

Thanks,

Hong

_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101212/d4816afe/attachment.htm>


More information about the vtkusers mailing list