Giter Club home page Giter Club logo

Comments (8)

Fab-z4qx avatar Fab-z4qx commented on June 23, 2024

Update :

If found a way to build by add theses lines into the CMakeList.txt :

INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
FIND_PACKAGE(Boost 1.69 COMPONENTS system random thread REQUIRED)

Is this an issue ?

from sqlpp11-connector-mysql.

rbock avatar rbock commented on June 23, 2024

Thanks for posting both, issue and solution :-)

Can you prepare a pull request?

from sqlpp11-connector-mysql.

Fab-z4qx avatar Fab-z4qx commented on June 23, 2024

Hello, I dont think, I understand nothing about Cmake :D I think it need a better review to understand the problem.

Other question, how do you link the lib into your executable ?
I tried to add this line into my CMakeLists.txt :
FIND_PACKAGE(sqlpp11 REQUIRED)
target_link_libraries(${TARGET} PUBLIC sqlpp11)

On macOS, I got this error :
[build] Undefined symbols for architecture x86_64:
[build] "sqlpp::mysql::connection::connection(std::__1::shared_ptrsqlpp::mysql::connection_config const&)", referenced from:
[build] Mysql::Connect() in libBSql.a(Mysql.cc.o)
[build] "sqlpp::mysql::connection::~connection()", referenced from:
[build] Mysql::Connect() in libBSql.a(Mysql.cc.o)
[build] ld: symbol(s) not found for architecture x86_64

And on linux ubuntu :
CMake Error at src/mysql/CMakeLists.txt:22 (FIND_PACKAGE):
By not providing "Findsqlpp11.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "sqlpp11", but
CMake did not find one.

Could not find a package configuration file provided by "sqlpp11" with any
of the following names:

sqlpp11Config.cmake
sqlpp11-config.cmake

Add the installation prefix of "sqlpp11" to CMAKE_PREFIX_PATH or set
"sqlpp11_DIR" to a directory containing one of the above files. If
"sqlpp11" provides a separate development package or SDK, be sure it has
been installed.

from sqlpp11-connector-mysql.

rbock avatar rbock commented on June 23, 2024

Not being a CMake master myself, and not having a Mac at hand, this is going to take some time, I am afraid :-)

But first off: In order to link the mysql connector into your program, you need to link the connector library. This is done for the sqlpp11-connector-mysql/tests, for instance.

from sqlpp11-connector-mysql.

Toxe avatar Toxe commented on June 23, 2024

Hello @z4qx, I made a PR (#58) that would remove the reliance on Boost.Thread on macOS because nowadays this isn't necessary anymore.

from sqlpp11-connector-mysql.

xtuyaowu avatar xtuyaowu commented on June 23, 2024

-- Using /Library/Developer/CommandLineTools/usr/bin/c++ (compiler id: AppleClang)
CMake Error at src/CMakeLists.txt:15 (find_package):
By not providing "Finddate.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "date", but
CMake did not find one.

Could not find a package configuration file provided by "date" with any of
the following names:

dateConfig.cmake
date-config.cmake

Add the installation prefix of "date" to CMAKE_PREFIX_PATH or set
"date_DIR" to a directory containing one of the above files. If "date"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!
See also "/Users/admin/Documents/study/workspace/trade-test/third_party/sqlpp11-connector-mysql/build/CMakeFiles/CMakeOutput.log".

from sqlpp11-connector-mysql.

rbock avatar rbock commented on June 23, 2024

Maybe @kovdan01 can help with that last item?

from sqlpp11-connector-mysql.

kovdan01 avatar kovdan01 commented on June 23, 2024

@xtuyaowu Hello. Looks like that you do not have date library by Howard Hinnant installed – see requirements section in readme.
It is installed with sqlpp11 by default (if you do not use option USE_SYSTEM_DATE), so highly likely that you don't have sqlpp11 installed too.

I can build the library on macOS using these commands:

git clone https://github.com/rbock/sqlpp11-connector-mysql.git
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=`pwd`/prefix -D CMAKE_PREFIX_PATH=/path/to/sqlpp11/prefix/
cmake --build . --target install

If you have sqlpp11 installed but are still unable to build the connector, please provide:

  • cmake command that you use
  • path to sqlpp11 installation prefix (directory where lib/cmake/Sqlpp11/Sqlpp11Config.cmake and lib/cmake/date/dateConfig.cmake are located)

from sqlpp11-connector-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.