Ich versuche derzeit, eine Firebird-Datenbank mit C++ zu erstellen. Firebird ist auf meinem Computer installiert. Mein Programm sieht wie folgt aus:Erstellen einer Firebird-Datenbank mit C++ mit IBPP
#define IBPP_WINDOWS = true
#define IBPP_GCC = true
#include "ibpp.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <iostream>
#include <stdlib.h>
#include <sstream>
#include <cmath>
using namespace std;
using std::vector;
using std::string;
using std::ifstream;
using std::ofstream;
using std::getline;
using std::cin;
using std::cout;
using std::endl;
using std::istringstream;
int main(int argc, char *argv[])
{
std::string UserName = "SYSDBA";
std::string Password = "**********";
std::string ServerName = "localhost";
char* DbName = (char *)"C:/Users/**********/Desktop/**********.fdb";
IBPP::Database db = IBPP::DatabaseFactory(ServerName,DbName,UserName,Password);
db->Create();
db->Connect();
}
Wenn ich versuche, meinen Code zu kompilieren, ich die folgende Meldung:
C:\Users**********\AppData\Local\Temp\cc2Zhdj3.o:**********.cpp:(.text$_ZN4IBPP15DatabaseFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_S7_[__ZN4IBPP15DatabaseFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_S7_]+0xaa): undefined reference to `IBPP::DatabaseFactory(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)' collect2.exe: error: ld returned 1 exit status
Hat jemand eine Idee, was ich falsch gemacht habe?
[Sie sind sehr wahrscheinlich nicht die entsprechende Libs auf Ihre Anwendung zu verknüpfen.] (Https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error- und-wie-mache-ich-fix). – WhozCraig