From: Steinar H. Gunderson Date: Fri, 18 Feb 2005 16:58:10 +0000 (+0000) Subject: Add pq++ dependency, start code for just connecting. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=9a52077de6b9ebda35e2db899f0dda30c41fb7af;ds=inline Add pq++ dependency, start code for just connecting. --- diff --git a/bigscreen/Makefile b/bigscreen/Makefile index 0ebf923..a6a855b 100644 --- a/bigscreen/Makefile +++ b/bigscreen/Makefile @@ -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 diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index 778720f..dc31c06 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -1,10 +1,18 @@ -#include +#include #include +#include #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; }