<div dir="ltr">Your target_link_libraries line should use the variable ${VTK_LIBRARIES} instead of ${VTK_USE_FILE}.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 7, 2018 at 4:20 AM rolof <<a href="mailto:hitman-47fran@hotmail.com">hitman-47fran@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, I am trying to compile a source code to load a stl file. This source<br>
is inside of a folder in my dekstop, and I have not installed vtk, I have<br>
only built it.<br>
<br>
My Cmake file is the next:<br>
---------------------------------------------------------------------------------------------------------------<br>
# This is the root ITK CMakeLists file.<br>
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)<br>
foreach(p<br>
## Only policies introduced after the cmake_minimum_required<br>
## version need to explicitly be set to NEW.<br>
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.<br>
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED``<br>
files.<br>
)<br>
if(POLICY ${p})<br>
cmake_policy(SET ${p} NEW)<br>
endif()<br>
endforeach()<br>
<br>
<br>
set (CMAKE_CXX_STANDARD 11)<br>
<br>
# This project is designed to be built outside the Insight source tree.<br>
project(HelloWorld)<br>
# Find VTK.<br>
set( VTK_DIR "/home/fj/src_build/VTK-8.1.0" )<br>
FIND_PACKAGE (VTK REQUIRED)<br>
IF(VTK_FOUND)<br>
INCLUDE(${VTK_USE_FILE})<br>
ENDIF(VTK_FOUND)<br>
<br>
add_executable(loadStl load_STL_file.cpp)<br>
<br>
target_link_libraries(loadStl ${VTK_USE_FILE})<br>
---------------------------------------------------------------------------------------------------------------<br>
<br>
<br>
When I try to do the "make step" I obtain the next:<br>
---------------------------------------------------------------------------------------------------------------<br>
[ 50%] Building CXX object CMakeFiles/loadStl.dir/load_STL_file.cpp.o<br>
[100%] Linking CXX executable loadStl<br>
/home/fj/src_build/VTK-8.1.0/CMake/UseVTK.cmake: file not recognized:<br>
collect2: error: ld returned 1 exit status<br>
....<br>
---------------------------------------------------------------------------------------------------------------<br>
<br>
I do not know what I am doing wrong. Thanks in advance.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>