Giter Club home page Giter Club logo

Comments (4)

rbock avatar rbock commented on July 21, 2024

Hi Shang,

Thanks for pointing that out!

You are using the develop branch of sqlpp11, I assume? That contains the mysql connector directly, see also rbock/sqlpp11#394

Please try with the included connector. I'll update the documentation here.

Thanks!

Roland

from sqlpp11-connector-mysql.

PPShang avatar PPShang commented on July 21, 2024

Oh you are right.I used the develop branch And I followed your advance, I turned on mysql-connector option in the top level CMakeLists.txt then I built sqlpp11 again without this connector project and aucceed.But when i try to use sqlpp11 lib in my demo project it caused error when built it.Seems missing some mysql's lib from build error message but the strange thing it that sqlpp11 project built and installed succeed clearly!

I also try to look for some usefully infomation from sqlpp11's tests folder but i failed.
some code in my demo(actually the code is copyed from select.cpp in tests folder):

#include "TabSample.h"
#include <cassert>
#include <sqlpp11/alias_provider.h>
#include <sqlpp11/functions.h>
#include <sqlpp11/insert.h>
#include <sqlpp11/mysql/connection.h>
#include <sqlpp11/remove.h>
#include <sqlpp11/select.h>
#include <sqlpp11/transaction.h>
#include <sqlpp11/update.h>

#include <iostream>
#include <vector>

const auto library_raii = sqlpp::mysql::scoped_library_initializer_t{0, nullptr, nullptr};

SQLPP_ALIAS_PROVIDER(left)

build failed message:

[build] [ 50%] Building CXX object src/use_sqlpp11/CMakeFiles/use_sqlpp11.dir/main.cpp.o
[build] In file included from /usr/local/include/sqlpp11/mysql/bind_result.h:35,
[build]                  from /usr/local/include/sqlpp11/mysql/connection.h:31,
[build]                  from /root/my_pro/src/use_sqlpp11/main.cpp:6:
[build] /usr/local/include/sqlpp11/mysql/sqlpp_mysql.h:30:10: fatal error: mysql.h: No such file or directory
[build]    30 | #include <mysql.h>
[build]       |          ^~~~~~~~~
[build] compilation terminated.
[build] make[3]: *** [src/use_sqlpp11/CMakeFiles/use_sqlpp11.dir/build.make:63: src/use_sqlpp11/CMakeFiles/use_sqlpp11.dir/main.cpp.o] Error 1
[build] make[2]: *** [CMakeFiles/Makefile2:430: src/use_sqlpp11/CMakeFiles/use_sqlpp11.dir/all] Error 2
[build] make[1]: *** [CMakeFiles/Makefile2:437: src/use_sqlpp11/CMakeFiles/use_sqlpp11.dir/rule] Error 2
[build] make: *** [Makefile:209: use_sqlpp11] Error 2
[build] Build finished with exit code 2

May be I wrote CMakeLists.txt file wrong? Can you help me? Thanks

from sqlpp11-connector-mysql.

PPShang avatar PPShang commented on July 21, 2024

the demo code cause error when i include header file <sqlpp11/mysql/connection.h>. it seems that sqlpp11 lib can not find mysql.h (mysql database's file? or sqlpp11 project's header file?) file? I saw it uses <> instead of "" so I guess it seems mysql database's header file, is that right?

from sqlpp11-connector-mysql.

rbock avatar rbock commented on July 21, 2024

Please see the latest discussion here: https://gitter.im/sqlpp11/Lobby and check the build/usage documentation of the library.

Open a new issue on sqlpp11, if you cannot get it to work.

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.