From 60b5ffdef2be52e519ea6fc0927c6af4fc086cc5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 10 Sep 2012 15:27:52 +0200 Subject: Describe commands necessary to manually compile and link each example --- mapping/README | 8 ++++++++ mapping/traits.hxx | 2 ++ 2 files changed, 10 insertions(+) (limited to 'mapping') diff --git a/mapping/README b/mapping/README index 2a93d1f..52b7e5b 100644 --- a/mapping/README +++ b/mapping/README @@ -52,6 +52,14 @@ driver.cxx instance. It then persists a number of 'person' objects in the database and executes a query to find objects matching certain criteria. +To compile and link the example manually from the command line we can use +the following commands (using MySQL as an example; replace 'c++' with your +C++ compiler name): + +c++ -DDATABASE_MYSQL -c person-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o person-odb.o -lodb-mysql -lodb + To run the example we may first need to create the database schema (for some database systems, such as SQLite, the schema is embedded into the generated code which makes this step unnecessary). Using MySQL as an example, this diff --git a/mapping/traits.hxx b/mapping/traits.hxx index 5579f0c..533b2e3 100644 --- a/mapping/traits.hxx +++ b/mapping/traits.hxx @@ -16,6 +16,8 @@ # include "traits-oracle.hxx" #elif defined(DATABASE_MSSQL) # include "traits-mssql.hxx" +#else +# error unknown database; did you forget to define the DATABASE_* macros? #endif #endif // TRAITS_HXX -- cgit v1.1