[Insight-users] strange linking problem
Ho Cheung
hocheung20 at gmail.com
Fri Jun 21 15:54:09 EDT 2013
>Why there is a "l" letter in front of every lib?
The "/l" option specifies to the linker what to link. The error messages
are telling you that it can't find the libraries to be linked, probably
because of various errors in your CMakeLists.txt file.
__________________________________________________________________________________
This line is not needed.
SET(DMITK CMAKE_CXX_FLAGS_RELEASE)
If you only want Release, you can do that by only building Release in the
Visual Studio IDE itself.
------------------------------------------------------------------------------------------------------------------------------------------------
I assume you are trying to link to some libraries in the following 2
directories?
INCLUDE_DIRECTORIES( C:/ITK/build/lib/Release )
INCLUDE_DIRECTORIES( C:/ProgramData/Gatan/DMSDK/
lib/x64 )
You need to use link_directories command if this is the case.
http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:link_directories
____________________________________________________________________________________
I don't think you need this last line.
LINK_LIBRARIES(${ITK_LIBRARIES} DMPlugInBasic.lib Foundation.lib)
____________________________________________________________________________________
Here is a pretty minimal example of a CMake file that demonstrates what
needs to be done to include ITK and link to it.
https://github.com/hocheung20/test_debug_assertion_performance/blob/master/CMakeLists.txt
Hope this helps,
Ho Cheung
hocheung20 at gmail.com
Cell: (775) 388-2368
On Fri, Jun 14, 2013 at 8:44 AM, barbababa <tonimuusimaki at gmail.com> wrote:
>
>
> Hi!
>
> i am only using cmakelists.txt file with cmake. That was just an example
> that someone else is using the .pro
> file. and that there is also that "l" issue.
>
> Anyways....
>
> I changed the cmakelists.txt
>
>
> PROJECT(DMITK)
>
> SET(DMITK CMAKE_CXX_FLAGS_RELEASE) # i want only release build. this does
> not help though
>
> INCLUDE_DIRECTORIES( C:/ITK/build/lib/Release )
> INCLUDE_DIRECTORIES( C:/ProgramData/Gatan/DMSDK/lib/x64 )
>
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
>
>
> ADD_LIBRARY(DMITK SHARED
> .
> .
> .)
>
>
> TARGET_LINK_LIBRARIES(DMITK ${ITK_LIBRARIES} DMPlugInBasic.lib
> Foundation.lib )
> LINK_LIBRARIES(${ITK_LIBRARIES} DMPlugInBasic.lib Foundation.lib)
>
>
> And everything seems to be included.
>
>
>
>
>
>
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/strange-linking-problem-tp7583295p7583314.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130621/7157135a/attachment.htm>
More information about the Insight-users
mailing list