boost and MySQL Connector/C++

cd path/to/boost_1_65_1
./bootstrap.sh --prefix=path/to/installation/prefix
./b2 install

 

  1. You can specify the full path to each library:

    $ c++ -I path/to/boost_1_65_1 example.cpp -o example \~/boost/stage/lib/libboost_regex-gcc34-mt-d-1_36.a
  2. You can separately specify a directory to search (with -Ldirectory) and a library name to search for (with -llibrary,2 dropping the filename's leading lib and trailing suffix (.a in this case):

    $ c++ -I path/to/boost_1_65_1 example.cpp -o example \-L~/boost/stage/lib/ -lboost_regex-gcc34-mt-d-1_36


cmake . -DBOOST_ROOT=/usr/local/boost_1_56_0

git clone https://github.com/mysql/mysql-connector-cpp cd mysql-connector-cpp/ cmake . make clean make make install

g++ -o test_install \ -I/usr/local/include -I/usr/local/include/cppconn \ -Wl,-Bdynamic standalone_example.cpp -lmysqlcppconn
shell> export LD_LIBRARY_PATH=/usr/local/lib
shell> export DYLD_LIBRARY_PATH=/usr/local/lib
shell> ./test_install localhost root password database

 

posted @ 2017-11-05 19:50  层膜的羔羊  阅读(1185)  评论(0编辑  收藏  举报