[vtkusers] fatal error LNK1181: cannot open input file 'vtkHybrid.lib'

Carl Trapani carl at skytopsoftware.com
Fri Oct 24 13:37:26 EDT 2008


AH HA ... (C++ dummies unite!). I never built VTK in Release mode, so 
there are no Release libs to link in, only Debug libs! I'm re-compiling 
VTK now as release...then I'll know for sure.

Here is how I discovered my problem:
In Visual Studio, right click on my project->Properties. Make sure the 
two drop downs at the top say Release and Win32 (maybe Active too). In 
the left panel tree, open
Configuration Properties->Linker->General
In the right hand pane, click in the Additional Library Directories and 
this is what is listed:

C:\projects\vtk\vtk-5.2\VTKBuild-MsVS9-StaticLink\bin\$(OutDir)

Perhaps someone else will benefit from this?
Carl

Carl Trapani wrote:
> Hi All,
>
> When I try and build my C++ application using Visual Studio 9 2008 on 
> Vista as a Release Win32 exe, I get the following link error:
>
> 1>------ Build started: Project: GRITS3DViewerVTK, Configuration: 
> Release Win32 ------
> 1>Compiling...
> 1>GRITS3DViewerVTK.cxx
> 1>Linking...
> 1>LINK : fatal error LNK1181: cannot open input file 'vtkHybrid.lib'
> 1>Build log was saved at 
> "file://c:\projects\bowdoin\source\GRITS3DViewerVTKBuild-MsVS9\GRITS3DViewerVTK.dir\Release\BuildLog.htm" 
>
> 1>GRITS3DViewerVTK - 1 error(s), 0 warning(s)
> 2>------ Skipped Build: Project: ALL_BUILD, Configuration: Release 
> Win32 ------
> 2>Project not selected to build for this solution configuration
> ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 1 skipped 
> ==========
>
> Anyone have suggestions?
>
> I can build the Debug solution without any problems. But when I try 
> and run the debug exe on another computer (XP), it can't resolve the 
> partial assembly VC90.DebugCRT.
>
> Below is more configuration info. Any help would be greatly appreciated.
>
> Carl
> -------------------------------------------------
>
> -VTK 5.2.0
>    SHARED_LIBS OFF
>    TESTING OFF
> everything else default
>
> -CMake 2.6.1
>
> -Visual Studio 9 2008
> Releases Win32
>
> =======BEGIN CMakeLists.txt for my application=============
> CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
> PROJECT(GRITS3DViewerVTK)
>
> #Find and include ITK package for registration
> #FIND_PACKAGE(ITK REQUIRED)
> #IF(ITK_FOUND)
> #  INCLUDE(${ITK_USE_FILE})
> #ENDIF(ITK_FOUND)
>
> #Find and include VTK package in order to load 3DS model
> FIND_PACKAGE(VTK REQUIRED)
> IF(VTK_FOUND)
>  INCLUDE(${VTK_USE_FILE})
> ENDIF(VTK_FOUND)
>
> #ADD_EXECUTABLE(ContourTest ContourTest.cxx)
> #TARGET_LINK_LIBRARIES(ContourTest vtkRendering vtkHybrid)
>
> #ADD_EXECUTABLE(ShiftScaleEx ShiftScaleEx.cxx)
> #TARGET_LINK_LIBRARIES(ShiftScaleEx vtkRendering vtkHybrid)
>
> ADD_EXECUTABLE(GRITS3DViewerVTK GRITS3DViewerVTK.cxx)
> TARGET_LINK_LIBRARIES(GRITS3DViewerVTK vtkRendering vtkHybrid)
> =======END CMakeLists.txt for my application=============
>
> =======BEGIN CMakeCache.txt for my application=============
> # This is the CMakeCache file.
> # For build in directory: 
> c:/projects/bowdoin/source/GRITS3DViewerVTKBuild-MsVS9
> # It was generated by CMake: C:/Program Files/CMake 2.6/bin/cmake.exe
> # You can edit this file to change values found and used by cmake.
> # If you do not want to change any of the values, simply exit the editor.
> # If you do want to change a value, simply edit, save, and exit the 
> editor.
> # The syntax for the file is as follows:
> # KEY:TYPE=VALUE
> # KEY is the name of a variable in the cache.
> # TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
> # VALUE is the current value for the KEY.
>
> ########################
> # EXTERNAL cache entries
> ########################
>
> //For backwards compatibility, what version of CMake commands and
> // syntax should this version of CMake try to support.
> CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4
>
> //Semicolon separated list of supported configuration types, only
> // supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
> // else will be ignored.
> CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
>
> //C++ compiler
> CMAKE_CXX_COMPILER:FILEPATH=cl
>
> //Flags used by the compiler during all build types.
> CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
>
> //Flags used by the compiler during debug builds.
> CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
>
> //Flags used by the compiler during release minsize builds.
> CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
>
> //Flags used by the compiler during release builds (/MD /Ob1 /Oi
> // /Ot /Oy /Gs will produce slightly less optimized but smaller
> // files).
> CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
>
> //Flags used by the compiler during Release with Debug Info builds.
> CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
>
> //Libraries linked by defalut with all C++ applications.
> CMAKE_CXX_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib 
> winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib 
> advapi32.lib '
>
> //C compiler
> CMAKE_C_COMPILER:FILEPATH=cl
>
> //Flags used by the compiler during all build types.
> CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000
>
> //Flags used by the compiler during debug builds.
> CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1
>
> //Flags used by the compiler during release minsize builds.
> CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
>
> //Flags used by the compiler during release builds (/MD /Ob1 /Oi
> // /Ot /Oy /Gs will produce slightly less optimized but smaller
> // files).
> CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
>
> //Flags used by the compiler during Release with Debug Info builds.
> CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
>
> //Libraries linked by defalut with all C applications.
> CMAKE_C_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib 
> winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib 
> advapi32.lib '
>
> //Flags used by the linker.
> CMAKE_EXE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
>
> //Flags used by the linker during debug builds.
> CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
>
> //Flags used by the linker during release minsize builds.
> CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
>
> //Flags used by the linker during release builds.
> CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
>
> //Flags used by the linker during Release with Debug Info builds.
> CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
>
> //Install path prefix, prepended onto install directories.
> CMAKE_INSTALL_PREFIX:PATH=C:/projects/bowdoin/source/GRITS3DViewerVTKInstall 
>
>
> //Path to a program.
> CMAKE_LINKER:FILEPATH=CMAKE_LINKER-NOTFOUND
>
> //make program
> CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~1.0/Common7/IDE/devenv.com
>
> //Flags used by the linker during the creation of modules.
> CMAKE_MODULE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
>
> //Flags used by the linker during debug builds.
> CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
>
> //Flags used by the linker during release minsize builds.
> CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
>
> //Flags used by the linker during release builds.
> CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
>
> //Flags used by the linker during Release with Debug Info builds.
> CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
>
> //RC compiler
> CMAKE_RC_COMPILER:FILEPATH=rc
>
> //Flags for Fortran compiler.
> CMAKE_RC_FLAGS:STRING=' '
>
> //Flags used by the linker during the creation of dll's.
> CMAKE_SHARED_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
>
> //Flags used by the linker during debug builds.
> CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
>
> //Flags used by the linker during release minsize builds.
> CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
>
> //Flags used by the linker during release builds.
> CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
>
> //Flags used by the linker during Release with Debug Info builds.
> CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
>
> //If set, runtime paths are not added when using shared libraries.
> CMAKE_SKIP_RPATH:BOOL=OFF
>
> //If true, cmake will use relative paths in makefiles and projects.
> CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
>
> //If this value is on, makefiles will be generated without the
> // .SILENT directive, and all commands will be echoed to the console
> // during the make.  This is useful for debugging only. With Visual
> // Studio IDE projects all commands are done without /nologo.
> CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
>
> //Single output directory for building all executables.
> EXECUTABLE_OUTPUT_PATH:PATH=
>
> //Value Computed by CMake
> GRITS3DViewerVTK_BINARY_DIR:STATIC=C:/projects/bowdoin/source/GRITS3DViewerVTKBuild-MsVS9 
>
>
> //Value Computed by CMake
> GRITS3DViewerVTK_SOURCE_DIR:STATIC=C:/projects/bowdoin/source/GRITS3DViewerVTK 
>
>
> //Single output directory for building all libraries.
> LIBRARY_OUTPUT_PATH:PATH=
>
> //Location of Tcl library imported from VTK.  This may mean your
> // project is depending on VTK to get this setting.  Consider using
> // FindTCL.cmake.
> TCL_LIBRARY:FILEPATH=
>
> //Location of Tk library imported from VTK.  This may mean your
> // project is depending on VTK to get this setting.  Consider using
> // FindTCL.cmake.
> TK_LIBRARY:FILEPATH=
>
> //The directory containing VTKConfig.cmake.  This is either the
> // root of the build tree, or PREFIX/lib/vtk for an installation.
> //  For VTK 4.0, this is the location of UseVTK.cmake.  This is
> // either the root of the build tree or PREFIX/include/vtk for
> // an installation.
> VTK_DIR:PATH=C:/projects/vtk/vtk-5.2/VTKBuild-MsVS9-StaticLink
>
>
> ########################
> # INTERNAL cache entries
> ########################
>
> //Stored GUID
> ALL_BUILD_GUID_CMAKE:INTERNAL=965322CF-D823-4667-BBB0-EC49821E7D6A
> //What is the target build tool cmake is generating for.
> CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~1/MICROS~1.0/Common7/IDE/devenv.com
> //This is the directory where this CMakeCahe.txt was created
> CMAKE_CACHEFILE_DIR:INTERNAL=c:/projects/bowdoin/source/GRITS3DViewerVTKBuild-MsVS9 
>
> //Major version of cmake used to create the current loaded cache
> CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
> //Minor version of cmake used to create the current loaded cache
> CMAKE_CACHE_MINOR_VERSION:INTERNAL=6
> //Major version of cmake used to create the current loaded cache
> CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 1
> //Path to CMake executable.
> CMAKE_COMMAND:INTERNAL=C:/Program Files/CMake 2.6/bin/cmake.exe
> //Advanced flag for variable: CMAKE_CONFIGURATION_TYPES
> CMAKE_CONFIGURATION_TYPES-ADVANCED:INTERNAL=1
> //Path to cpack program executable.
> CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/CMake 2.6/bin/cpack.exe
> //Path to ctest program executable.
> CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/CMake 2.6/bin/ctest.exe
> //Advanced flag for variable: CMAKE_CXX_COMPILER
> CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
> CMAKE_CXX_COMPILER_WORKS:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS
> CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
> CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
> CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
> CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
> CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_STANDARD_LIBRARIES
> CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_COMPILER
> CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
> CMAKE_C_COMPILER_WORKS:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS
> CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
> CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
> CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
> CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
> CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_STANDARD_LIBRARIES
> CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
> //Result of TRY_COMPILE
> CMAKE_DETERMINE_CXX_ABI_COMPILED:INTERNAL=TRUE
> //Result of TRY_COMPILE
> CMAKE_DETERMINE_C_ABI_COMPILED:INTERNAL=TRUE
> //Path to cache edit program executable.
> CMAKE_EDIT_COMMAND:INTERNAL=C:/Program Files/CMake 2.6/bin/CMakeSetup.exe
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
> CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
> CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
> CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
> CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
> CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Name of generator.
> CMAKE_GENERATOR:INTERNAL=Visual Studio 9 2008
> //Start directory with the top level CMakeLists.txt file for this
> // project
> CMAKE_HOME_DIRECTORY:INTERNAL=C:/projects/bowdoin/source/GRITS3DViewerVTK
> //Advanced flag for variable: CMAKE_LINKER
> CMAKE_LINKER-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MAKE_PROGRAM
> CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
> CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
> CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
> CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
> CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
> CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //number of local generators
> CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1
> //Advanced flag for variable: CMAKE_RC_COMPILER
> CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
> CMAKE_RC_COMPILER_WORKS:INTERNAL=1
> //Advanced flag for variable: CMAKE_RC_FLAGS
> CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
> //Path to CMake installation.
> CMAKE_ROOT:INTERNAL=C:/Program Files/CMake 2.6/share/cmake-2.6
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
> CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
> CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
> CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
> CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
> CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SKIP_RPATH
> CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
> //Suppress Warnings that are meant for the author of the CMakeLists.txt
> // files.
> CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE
> //Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS
> CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
> CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
> //Stored GUID
> EDIT_CACHE_GUID_CMAKE:INTERNAL=C6F4E27D-B362-4A7C-8E79-F6B0BC3B7C4B
> //Stored GUID
> GRITS3DViewerVTK_GUID_CMAKE:INTERNAL=57AAD75C-E6AD-472F-A0F4-9E69D795275C
> //Stored GUID
> INSTALL_GUID_CMAKE:INTERNAL=B8BB866F-7D76-4482-AD6B-C7DCF3A5647D
> //Stored GUID
> PACKAGE_GUID_CMAKE:INTERNAL=C8E9B164-C7E0-4715-A37D-09A61C3F6BEC
> //Stored GUID
> REBUILD_CACHE_GUID_CMAKE:INTERNAL=F894634F-89E8-4E4C-A2F9-B2FF620F76F5
> //Stored GUID
> RUN_TESTS_GUID_CMAKE:INTERNAL=DE906442-FBCE-44C5-8450-1F2A796812A5
> //Advanced flag for variable: TCL_LIBRARY
> TCL_LIBRARY-ADVANCED:INTERNAL=1
> //Advanced flag for variable: TK_LIBRARY
> TK_LIBRARY-ADVANCED:INTERNAL=1
> //Stored GUID
> ZERO_CHECK_GUID_CMAKE:INTERNAL=66571DD3-76FA-4C84-9527-E0B30427C11E
> =======END CMakeCache.txt for my application=============
> _______________________________________________
> 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