Administrator Startseite
Cover IT-Administrator
Im Wonnemonat Mai dreht sich im IT-Administrator Magazin alles rund um den Schwerpunkt “Systemmanagement”. So lesen Sie in der Ausgabe, wie Sie Ihre IT-Umgebung mit dem Microsoft System Center Operations Manager 2012 sowie mit der Open Source-Software Pandora FMS im Auge behalten. Außerdem zeigt Ihnen die Redaktion die besten Tricks für das Active Directory. In den Produkttest müssen unter anderem Aruba Networks ClearPass und Brainware ... mehr
Mitglied: EinTyp
Diese Frage heraufstufen
Diese Frage heraufstufen
0
Diese Frage herunterstufen

PostGreSQL - Fehler beim Kompilieren

Hallo Community,

als ich versuchte folgenden Code zu kompilieren bekam ich merkwürdige Fehler, welche anscheinend entstehen wenn mehrere Boost-Versionen installiert sind. Aber wie schaffe ich es das Programm trotzdem zu kompilieren?

DatabaseHandler.h
01.
#ifndef DATABASEHANDLER_H_ 
02.
#define DATABASEHANDLER_H_ 
03.
 
04.
#include <pqxx/connection.hxx> 
05.
 
06.
#include "global.h" 
07.
 
08.
class DatabaseHandler { 
09.
public: 
10.
	DatabaseHandler(settings_zm& settings); 
11.
	virtual ~DatabaseHandler(); 
12.
	void close(); 
13.
}; 
14.
 
15.
#endif /* DATABASEHANDLER_H_ */

DatabaseHandler.cpp
01.
#include "DatabaseHandler.h" 
02.
 
03.
DatabaseHandler::DatabaseHandler(settings_zm& settings) { 
04.
	pqxx::connection Conn("hostaddr=127.0.0.1 user=usernam password=1234 dbname=test"); 
05.
06.
 
07.
DatabaseHandler::~DatabaseHandler() { 
08.
	this->close(); 
09.
10.
 
11.
void DatabaseHandler::close() { 
12.
}

Ausgabe:
**** Build of configuration Debug for project test ****

make all
Building file: ../src/DatabaseHandler.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/DatabaseHandler.d" -MT"src/DatabaseHandler.d" -o "src/DatabaseHandler.o" "../src/DatabaseHandler.cpp"
Finished building: ../src/DatabaseHandler.cpp

Building file: ../src/global.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/global.d" -MT"src/global.d" -o "src/global.o" "../src/global.cpp"
Finished building: ../src/global.cpp

Building file: ../src/main.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -o "src/main.o" "../src/main.cpp"
Finished building: ../src/main.cpp

Building file: ../src/main_utils.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main_utils.d" -MT"src/main_utils.d" -o "src/main_utils.o" "../src/main_utils.cpp"
Finished building: ../src/main_utils.cpp

Building target: test.exe
Invoking: Cygwin C++ Linker
g++ -o "test.exe" ./src/DatabaseHandler.o ./src/global.o ./src/main.o ./src/main_utils.o
./src/DatabaseHandler.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
./src/DatabaseHandler.o:DatabaseHandler.cpp:(.debug_info+0xe9de): undefined reference to `pqxx::internal::freemem_result_data(pqxx::internal::result_data const*)'
./src/DatabaseHandler.o:DatabaseHandler.cpp:(.debug_info+0x10da1): undefined reference to `pqxx::internal::freemem_result_data(pqxx::internal::result_data const*)'
./src/DatabaseHandler.o: In function `connect_direct':
/usr/local/include/pqxx/connection.hxx:87: undefined reference to `pqxx::connectionpolicy::connectionpolicy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/include/pqxx/connection.hxx:87: undefined reference to `vtable for pqxx::connect_direct'
./src/DatabaseHandler.o: In function `~connect_direct':
/usr/local/include/pqxx/connection.hxx:85: undefined reference to `vtable for pqxx::connect_direct'
/usr/local/include/pqxx/connection.hxx:85: undefined reference to `pqxx::connectionpolicy::~connectionpolicy()'
./src/DatabaseHandler.o: In function `basic_connection':
/usr/local/include/pqxx/basic_connection.hxx:61: undefined reference to `pqxx::connection_base::connection_base(pqxx::connectionpolicy&)'
makefile:45: recipe for target `test.exe' failed
/usr/local/include/pqxx/basic_connection.hxx:62: undefined reference to `pqxx::connection_base::init()'
./src/DatabaseHandler.o: In function `~basic_connection':
/usr/local/include/pqxx/basic_connection.hxx:78: undefined reference to `pqxx::connection_base::close()'
./src/DatabaseHandler.o: In function `basic_connection':
/usr/local/include/pqxx/basic_connection.hxx:70: undefined reference to `pqxx::connection_base::connection_base(pqxx::connectionpolicy&)'
/usr/local/include/pqxx/basic_connection.hxx:71: undefined reference to `pqxx::connection_base::init()'
./src/global.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [test.exe] Error 1

**** Build Finished ****


Weitere Daten:
OS: Windows 7 x64
IDE: Eclipse CDT (Cywin GCC)

Grüße
-eintyp-
1 Kommentar Diskussionsverlauf
Mitglied: EinTyp
Diesen Kommentar heraufstufen
0
Diesen Kommentar herunterstufen
EinTyp am 11.04.2012 um 00:23 Uhr
Ich habe bemerkt, dass dieser Fehler auftritt wenn ich
01.
#include <boost/filesystem.hpp>
include. Ich hoffe mir kann jemand weiterhelfen.
mehr ...Ähnliche Inhalte