Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile fails with SQL header #39

Open
alexkrycek opened this issue Aug 13, 2020 · 1 comment
Open

Compile fails with SQL header #39

alexkrycek opened this issue Aug 13, 2020 · 1 comment

Comments

@alexkrycek
Copy link

alexkrycek commented Aug 13, 2020

After changing the include directive from #include "feather.h" to #include "cinatra/include/cinatra.hpp", I am able to compile the example from the README with:

g++ -std=c++17 hello.cpp -pthread -lstdc++fs -luuid -lboost_system -o hello

I then tried returning the include directive to #include "feather.h" and using the following command:

g++ -std=c++17 $(mysql_config --cflags) $(mysql_config --libs) -pthread hello.cpp -lstdc++fs -luuid -lboost_system -o hello

On my system, $(mysql_config --cflags) returns -I/usr/include/mariadb -I/usr/include/mariadb/mysql and $(mysql_config --libs) returns -L/usr/lib/arm-linux-gnueabihf/ -lmariadb.

This, however, produces the following errors:

In file included from feather.h:10,
                 from hello.cpp:2:
ormpp/mysql.hpp:499:45: error: ‘MYSQL_BIND’ was not declared in this scope                                    
   constexpr void set_param_bind(std::vector<MYSQL_BIND>& param_binds, T&& value) {                           
                                             ^~~~~~~~~~                                                       
ormpp/mysql.hpp:499:45: note: suggested alternative: ‘MSG_FIN’                                                
   constexpr void set_param_bind(std::vector<MYSQL_BIND>& param_binds, T&& value) {                           
                                             ^~~~~~~~~~                                                       
                                             MSG_FIN
ormpp/mysql.hpp:499:55: error: template argument 1 is invalid                                                 
   constexpr void set_param_bind(std::vector<MYSQL_BIND>& param_binds, T&& value) {                           
                                                       ^                                                      
ormpp/mysql.hpp:499:55: error: template argument 2 is invalid                                                 
ormpp/mysql.hpp:553:29: error: expected ‘)’ before ‘*’ token                                                  
    guard_statment(MYSQL_STMT* stmt) :stmt_(stmt) {}
                  ~          ^
                             )
ormpp/mysql.hpp:554:4: error: ‘MYSQL_STMT’ does not name a type; did you mean ‘SOL_ATM’?                      
    MYSQL_STMT* stmt_ = nullptr;
    ^~~~~~~~~~
    SOL_ATM
ormpp/mysql.hpp:625:3: error: ‘MYSQL’ does not name a type                                                    
   MYSQL * con_ = nullptr;
...

What exactly am I doing wrong?

System:

uname     : Linux pi 5.4.51-v7+ #1327 SMP Thu Jul 23 10:58:46 BST 2020 armv7l GNU/Linux
g++       : gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
Installed : mariadb-server-10.0, libmariadb-dev, default-libmysqlclient-dev, libmysqlcppconn-dev
@qicosmos
Copy link
Owner

you need include mysql connector, 'MYSQL' is from mysql connector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants