[CMake] Cmake link trouble in Windows

张峰 fangler2012 at 126.com
Tue Oct 23 09:59:31 EDT 2012


hello:
     Thanks  for your help。 but now i am in another trouble.
In Windows,i am trying to build a shard library,It needs to link dynamic library and static library。
when i want to link a dynamic library,it  comes:
(fatal error U1073:does not know how to generate "ACE.lib")
 
AUX_SOURCE_DIRECTORY(. SRC)
ADD_LIBRARY(test  SHARED  ${FAN_SRC})
LINK_DIRECTORIES(${ACE_LIB_DIR})
TARGET_LINK_LIBRARIES(fan ACE)
 
1. Actually, "test" should link "ACE.dll",how to make test link to ACE.dll ?
 
2.if i use LINK_LIBRARIES() instead of TARGET_LINK_LIBRARIES(),this may work,why ??
 
AUX_SOURCE_DIRECTORY(. SRC)
LINK_DIRECTORIES(${ACE_LIB_DIR})
LINK_LIBRARIES(ACE)
ADD_LIBRARY(test SHARED ${FAN_SRC})
 
3.SeemsWindowswill give priority tolinkstatic library,but  i need to link dynamic library in my projects ,how could i do ??
 
4.how do TARGET_LINK_LIBRARIES() and LINK_LIBRARIES() determine what kind of library to link  ?  DO i need to use LINK_LIBRARIES(ACE.dll) instead of LINK_LIBRARIES(ACE)  in  Windows ?
 
Waiting for your letter.
With  Best Wishes !!
 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121023/83f179e8/attachment.htm>


More information about the CMake mailing list