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 --- access/README | 8 ++++++++ boost/README | 11 ++++++++++- c++11/README | 8 ++++++++ composite/README | 8 ++++++++ container/README | 8 ++++++++ hello/README | 8 ++++++++ inheritance/polymorphism/README | 9 +++++++++ inheritance/reuse/README | 8 ++++++++ inverse/README | 8 ++++++++ mapping/README | 8 ++++++++ mapping/traits.hxx | 2 ++ optimistic/README | 8 ++++++++ pimpl/README | 9 +++++++++ qt/README | 10 +++++++++- query/README | 8 ++++++++ relationship/README | 8 ++++++++ schema/custom/README | 8 ++++++++ schema/embedded/README | 8 ++++++++ view/README | 8 ++++++++ 19 files changed, 151 insertions(+), 2 deletions(-) diff --git a/access/README b/access/README index ebf27db..57ca2c7 100644 --- a/access/README +++ b/access/README @@ -39,6 +39,14 @@ driver.cxx instance. Then it executes a number of database transactions on the 'person' objects. +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++ -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/boost/README b/boost/README index 6a86b28..64942bb 100644 --- a/boost/README +++ b/boost/README @@ -25,7 +25,7 @@ employee.sql These files are generated by the ODB compiler from employee.hxx using the following command line: - odb -d -p boost --generate-schema --generate-query \ + odb -d --profile boost --generate-schema --generate-query \ --generate-session employee.hxx Where stands for the database system we are using, for example, @@ -52,6 +52,15 @@ driver.cxx the driver performs a few database queries which use data members of the various Boost value types in their criterion. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-odb.o -lodb-boost -lodb-mysql -lodb \ +-lboost_date_time + 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/c++11/README b/c++11/README index 7a9829d..fa8780b 100644 --- a/c++11/README +++ b/c++11/README @@ -54,6 +54,14 @@ driver.cxx relationships. Finally, the driver performs a database query and iterates over the result printing basic information about the returned objects. +To compile and link the example manually from the command line we can use +the following commands (using MySQL as an example; replace 'c++ -std=c++11' +with your C++ compiler in C++11 mode): + +c++ -std=c++11 -c employee-odb.cxx +c++ -std=c++11 -DDATABASE_MYSQL -c driver.cxx +c++ -std=c++11 -o driver driver.o employee-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/composite/README b/composite/README index 2368784..bcb72e3 100644 --- a/composite/README +++ b/composite/README @@ -45,6 +45,14 @@ driver.cxx persistent. Finally, the driver performs a database query which uses a data member from the composite value type in its criterion. +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++ -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/container/README b/container/README index 5496047..058b001 100644 --- a/container/README +++ b/container/README @@ -38,6 +38,14 @@ driver.cxx in the database, then re-loads and prints the object to verify that the changes have been made persistent. +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++ -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/hello/README b/hello/README index 7a5a04f..a068898 100644 --- a/hello/README +++ b/hello/README @@ -39,6 +39,14 @@ driver.cxx instance. Then it executes a number of database transactions on persistent objects. +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++ -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/inheritance/polymorphism/README b/inheritance/polymorphism/README index 4fb3e15..8a013b3 100644 --- a/inheritance/polymorphism/README +++ b/inheritance/polymorphism/README @@ -53,6 +53,15 @@ driver.cxx each object. Finally, the driver erases the state of the persistent objects from the database, again using the base class interface. +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++ -c employee.cxx +c++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee.o employee-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/inheritance/reuse/README b/inheritance/reuse/README index 8cba573..53e0d90 100644 --- a/inheritance/reuse/README +++ b/inheritance/reuse/README @@ -45,6 +45,14 @@ driver.cxx performs a database query which uses a data member from the base class in its criterion. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-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/inverse/README b/inverse/README index 9b31fb7..e75d9dc 100644 --- a/inverse/README +++ b/inverse/README @@ -54,6 +54,14 @@ driver.cxx the driver performs a database query which uses a data member from a related object in its criterion. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-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/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 diff --git a/optimistic/README b/optimistic/README index 4c38e66..0c16ed2 100644 --- a/optimistic/README +++ b/optimistic/README @@ -40,6 +40,14 @@ driver.cxx delete this object. For each step the driver prints the versions of the object as seen by each process. +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++ -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/pimpl/README b/pimpl/README index 6460ebb..da12899 100644 --- a/pimpl/README +++ b/pimpl/README @@ -37,6 +37,15 @@ driver.cxx instance. Then it executes a number of database transactions on the 'person' objects. +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++ -c person.cxx +c++ -c person-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o person.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/qt/README b/qt/README index 2b30003..bfbe632 100644 --- a/qt/README +++ b/qt/README @@ -26,7 +26,7 @@ employee.sql These files are generated by the ODB compiler from employee.hxx using the following command line: - odb -d -p qt --generate-schema --generate-query \ + odb -d --profile qt --generate-schema --generate-query \ --generate-session employee.hxx Where stands for the database system we are using, for example, @@ -53,6 +53,14 @@ driver.cxx the driver performs a database query which uses data member of the Qt QString and QDate types in its criterion. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-odb.o -lodb-qt -lodb-mysql -lodb -lQtCore + 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/query/README b/query/README index 98b38f1..6886b8e 100644 --- a/query/README +++ b/query/README @@ -35,6 +35,14 @@ driver.cxx instance. It then persists a number of 'person' objects in the database and executes a number of queries to find objects matching various 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++ -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/relationship/README b/relationship/README index dd9f085..eea26aa 100644 --- a/relationship/README +++ b/relationship/README @@ -50,6 +50,14 @@ driver.cxx driver performs a database query which uses a data member from a related object in its criterion. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-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/schema/custom/README b/schema/custom/README index 77febef..22a14cb 100644 --- a/schema/custom/README +++ b/schema/custom/README @@ -48,6 +48,14 @@ driver.cxx and persists them in the database. Finally, the driver performs a database query and prints the information about the returned objects. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-odb.o -lodb-mysql -lodb + To run the driver, using MySQL as an example, we can execute the following command: diff --git a/schema/embedded/README b/schema/embedded/README index fc76d04..da99173 100644 --- a/schema/embedded/README +++ b/schema/embedded/README @@ -46,6 +46,14 @@ driver.cxx objects, performs a database query, and prints the information about the returned objects. +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++ -c person-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o person-odb.o -lodb-mysql -lodb + To run the driver, using MySQL as an example, we can execute the following command: diff --git a/view/README b/view/README index 4c30ad2..0ade8ea 100644 --- a/view/README +++ b/view/README @@ -52,6 +52,14 @@ driver.cxx 'employee' objects. Once this is done, the driver uses views defined in employee.hxx to load and print various information about the object model. +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++ -c employee-odb.cxx +c++ -DDATABASE_MYSQL -c driver.cxx +c++ -o driver driver.o employee-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 -- cgit v1.1