[CMake] Cannot find the libstdc++ library on MinGW/MSYS when C++ is not enabled

Nils Gladitz nilsgladitz at gmail.com
Mon Feb 3 03:33:57 EST 2014


On 02/03/2014 07:36 AM, Alan W. Irwin wrote:
> I don't understand this result at all since with CMAKE_LIBRARY_PATH
> defined to the exact PATH where libstdc++.dll.a exists, I would think
> find_library would give identical results to the case when C++ is
> enabled (where presumably CMake is using a system location to find
> libstdc++.dll.a).

Looks like CMAKE_FIND_LIBRARY_PREFIXES and CMAKE_FIND_LIBRARY_SUFFIXES 
aren't set up with their required values unless any of the languages are 
enabled.

The setup is in Modules/Platform/Windows-GNU.cmake
Which gets included from e.g. Modules/Platform/Windows-GNU-CXX.cmake.

I am curious. What is your use case for wanting to locate libstdc++ this 
way (or at all)?

Nils


More information about the CMake mailing list