Código:
#include <iostream>
#include "C:\cygwin\MySQL++\include\mysql++.h"
using namespace std;
using namespace mysqlpp;
int main(int argc, char** argv) {
Connection conexion(false);
conexion.connect("AGENDA","localhost","root","1234");
if (conexion.connected()) {
cout << "Conexion establecida" << endl;
}
return 0;
}
cd 'F:\PROYECTOS\C++\ConexionMYSQL'
C:\cygwin\bin\make.exe -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/f/PROYECTOS/C++/ConexionMYSQL'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/conexionmysql.exe
make[2]: Entering directory '/cygdrive/f/PROYECTOS/C++/ConexionMYSQL'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.cpp
mkdir -p dist/Debug/Cygwin-Windows
g++ -o dist/Debug/Cygwin-Windows/conexionmysql build/Debug/Cygwin-Windows/main.o
build/Debug/Cygwin-Windows/main.o: In function `main':
/cygdrive/f/PROYECTOS/C++/ConexionMYSQL/main.cpp:11: undefined reference to `mysqlpp::Connection::Connection(bool)'
/cygdrive/f/PROYECTOS/C++/ConexionMYSQL/main.cpp:12: undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'
/cygdrive/f/PROYECTOS/C++/ConexionMYSQL/main.cpp:14: undefined reference to `mysqlpp::Connection::connected() const'
/cygdrive/f/PROYECTOS/C++/ConexionMYSQL/main.cpp:19: undefined reference to `mysqlpp::Connection::~Connection()'
/cygdrive/f/PROYECTOS/C++/ConexionMYSQL/main.cpp:19: undefined reference to `mysqlpp::Connection::~Connection()'
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:62: recipe for target 'dist/Debug/Cygwin-Windows/conexionmysql.exe' failed
make[2]: *** [dist/Debug/Cygwin-Windows/conexionmysql.exe] Error 1
make[2]: Leaving directory '/cygdrive/f/PROYECTOS/C++/ConexionMYSQL'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/f/PROYECTOS/C++/ConexionMYSQL'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 4s)