English 中文(简体)
在连接图书馆时为中链和窗户创造条件
原标题:making conditions for linux and windows when linking libraries
  • 时间:2010-05-06 09:07:26
  •  标签:
  • cmake

Windows VC++ 2008 linux gcc 4.4.3

我有以下问题。 当我用窗户汇编时,需要2-32间图书馆。 然而,当我编纂时,我不需要把这一点联系起来。

INCLUDE_DIRECTORIES($CLIENT_SERVER_SOURCE_DIR/client)
INCLUDE_DIRECTORIES($CLIENT_SERVER_SOURCE_DIR/cltsvr_ults)

# Link the library
LINK_DIRECTORIES($CLIENT_SERVER_DIR/client)

# Add the executable 
ADD_EXECUTABLE(clt test_clt)

# Link the executable to the client library
IF(WIN32)
    TARGET_LINK_LIBRARIES(clt client ws2_32)
ENDIF(WIN32)

IF(CMAKE_COMPILER_IS_GNUCXXX)
  TARGET_LINK_LIBRARIES(clt client)
ENDIF(CMAKE_COMPILER_IS_GNUCXXX)

我试图根据子午线进行汇编,但没有成功。 采用上述条件。 然而, 它总是试图将头号2-32连接起来,我有汇编错误。 我认为,这些条件并不奏效,因为总是通过WIN32的条件。

许多人感谢任何建议,

最佳回答

自<代码>WIN32以来 我猜测,这比你提到的情况更多。

您是否对您的代码进行了清点,或只是复制了整个关于持久性有机污染物的目录? 如果你们所有的CMake都从窗户建造文件,也许会(或许!) 那里有人 s,而“探测”本身则像WIN32号关于含水层吗?

你们是否确信,这行不通,而不是导致与温-布拉拉角连接的东西? Maybetries a MESSAGE(STATUS "I am here”)line within the IF (WIN32) only to ensure。

您是否确信这一错误是连接该图书馆所致? 可在您的书中看到一个打字体,该打字体应为。 也许你没有把你的东西联系起来,这就是为什么失败。

问题回答

暂无回答




相关问题
Why can t CLion see header files, WSL2 toolchain?

My setup: Windows 10 Pro 22H2 (19045.2965) CLion 2020.1.3 (JetBrains) WSL2 with Ubuntu 22.04.2 LTS gcc 11.3.0 cmake 3.22.1 gdb 12.1 gmake 4.3 CMakeLists.txt cmake_minimum_required(VERSION 3.22)...

CMake linking problem

I am trying to use CMake to compile a C++ application that uses the C library GStreamer. My main.cpp file looks like this: extern "C" { #include <gst/gst.h> #include <glib.h> } int main(...

How to add an extra plist property using CMake?

I m trying to add the item <key>UIStatusBarHidden</key><true/> to my plist that s auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; ...

(c)make - resursive compile

Let s assume I have directories like: dir1 main.cpp dir2 abc.cpp dir3 def.cpp dir4 ghi.cpp jkl.cpp And let s assume that main.cpp ...

Reading registry values with cmake

On a Windows 7 machine I cannot read any registry values that contain a semicolon. For example if you have 7-zip, running the following SET(MYPATH [HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip;Path]) ...

Finding the correct Python framework with cmake

I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using ...