Add pq++ dependency, start code for just connecting.
authorSteinar H. Gunderson <sesse@samfundet.no>
Fri, 18 Feb 2005 16:58:10 +0000 (16:58 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Fri, 18 Feb 2005 16:58:10 +0000 (16:58 +0000)
bigscreen/Makefile
bigscreen/ccbs_bigscreen.cpp

index 0ebf923..a6a855b 100644 (file)
@@ -1,7 +1,8 @@
 CC=gcc
 CXX=g++
+CXXFLAGS=-I/usr/include/postgresql
 LDFLAGS=-L/usr/X11R6/lib
-LIBS=-lGL -lX11 -lXext -lXxf86vm
+LIBS=-lGL -lX11 -lXext -lXxf86vm $(shell libpq3-config) -lpqxx
 CCBS_BIGSCREEN_OBJS=ccbs_bigscreen.o glwindow.o
 
 all: ccbs-bigscreen
index 778720f..dc31c06 100644 (file)
@@ -1,10 +1,18 @@
-#include <stdio.h>
+#include <cstdio>
 #include <unistd.h>
+#include <pqxx/pqxx>
 #include "glwindow.h"
 
 int main(int argc, char **argv)
 {
        GLWindow glw("CCBS bigscreen", 800, 600, 32, false, 16, -1);
-       sleep(5);
+       try {
+               pqxx::connection conn("dbname=ccbs host=sql.samfundet.no user=ccbs password=GeT|>>B_");
+               pqxx::transaction<> t(conn, "trx");
+       } catch (const std::exception &e) {
+               std::fprintf(stderr, "Exception: %s\n", e.what());
+               exit(1);
+       }
+       
        return 0;
 }