English 中文(简体)
CMake 发现有色图书馆。
原标题:CMake s find_library() apparently doesn t locate libraries

我希望CMake能在同一方面找到三个静态图书馆。 这是我的CMakeList的一部分。 t:

# Dependencies  directories
set(OGRE3D_DIR "D:/Data/Libs/ogre3D-1.10")

# Required libraries
find_library(OGREMAIN_LIB
        NAMES OgreMain OgreMain_d
        HINTS "${OGRE3D_DIR}/lib/${CMAKE_BUILD_TYPE}")

find_library(OGREOVERLAY_LIB
        NAMES OgreOverlay OgreOverlay_d
        HINTS "${OGRE3D_DIR}/lib/${CMAKE_BUILD_TYPE}")

find_library(OIS_LIB
        NAMES OIS OIS_d
        HINTS "${OGRE3D_DIR}/lib/${CMAKE_BUILD_TYPE}")

# Target
add_executable(Test Main.cpp)

# Library linking
target_link_libraries(Test
        ${OGREMAIN_LIB}
        ${OGREOVERLAY_LIB}
        ${OIS_LIB})

出于某种原因,以下三个变数:OGREMAIN_LIBOGRELAY_LIB_OIS_LIB 均已提交国家空间局,但如果我试图印刷这些变量,我发现这些变量符合预期的路径(即便是计算得当的名字与未填写的国名之间的正确名称)。 所有图书馆显然都在预期的道路上。

www.un.org/Depts/DGACM/index_spanish.htm 我在这里做了什么错误?

问题回答

添加“iCMAKE_SHARED_LIBRaire_PREFIX}和“{CMAKE_SHARED_LIBRaire_SUFFIX}”等内容:

find_library(OGREMAIN_LIB
    NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}OgreMain${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_PREFIX}OgreMain_d${CMAKE_SHARED_LIBRARY_SUFFIX}
    HINTS "${OGRE3D_LIB_DIR}")




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签