-
Notifications
You must be signed in to change notification settings - Fork 63
Installation/Include Issues #22
Comments
I managed to get the above working, my issue was that I was not installing properly. I now get the following error from this code.
Code: include "TabSample.h"
#include <sqlpp11/sqlpp11.h>
#include <sqlpp11/mysql/mysql.h>
namespace mysql = sqlpp::mysql;
int main()
{
auto config = std::make_shared<mysql::connection_config>();
config->user = "root";
config->database = "sqlpp_mysql";
config->debug = true;
mysql::connection db(config);
TabSample tab;
for(const auto& row : db.run(sqlpp::select(all_of(tab)).from(tab).unconditionally()))
{
std::cerr << "row.alpha: " << row.alpha << ", row.beta: " << row.beta << ", row.gamma: " << row.gamma << std::endl;
};
return 0;
} I am using gcc 4.9 and there are no errors with the make / make install, am I missing something in my CMakeLists.txt? cmake_minimum_required(VERSION 3.5)
project(mysql_sample)
set(HinnantDate_ROOT_DIR "/usr/local/lib/date")
include_directories(/usr/local/lib/date)
if(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
set(SQLPP11_INCLUDE_DIR /usr/local/include)
find_package(Sqlpp11 REQUIRED)
add_executable(mysql_sample src/main.cpp)
target_link_libraries(mysql_sample ${sqlpp11_LIBRARIES})
target_link_libraries(mysql_sample ${sqlpp11-connector-mysql_LIBRARIES})
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(test) |
Hi, can you check if As of now, there is no HTH Best, Roland |
That was my issue I am now able to find the library and the project works on the Debian machine I am working on but it does not work on the Ubuntu one. The Ubuntu one throws the following error when compiling with gcc 4.9.3 or 5.6 using mysql v5.7.
I am going to try using gcc 4.9.2 later this afternoon but I do not think this is the problem. Could it be the version of SQL I am using? |
This is a link-time problem. For some reason, you're not linking against the mysql/mariadb library. Check your commands, e.g. by running |
Solved as commented on gitter |
How is this installed using CMake along side sqlpp11. I have sqlpp11 installed using the process described on the README on that github page but I am unable to install this project as I get the errors...
The text was updated successfully, but these errors were encountered: