[CMake] find_library can't find dll in system32 directory

aaron.meadows at thomsonreuters.com aaron.meadows at thomsonreuters.com
Wed Jun 22 09:44:05 EDT 2011


This may be an issue with CMake being 32bit.  32bit programs on 64bit
windows get run in a sort of sandbox (you probably already know this, so
don't be offended if you do!).  To a 32bit program on 64bit windows, I
believe the c:/windows/system32 directory is secretly the
c:/windows/syswow64 directory.  I wonder if you compile a 64bit version
of CMake if it would find the 64bit library correctly?

Aaron C. Meadows 

-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf
Of Stiaan Gerber
Sent: Wednesday, June 22, 2011 5:43 AM
To: cmake at cmake.org
Subject: [CMake] find_library can't find dll in system32 directory

Hi all

On 64-bit Windows 7

I am trying to use the find_library command to locate a 64-bit mpich2
dll in the C:/Windows/System32 directory. I use

find_library (MPI_LIB fmpich2g PATHS "C:/Windows/System32")

This command fails to find the dll. However, if I also install 32-bit
mpich2 so that C:/Windows/SysWOW64/fmpich2g.dll exists,
the command works and MPI_LIB is set to C:/Windows/System32/fmpich2g.dll
which is actually my 64-bit dll.

So the way I see it, find_library can only "find" my 64-bit dll if a
corresponding 32-bit dll is present. I have seen a previous thread on
this subject (http://www.mail-archive.com/cmake@cmake.org/msg29248.html)
which explains that Windows actually reports the path
of the 32-bit dll as C:/Windows/System32, but this does not solve my
problem:

How do I correctly find the 64-bit version of a dll in
C:/Windows/System32 without the 32-bit dll existing?

Any insights would be much appreciated.

Kind regards
Stiaan Gerber
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list