Comments (4)
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.
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.
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.
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)
- Data is truncated with MariaDB Connector/C 3.0.1+ HOT 11
- Selecting a datetime field always returns epoch HOT 2
- Microseconds ignored when selecting datetime column HOT 1
- Mac osX build HOT 8
- Crash of queries due to MYSQL_RES that is NULL HOT 7
- mysql replace into command HOT 5
- how to use unhex function ,could you give some info? HOT 1
- database name not used HOT 2
- sample code does not work on windows HOT 1
- Can't build DLL on windows HOT 2
- {char,bind}_result_t.size() is unimplemented HOT 5
- How to create mysql::connection without config HOT 2
- TLS/SSL connection is unsupported HOT 1
- Does sqlpp11 support a connection pool? What do I need to do? HOT 2
- How to return mysql auto incorrect when inserting a record in the table? HOT 2
- how can I set mysql options HOT 1
- Error reported while installing sqlpp11-mysql HOT 4
- Why is it necessary to pass database parameter when creating a connection? HOT 3
- Error when compiling HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlpp11-connector-mysql.