[CMake] Lnk 1104 with nmake, and the lib prefix

Alain Leblanc aalebl at gmail.com
Sun Sep 20 21:33:56 EDT 2009


Thanks for the reply. I'm experienced with GCC, but just really
starting with VC++, and I should probably spend more time learning it.

I am using FindBoost and I know it  finds my boost installation ok
otherwise cmake would fail. Since I sent my email, I noticed that my
boost lib directory contained all the boost_XXX.lib files, but not the
libboost_XXX.lib. Both versions of the files come with boost. So I
installed them but still no luck. However if in the add_library() call
I used the STATIC option instead of SHARED then the library would
build without problems.

So it is probably my understanding of how libraries are built on
windows that is not sufficient right now.

Alain

2009/9/20 Philip Lowman <philip at yhbt.com>:
> On Fri, Sep 18, 2009 at 6:51 PM, Alain Leblanc <aalebl at gmail.com> wrote:
>>
>> # Change the following to look for a particular version of boost
>> # With the current options nmake will look for the mt-gd-1_39, even though
>> # the mt-1_39 is there. Probably due to compiler options.
>>
>> set (BOOST_SUFFIX "-vc90-mt-gd-1_39")
>>
>> find_library(BOOST_REGEX      NAMES  boost_regex-mt
>> boost_regex${BOOST_SUFFIX}          PATHS ${LIBRARIES_SEARCH_PATH})
>> find_library(BOOST_FILESYSTEM NAMES  boost_filesystem-mt
>> boost_filesystem${BOOST_SUFFIX} PATHS ${LIBRARIES_SEARCH_PATH})
>> find_library(BOOST_SYSTEM     NAMES  boost_system-mt
>> boost_system${BOOST_SUFFIX}         PATHS ${LIBRARIES_SEARCH_PATH})
>> find_library(BOOST_DATETIME   NAMES  boost_date_time-mt
>> boost_date_time${BOOST_SUFFIX}   PATHS ${LIBRARIES_SEARCH_PATH})
>> find_library(BOOST_SYSTEM     NAMES  boost_system-mt
>> boost_system${BOOST_SUFFIX}       PATHS ${LIBRARIES_SEARCH_PATH})
>>
>> ...
>>
>> add_library(utility SHARED ${SRC_FILES})
>> target_link_libraries(utility   ${MATHSTAT} ${BOOST_LIBRARIES})
>>
>> where ${BOOST_LIBRARIES} is a list of all the BOOST_REGEX, etc
>>
>>
>> Am I missing something obvious here?
>
> I would double check your paths perhaps that's why it couldn't find the
> boost import library?
>
> You may also want to try out FindBoost.cmake.  It handles a lot of the
> details of searching for boost components like "filesystem", "system", etc.
> and it works crossplatform as well.
>
> --
> Philip Lowman
>


More information about the CMake mailing list