]> git.sesse.net Git - ccbs/commitdiff
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 0ebf923304b85a11f51ec7dc35ae83290faf1017..a6a855bb459e398c19222f0da429f63dc618e72f 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 778720f9e90aa97037dcb67db3ce1dc4acbad52a..dc31c06c2e1096e63748aa9eeb2c7a3e7a2accd8 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;
 }