简体   繁体   中英

target platform supports only STATIC libraries not shared library issue

I am trying to compile c++ project on Redhat Linux 4.1.2 machine using Cmake utility. In CMakeLists.txt i have specfied GenericUSMModules as follows.

ADD_LIBRARY(
        GenericUSMModules SHARED 
          ../../Generic/GenericUSMModules/GMUSMActState.cpp
          ../../Generic/GenericUSMModules/GMUSMActState.h
          ../../Generic/GenericUSMModules/GMUSMAdditionalOfferChecksAndEdits.cpp
          ../../Generic/GenericUSMModules/GMUSMAdditionalOfferChecksAndEdits.h
          ../../Generic/GenericUSMModules/GMUSMAlignmentOfProductsConfigurationAndStrategicOrderManagerChecksAndEdits.cpp
          ../../Generic/GenericUSMModules/GMUSMAlignmentOfProductsConfigurationAndStrategicOrderManagerChecksAndEdits.h
          ../../Generic/GenericUSMModules/GMUSMAllSitePart2SiteChecksAndEdits.cpp

    )

when i run make command to compile c++ project , i got following error. "ADD_LIBRARY for library GenericUSMModules is used with the SHARED option, but the target platform supports only STATIC libraries. Building it STATIC instead. This may lead to problems." I am not able to understand meaning of platform doesn't support share library. because after compilation, it generate static library(GenericUSMModules.a) not share library(GenericUSMModules.so) please help me in this regard.

After lot of search i found that issue is due to incompatible cmake on RehHat Linux Machine. I installed latest cmake 2.8.8 on RedHat. It solved problem and now it generates share library(.so files).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM