using namespace pqxx; probleme :-(
-
Hallo,
ich bin auf Linux umgestigen und versuche auf Postgres zuzugreifen.allerdings ein allgemeines Problem hält mich von meiner arbeit ab.
ich nutzte KDevelop.
ich hab mir die Library: libpqxx runtergeladen und installiert.
wenn ich nun versuche über:
using namespace pqxx;auf die Library zuzugreifen, kommt ein Fehler, die Datei kann nicht gefunden werden.
Wo can help me?
thx.
-
Du meinst wohl eher beim "include <pqxx.h>" kommt ein Fehler, oder?
Du mußt den Pfad auf die Library noch deinem Compiler mitteilen. Schau mal in die Optionen vom KDevelop.
-
Fehler pgsql.h No such file or directory
pqxx ist kein NAmensbereichs-Nameich werd mal schauen ob ich das Verzeichniss finde. eigentlich dachte ich, wenn ich unter ubuntu / apt installiere kommen die Dateien automatisch ins standard verzeichniss
-
hast du auch das libpqxx-dev paket installiert?
-
beim aufruf der connection conn() kommt der ausdruck:
undefined reference to 'pqxx::connectionpolicy::connectionpolicy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
undefined reference to `vtable for pqxx::connect_direct'
probleme in der connction.hxx Datei
...
...
...
-
entsprechende Bibliotek mitgelinkt?
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif#include <iostream>
#include <cstdlib>
#include <pqxx/pqxx>using namespace std;
using namespace pqxx;int main(int argc, char *argv[])
{connection conn("do something");
return EXIT_SUCCESS;
}weitere angabe Bibliotheken:
-L/usr/lib/pgsql
-I/usr/include/pgsqlpostgres.o: In function
connect_direct': /usr/include/pqxx/connection.hxx:84: undefined reference to
pqxx::connectionpolicy::connectionpolicy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/include/pqxx/connection.hxx:84: undefined reference tovtable for pqxx::connect_direct' postgres.o: In function
~connect_direct':
/usr/include/pqxx/connection.hxx:82: undefined reference tovtable for pqxx::connect_direct' /usr/include/pqxx/connection.hxx:82: undefined reference to
pqxx::connectionpolicy::~connectionpolicy()'
postgres.o: In functionbasic_connection': /usr/include/pqxx/basic\_connection.hxx:61: undefined reference to
pqxx::connection_base::connection_base(pqxx::connectionpolicy&)'
/usr/include/pqxx/basic_connection.hxx:62: undefined reference topqxx::connection\_base::init()' postgres.o: In function
~basic_connection':
/usr/include/pqxx/basic_connection.hxx:70: undefined reference to `pqxx::connection_base::close()'
collect2: ld returned 1 exit status
gmake[2]: *** [postgres] Fehler 1
gmake[2]: Das Target »all« wurde wegen Fehlern nicht aktualisiert.
gmake[1]: *** [all-recursive] Fehler 1
gmake: *** [all] Fehler 2
*** Exited with status: 2 ***
-
versuch mal -lpgsql und lpgxx oder ähnlich anzuhängen
-
Dieser Thread wurde von Moderator/in HumeSikkins aus dem Forum C++ in das Forum Compiler- und IDE-Forum verschoben.
Im Zweifelsfall bitte auch folgende Hinweise beachten:
C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?Dieses Posting wurde automatisch erzeugt.