[vtkusers] kwsys in custom source

Patrick D. Emond patrickdemond at gmail.com
Tue Mar 11 13:07:46 EDT 2008


Hi Brad,

I'm working with Dean on this.  I've created a LocalUserOptions.cmake 
file in the root of my VTK build with the following in it:

SET(KWSYS_USE_FundamentalType 1)
SET(KWSYS_USE_SystemInformation 1)

(FundamentalType was needed by SystemInformation)

I make installed VTK as a shared build (and confirmed that vtksys.dll 
was found in the install bin directory).  From here I've built an 
application that uses the SystemInformation code and I get the following 
linker errors:

MPRViewer.obj : error LNK2019: unresolved external symbol "public: 
__thiscall vtksys::SystemInformation::~SystemInformation(void)" 
(??1SystemInformation at vtksys@@QAE at XZ) referenced in function "int 
__cdecl my_main(int,char * * const)" (?my_main@@YAHHQAPAD at Z)
MPRViewer.obj : error LNK2019: unresolved external symbol "public: 
unsigned long __thiscall 
vtksys::SystemInformation::GetAvailablePhysicalMemory(void)" 
(?GetAvailablePhysicalMemory at SystemInformation@vtksys@@QAEKXZ) 
referenced in function "int __cdecl my_main(int,char * * const)" 
(?my_main@@YAHHQAPAD at Z)
MPRViewer.obj : error LNK2019: unresolved external symbol "public: 
unsigned long __thiscall 
vtksys::SystemInformation::GetTotalPhysicalMemory(void)" 
(?GetTotalPhysicalMemory at SystemInformation@vtksys@@QAEKXZ) referenced in 
function "int __cdecl my_main(int,char * * const)" (?my_main@@YAHHQAPAD at Z)

(there are actually quite a few more, but they all complain about 
vtksys::SystemInformation so I've left them out)

My system path definitely points to the directory that contains the 
vtksys.dll file, so I'm not sure why my linker can't find 
vtksys::SystemInformation.

Any thoughts?

Brad King wrote:
> Dean Inglis wrote:
>> I copied kwsys from ITK into our project Utilities dir and 
>> modelled the CMakeLists.txt in Utilities also after that in ITK.
>> Everything works in static mode but in a shared build we are
>> getting linker errors.
> 
> I'd have to see the specific errors to help with that.  However since
> you already have your own VTK build the approach below is probably easier.
> 
>> If we use a LocalUserOptions.cmake,
>> would that file be added to the root of the vtk build tree
>> and have in it any KWSYS_USE_foo's set to 1 that we want?
>> e.g., 
>> SET(KWSYS_USE_SystemInformation 1)
> 
> This is correct.  I have not tried it but I see no reason why it would
> not work.
> 
> -Brad
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list