Clion Cmake & SDL2 - c++

I want to use Clion with SDL2 and after lot of tests, I already have an error.
there is my CmakeLists.txt :
cmake_minimum_required(VERSION 3.8)
project(sdl2-test)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lmingw32")
#set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
set(CMAKE_CXX_STANDARD 11)
include_directories(${PROJECT_SOURCE_DIR}/include)
link_directories(${PROJECT_SOURCE_DIR}/lib)
set(SOURCE_FILES main.cpp)
add_executable(sdl2-test ${SOURCE_FILES})
target_link_libraries(sdl2-test SDL2main SDL2)
my main.cpp
#include <iostream>
#include "include/SDL2/SDL.h"
using namespace std;
int main(int argc, char** argv) {
if(SDL_Init(SDL_INIT_EVERYTHING) == -1){
cout << "Something went wrong! " << SDL_GetError() << endl;
}
SDL_Window* window = SDL_CreateWindow("SDL_Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
1280, 720, SDL_WINDOW_OPENGL);
if(window == nullptr){
cout << "Something also went wrong here" << endl;
}
SDL_Delay(2000);
SDL_Quit();
return 0;
}
but when I build my project cmake Obviously Cmake work find but I haave some error :
C:\Users\paulp\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\172.4343.16 \bin\cmake\bin\cmake.exe --build C:\Users\paulp\CLionProjects\sdl2-test\cmake- build-debug --target sdl2-test -- -j 4
[ 50%] Building CXX object CMakeFiles/sdl2-test.dir/main.cpp.obj
[100%] Linking CXX executable sdl2-test.exe
CMakeFiles\sdl2-test.dir/objects.a(main.cpp.obj): In function `SDL_main':
C:/Users/paulp/CLionProjects/sdl2-test/main.cpp:8: undefined reference to `SDL_Init'
C:/Users/paulp/CLionProjects/sdl2-test/main.cpp:9: undefined reference to `SDL_GetError'
C:/Users/paulp/CLionProjects/sdl2-test/main.cpp:13: undefined reference to `SDL_CreateWindow'
C:/Users/paulp/CLionProjects/sdl2-test/main.cpp:18: undefined reference to `SDL_Delay'
C:/Users/paulp/CLionProjects/sdl2-test/main.cpp:19: undefined reference to `SDL_Quit'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain#16'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\sdl2-test.dir\build.make:96: recipe for target 'sdl2-test.exe' failed
mingw32-make.exe[3]: *** [sdl2-test.exe] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/sdl2-test.dir/all' failed
mingw32-make.exe[2]: *** [CMakeFiles/sdl2-test.dir/all] Error 2
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/sdl2-test.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/sdl2-test.dir/rule] Error 2
mingw32-make.exe: *** [sdl2-test] Error 2
Makefile:117: recipe for target 'sdl2-test' failed
any idea how to fix ?

The linking of your application has failed because the linker does not know the location of the sdl2-lib.
You need to search for the SDL2-libraries as well in your cmake-file and add the locations to your makefile:
find_file(SDL2_INCLUDE_DIR NAME SDL.h HINTS SDL2)
find_library(SDL2_LIBRARY NAME SDL2)
add_executable(ChickenShooter main.cpp)
target_include_directories(ChickenShooter ${SDL2_INCLUDE_DIR})
target_link_libraries(ChickenShooter ${SDL2_LIBRARY})
You can look into this post as well: How to dins SDL2 via cmake

Related

Unable to create an OpenSSL project with CLion

I am trying to create a simple OpenSSL poject in CLion but it can suceed in linking it.
This is my final CMakeLists.txt file (after many tries) which gives less errors:
cmake_minimum_required(VERSION 3.16)
project(duplicates_finder)
set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L . -lssl -lcrypto")
set(SOURCE_FILES main.cpp)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
find_package(OpenSSL REQUIRED)
if (OPENSSL_FOUND)
# Add the include directories for compiling
target_include_directories(${PROJECT_NAME} PUBLIC ${OPENSSL_INCLUDE_DIR})
# Add the static lib for linking
target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto)
message(STATUS "Found OpenSSL ${OPENSSL_VERSION}")
else()
message(STATUS "OpenSSL Not Found")
endif()
include_directories(C:\\OpenSSL-Win32\\include)
link_directories(C:\\OpenSSL-Win32\\lib\\MinGW)
This is the file I am trying to compile:
#include <string>
#include <iostream>
#include <filesystem>
#include <string>
#include <openssl/sha.h>
#include "openssl/ssl.h"
#include <sstream>
#include <iomanip>
using namespace std;
namespace fs = std::filesystem;
//string sha256(const string& str)
//{
// unsigned char hash[SHA256_DIGEST_LENGTH];
// SHA256_CTX sha256;
// SHA256_Init(&sha256);
// SHA256_Update(&sha256, str.c_str(), str.size());
// SHA256_Final(hash, &sha256);
// stringstream ss;
// for(unsigned char i : hash)
// {
// ss << hex << setw(2) << setfill('0') << (int)i;
// }
// return ss.str();
//}
int main() {
std::cout << "SSLeay Version: " << SSLeay_version(SSLEAY_VERSION) << std::endl;
SSL_library_init();
auto ctx = SSL_CTX_new(SSLv23_client_method());
if (ctx) {
auto ssl = SSL_new(ctx);
if (ssl) {
std::cout << "SSL Version: " << SSL_get_version(ssl) << std::endl;
SSL_free(ssl);
} else {
std::cout << "SSL_new failed..." << std::endl;
}
SSL_CTX_free(ctx);
} else {
std::cout << "SSL_CTX_new failed..." << std::endl;
}
}
And these are the errors:
====================[ Build | all | Debug ]=====================================
"C:\Program Files\JetBrains\CLion 2020.1\bin\cmake\win\bin\cmake.exe" --build C:\Users\USERNAME\CLionProjects\duplicates_finder\cmake-build-debug --target all -- -j 8
[ 50%] Linking CXX executable duplicates_finder.exe
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\duplicates_finder.dir/objects.a(main.cpp.obj): in function `main':
C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:42: undefined reference to `SSLeay_version'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:43: undefined reference to `SSL_library_init'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:44: undefined reference to `SSLv23_client_method'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:44: undefined reference to `SSL_CTX_new'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:46: undefined reference to `SSL_new'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:48: undefined reference to `SSL_get_version'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:49: undefined reference to `SSL_free'
C:/PROGRA~2/EMBARC~1/Dev-Cpp/TDM-GC~1/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/USERNAME/CLionProjects/duplicates_finder/main.cpp:53: undefined reference to `SSL_CTX_free'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [duplicates_finder.exe] Error 1
CMakeFiles\duplicates_finder.dir\build.make:87: recipe for target 'duplicates_finder.exe' failed
mingw32-make.exe[1]: *** [CMakeFiles/duplicates_finder.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
CMakeFiles\Makefile2:74: recipe for target 'CMakeFiles/duplicates_finder.dir/all' failed
Makefile:82: recipe for target 'all' failed
I restared my PC.
I also added the line:
target_link_libraries(${PROJECT_NAME} libeay32.lib) //also .a file the result is the same.
And it throws the error that it can't find that file.
Also added the files: libeay32.a, libeay32.def, libeay32.lib and ssleay32.a, ssleay32.def, ssleay32.lib to the project folder and also to the cmak-build-debug folder. => Still not working.
Also renamed libeay32.a to libeay32.dll.a and ssleay32.a to ssleay32.dll.a as on the another topic from stackoverflow says but it is still not working too.
No matter I do it is not compiling at all.
I spent all day searching for a solution but in vain.
I am using Windows 7 x64 and OpenSSL 1.1.1m 14 Dec 2021.
Thank you in advance!

Use SDL2 with CLion 2020

I can't seem to link SDL2 correctly. I am using CLion with MinGW. My CMakeLists.txt looks like this currently, but I tried using the FindSDL2 module floating around, though it always said that it could not find the SDL2 library. This is the only way I've found it to stop giving back errors.
cmake_minimum_required(VERSION 3.16)
project(CBeat)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "CC:/Development/SDL2_MinGW_32bit/lib/cmake/SDL2")
set(SDL2_DIR C:/Mingw)
set(CMAKE_CXX_STANDARD 14)
set(SDL2_LIB_DIR ${SDL2_DIR}/lib)
include_directories(${SDL2_DIR}/include)
add_executable(CBeat main.cpp)
target_link_libraries(CBeat ${SDL2_LIB_DIR}/libSDL2.dll.a ${SDL2_LIB_DIR}/libSDL2main.a ${SDL2_LIB_DIR}/libSDL2.a -mwindows -lmingw32 -lSDL2main -lSDL2)
add_definitions(-DSDL_MAIN_HANDLED)
Now, the main.cpp looks like this, CLion shows no errors and actually is able to give me suggestions and information in each function, but when running it marks various functions as undefined. I attach evidence. I am so desperate right now, I've been trying to figure out this for days now and nothing seems to work!
#include <iostream>
#include <SDL2/SDL.h>
using namespace std;
const int SWIDTH=640, SHEIGHT=420;
int main( int argc, char* args[] ){
SDL_Window* window = NULL;
SDL_Surface* screenSurface = NULL;
if( SDL_Init( SDL_INIT_EVERYTHING ) < 0 )
{
cout<< "SDL could not initialize! SDL_Error:" << SDL_GetError << endl;
}
else
{
window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SWIDTH, SHEIGHT, SDL_WINDOW_SHOWN );
if( window == NULL )
{
cout << "Window could not be created! SDL_Error: " << SDL_GetError << endl;
}
else
{
screenSurface = SDL_GetWindowSurface(window);
SDL_FillRect(screenSurface, NULL,SDL_MapRGB(screenSurface->format, 0xFF,0xFF,0xFF));
SDL_UpdateWindowSurface( window );
SDL_Delay( 2000 );
}
SDL_DestroyWindow( window );
SDL_Quit();
return 0;
}
}
CLion trying to be useful
And these are the errors it gives back:
[ 50%] Linking CXX executable CBeat.exe
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: CMakeFiles\CBeat.dir/objects.a(main.cpp.obj): in function `main':
C:/Users/yello/CLionProjects/CBeat/main.cpp:12: undefined reference to `SDL_Init'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:18: undefined reference to `SDL_CreateWindow'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:25: undefined reference to `SDL_GetWindowSurface'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:26: undefined reference to `SDL_MapRGB'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:26: undefined reference to `SDL_FillRect'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:27: undefined reference to `SDL_UpdateWindowSurface'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:28: undefined reference to `SDL_Delay'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:30: undefined reference to `SDL_DestroyWindow'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:/Users/yello/CLionProjects/CBeat/main.cpp:31: undefined reference to `SDL_Quit'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\CBeat.dir\build.make:88: recipe for target 'CBeat.exe' failed
CMakeFiles\Makefile2:74: recipe for target 'CMakeFiles/CBeat.dir/all' failed
mingw32-make.exe[3]: *** [CBeat.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/CBeat.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles/CBeat.dir/rule] Error 2
mingw32-make.exe: *** [CBeat] Error 2
CMakeFiles\Makefile2:81: recipe for target 'CMakeFiles/CBeat.dir/rule' failed
Makefile:117: recipe for target 'CBeat' failed

error when I trying to make my C++ project using CPR and TorchScript Library

I am trying to use CPR to get Post Request from an API but when I make my project using Cmake, it always error. Let's have a look at my CMakeList.txt, code and error.
Any ideas are very good to me. Thank in advance my bros.
CMakeList.txt
cmake_minimum_required(VERSION 3.15)
project(Preprocessing)
add_subdirectory(cpr)
add_executable(Preprocessing main.cpp)
set(CMAKE_PREFIX_PATH "/home/bao/CLionProjects/Preprocessing/libtorch/share/cmake/Torch")
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
target_link_libraries(Preprocessing ${CPR_LIBRARIES} ${TORCH_LIBRARIES})
include_directories(${CPR_INCLUDE_DIRS})
set_property(TARGET Preprocessing PROPERTY CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} ${CPR_CXX_FLAGS}")
set(CMAKE_CXX_STANDARD 11)
my code:
void query_split_text_service (std::string s){
json j;
j["sentence"] = s;
std::cout<< j << std::endl;
auto r = cpr::Post(cpr::Url{"http://127.0.0.1:8880/nlp/tone"},
cpr::Body{j.dump()}
);
std::cout << r.text << std::endl;
}
and error:
[ 78%] Linking CXX executable Preprocessing
CMakeFiles/Preprocessing.dir/main.cpp.o: In function `void cpr::priv::set_option<std::string>(cpr::Session&, std::string&&)':
main.cpp:(.text._ZN3cpr4priv10set_optionISsEEvRNS_7SessionEOT_[_ZN3cpr4priv10set_optionISsEEvRNS_7SessionEOT_]+0x2a): undefined reference to `cpr::Session::SetOption(std::string const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/Preprocessing.dir/build.make:91: recipe for target 'Preprocessing' failed
make[2]: *** [Preprocessing] Error 1
CMakeFiles/Makefile2:346: recipe for target 'CMakeFiles/Preprocessing.dir/all' failed
make[1]: *** [CMakeFiles/Preprocessing.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
but If comment some lines, the miracle that I can make my project and run it.
void query_split_text_service (std::string s){
json j;
j["sentence"] = s;
std::cout<< j << std::endl;
// auto r = cpr::Post(cpr::Url{"http://127.0.0.1:8880/nlp/tone"},
// cpr::Body{j.dump()}
// );
// std::cout << r.text << std::endl;
}

Using SDL2 with CLion on OS X

So I am trying to get SDL2 to work with CLion (So that I can experiment/learn).
My main code is as such:
#include <iostream>
#include <SDL.h>
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
bool init();
SDL_Window* gWindow = NULL;
SDL_Surface* gScreenSurface = NULL;
SDL_Surface* gHelloWorld = NULL;
bool init(){
bool success = true;
/*if(SDL_Init(SDL_INIT_VIDEO)<0){
success = false;
}
else{
}*/
return success;
}
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
And my CMake file looks like this
cmake_minimum_required(VERSION 3.6)
project(SDL2_Lesson_1)
set(CMAKE_CXX_STANDARD 11)
# includes cmake/FindSDL2.cmake
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIR})
set(SOURCE_FILES Lesson_1.cpp)
add_executable(SDL2_App ${SOURCE_FILES})
target_link_libraries(SDL2_App ${SDL2_LIBRARY})
set(SOURCE_FILES Lesson_1.cpp)
add_executable(SDL2_Lesson_1 ${SOURCE_FILES})
Also, I have a file FindSDL2.cmake from here in a folder cmake within the project folder.
Now, with the files as I have them posted, everything compiles and runs fine. BUT, when I uncomment the commented section within init(), the compilation breaks down and gives me the following error:
Undefined symbols for architecture x86_64:
"_SDL_Init", referenced from:
init() in Lesson_1.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [SDL2_Lesson_1] Error 1
make[2]: *** [CMakeFiles/SDL2_Lesson_1.dir/all] Error 2
make[1]: *** [CMakeFiles/SDL2_Lesson_1.dir/rule] Error 2
make: *** [SDL2_Lesson_1] Error 2
Note: Lesson_1.cpp is the file with the main code. Also, this is only part of the error.
Use find_library() instead of find_package()
find_library(SDL2_LIBRARY SDL2 "path/to/your/library_bundle")
find_library(SDL2_App ${SDL2_LIBRARY})

CLion: undefined "_get_driver_instance"

The IDE : CLion
System: OS X
Error messageļ¼š
Scanning dependencies of target librarySystem
[ 66%] Building CXX object CMakeFiles/librarySystem.dir/sqlConnection.cpp.o
[ 66%] Building CXX object CMakeFiles/librarySystem.dir/main.cpp.o
[100%] Linking CXX executable librarySystem
Undefined symbols for architecture x86_64:
"_get_driver_instance", referenced from:
sqlConnection::sqlConnection() in sqlConnection.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [librarySystem] Error 1
make[1]: *** [CMakeFiles/librarySystem.dir/all] Error 2
make: *** [all] Error 2
I write a class named sqlConnection to connect mysql.
sqlConection.h
#include "sqlConnection.h"
sqlConnection::sqlConnection() {
driver = get_driver_instance();
con = driver->connect("567aaffa1a70e.sh.cdb.myqcloud.com:xxxx", "xxxx", "xxxx");
con->setSchema("librarySys");
stmt = con->createStatement();
}
bool sqlConnection::ifConnected() {
bool isConnected = false;
if(!con->isClosed()){
std::cout << "Succeed to connect mysql";
isConnected = true;
}else{
std::cout << "fail to connect mysql";
}
return isConnected;
}
sqlConnection::~sqlConnection() {
delete stmt;
delete con;
}
The test in the main.cpp
main.cpp
#include <iostream>
#include "sqlConnection.h"
using namespace std;
int main() {
sqlConnection *sqlC = new sqlConnection();
sqlC->ifConnected();
return 0;
}
cmakeList:
cmake_minimum_required(VERSION 3.3)
project(librarySystem)
INCLUDE_DIRECTORIES(sqlFiles/include)
INCLUDE_DIRECTORIES(sqlFiles/lib)
INCLUDE_DIRECTORIES(sqlFiles/include/cppconn)
INCLUDE_DIRECTORIES(/usr/local/lib/libmysqlcppconn.so)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
set(SOURCE_FILES main.cpp sqlConnection.cpp sqlConnection.h)
add_executable(librarySystem ${SOURCE_FILES})
I used mysql connector-cpp to connect mysql.But the problem came.Have tried the solution on web,but they did't work.
Struggled with the same error and I got a small example to work with this CMakeLists.txt content. Maybe it's helpful for you even if its not same versions.
cmake_minimum_required(VERSION 3.5)
project(TestCPP)
#For mysql connector include..
INCLUDE_DIRECTORIES(/mypath/mysql-connector-c++-1.1.7-osx10.10-x86-64bit/include/)
#For Boost..
INCLUDE_DIRECTORIES(/opt/local/include/)
#For imported linking..
add_library(libmysqlcppconn STATIC IMPORTED)
set_property(TARGET libmysqlcppconn PROPERTY IMPORTED_LOCATION /mypath/mysql-connector-c++-1.1.7-osx10.10-x86-64bit/lib/libmysqlcppconn-static.a)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(TestCPP ${SOURCE_FILES})
target_link_libraries (TestCPP libmysqlcppconn)