简体   繁体   中英

error installing c++ mySQL connector

I'm trying to install a C++ MySQL connector on a centOS 6.4 64bit machine.
I've installed MySQL 5.6 ( a server and client component, and an additional shared component in order to get the mysqlclient.s0 libraries ) It seems to work fine.

On the site I've found the following file :
Red Hat/Oracle Enterprise Linux ver. 6 (x86, 64-bit), Compressed TAR Archive After reading the INSTALL file I've tried to invoke cmake . , but got an error about a missing CMakeLists.txt.
Later I found out I need the actual source code in the drop down pane :
Generic Linux (Architecture Independent), Compressed TAR Archive there is a CMakeLists.txt file in the directory of the the source code
and I am able to run : cmake .

  • why is there also the platform specific download ?
  • Can I get by with only the source code ?

when I run cmake . from the directory, I get the following output:

CMake Warning (dev) in CMakeLists.txt: A logical block opening on the line

 /home/mysql-connector-c++-1.1.3-linux-el6-x86-64bit/source/CMakeLists.txt:39 

(if)

closes on the line

 /home/mysql-connector-c++-1.1.3-linux-el6-x86-64bit/source/CMakeLists.txt:41 

(endif)

with mis-matching arguments. This warning is for project developers. Use -Wno-dev to suppress it.

-- Environment compile flags:
-- Environment link flags: CMake Error at CMakeLists.txt:120 (MESSAGE): Boost or some of its libraries found. If not in standard place please set -DBOOST_ROOT:STRING=

-- Configuring incomplete, errors occurred!

this is the content of lines around line CMakeLists.txt:39-41 :

if(COMMAND cmake_policy AND POLICY CMP0015)
    cmake_policy(SET CMP0015 NEW)
endif(COMMAND cmake_policy)

this is the content of lines around line CMakeLists.txt:120 :

IF(NOT Boost_FOUND)
    # Try dynamic
    set(Boost_USE_STATIC_LIBS FALSE)
    FIND_PACKAGE(Boost COMPONENTS ${MYSQLCPPCONN_BOOST_COMPONENTS})
    IF(NOT Boost_FOUND)
        MESSAGE(FATAL_ERROR "Boost or some of its libraries found. If not in standard place please set -DBOOST_ROOT:STRING=")
    ENDIF(NOT Boost_FOUND)
ENDIF(NOT Boost_FOUND)
  • I don't understand. did it find the boost components or it didn't ? and if it did, why is this an error?
  • I've installed/updated boost components with : yum install boost this is the output of a :

    find / -name boost

    /usr/lib64/libboost_system-mt.so.5 /usr/lib64/libboost_system.so.5 /usr/lib64/libboost_graph-mt.so.5 /usr/lib64/libboost_filesystem-mt.so.5 /usr/lib64/libboost_date_time-mt.so.5 /usr/lib64/libboost_wserialization-mt.so.5 /usr/lib64/libboost_unit_test_framework.so.5 /usr/lib64/libboost_filesystem.so.5 /usr/lib64/libboost_prg_exec_monitor.so.5 /usr/lib64/libboost_signals-mt.so.5 /usr/lib64/libboost_date_time.so.5 /usr/lib64/libboost_regex.so.5 /usr/lib64/libboost_prg_exec_monitor-mt.so.5 /usr/lib64/libboost_wave-mt.so.5 /usr/lib64/libboost_serialization-mt.so.5 /usr/lib64/libboost_program_options-mt.so.5 /usr/lib64/libboost_graph.so.5 /usr/lib64/libboost_signals.so.5 /usr/lib64/libboost_python.so.5 /usr/lib64/libboost_iostreams.so.5 /usr/lib64/libboost_serialization.so.5 /usr/lib64/libboost_python-mt.so.5 /usr/lib64/libboost_unit_test_framework-mt.so.5 /usr/lib64/libboost_iostreams-mt.so.5 /usr/lib64/libboost_program_options.so.5 /usr/lib64/libboost_regex-mt.so.5 /usr/lib64/libboost_thre ad-mt.so.5 /usr/lib64/libboost_wserialization.so.5 /usr/include/c++/4.4.4/tr1_impl/boost_sp_counted_base.h /usr/include/c++/4.4.4/bits/boost_concept_check.h /usr/share/icons/oxygen/22x22/actions/mixer-microphone-front-boost.png /usr/share/icons/oxygen/22x22/actions/mixer-microphone-boost.png /usr/share/doc/boost-regex-1.41.0 /usr/share/doc/boost-signals-1.41.0 /usr/share/doc/boost-system-1.41.0 /usr/share/doc/boost-iostreams-1.41.0 /usr/share/doc/boost-thread-1.41.0 /usr/share/doc/boost-filesystem-1.41.0 /usr/share/doc/boost-program-options-1.41.0 /usr/share/doc/boost-test-1.41.0 /usr/share/doc/boost-wave-1.41.0 /usr/share/doc/boost-date-time-1.41.0 /usr/share/doc/boost-python-1.41.0 /usr/share/doc/boost-serialization-1.41.0 /usr/share/doc/boost-graph-1.41.0 /var/lib/yum/yumdb/b/c353df239962740ed530d499bb76180201aa8a1f-boost-program-options-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/b2292fc632d0f893a2efc41c077bcc88a83649cc-boost-filesystem-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/1 37b574a8590a642229c2eaa20c0c98bd4c367e8-boost-python-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/54cc53886ae5c9f0a36e3e55abe8cc44d30b0c88-boost-date-time-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/b17dfa289b3c0e615f7e598c288dbc09dcce09b6-boost-wave-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/5cca310e29fc5639ae673069c639327b03029c2e-boost-serialization-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/c5bea6cfd9e95fb42d1ff7ff26068f52dde8d3c0-boost-test-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/4426c89bd11acd85e92fb4eafe011351944a81ea-boost-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/e6fddb18e7fd66b59d3cb6aa5061436592ee81ef-boost-iostreams-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/6b2fcabdebbbf0f3dda98bad6ea4c259b366f571-boost-signals-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/8bda127d59cc392fe94ec251d3514c7512100333-boost-system-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/d75110a5f95a50a32cd3554afd35a95d3c3c1eea-boost-regex-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/f06fb95c4bcec8c01bd 24bf89600ca743b13f6bd-boost-thread-1.41.0-17.el6_4-x86_64 /var/lib/yum/yumdb/b/a44d43b7ec316bf9e52b6d16973775c7a99271df-boost-graph-1.41.0-17.el6_4-x86_64

I've tried to run the cmake . with the following parameters without luck :

cmake . -DBOOST_ROOT:STRING=/usr/lib64/

and

cmake . -DBOOST_ROOT:STRING=/usr/share/doc/

Any help will be greatly appreciated!

Instead of trying to make it work with the dynamic libraries that were found under :
/usr/lib64/ (I had any libraries because I've ran : yum install boost )
I've decided to try with static ones. After I've downloaded boost : I just had to point to the parent directory :

cmake . -DBOOST_ROOT:STRING=/home/boost_1_54_0/

and the cmake finished without a problem.

One might try to make the cmake process work with the dynamic libraries, but the CMakeLists.txt file should be edited accordingly. for example

SET(Boost_USE_STATIC_LIBS TRUE) 

should be changed.

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