From Davide.Anastasia at qualitycapital.com Mon Apr 2 12:48:49 2012 From: Davide.Anastasia at qualitycapital.com (Davide Anastasia) Date: Mon Apr 2 12:49:05 2012 Subject: [odb-users] Strange crash with composite primary key. Message-ID: Hi, I am trying to obtain a composite primary key using this snippet: #pragma db object id() class ClipSize { private: // forward declaration class ClipKey; public: ClipSize(const std::string& instrumentName, const std::string& broker, int clipSize): m_id(instrumentName, broker), m_clipSize(clipSize) { } const int clipSize() const { return m_clipSize; } const std::string& instrumentName() const { return m_id.m_instrumentName; } const std::string& broker() const { return m_id.m_broker; } private: #pragma db value struct ClipKey { public: ClipKey(const std::string& instrumentName, const std::string& broker): m_instrumentName(instrumentName), m_broker(broker) {} std::string m_instrumentName; std::string m_broker; private: ClipKey(); friend class odb::access; }; ClipSize(); friend class odb::access; #pragma db id ClipKey m_id; #pragma db not_null int m_clipSize; }; Unfortunately, when this piece of code goes into the ODB compiler, I get this error: [ 18%] Building ODB for clipsize.h terminate called after throwing an instance of 'cutl::compiler::context::no_entry' what(): N4cutl8compiler7context8no_entryE *** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins. Event | Plugins PLUGIN_START_UNIT | odb PLUGIN_PRAGMAS | odb PLUGIN_OVERRIDE_GATE | odb In file included from :8:0: /opt/odb-1.8.0/include/odb/tr1/pointer-traits.hxx:95:1: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Any idea of how I can solve this problem? Best, Davide Anastasia Analyst, Research & Development Quality Capital Management Ltd. QCM House * Horizon Business Village No. 1 Brooklands Road Weybridge * Surrey KT13 0TJ United Kingdom Tel: +44 (0) 1932 334 400 Fax: +44 (0) 1932 334 415 Email: Davide.Anastasia@QualityCapital.com www.qualitycapital.com ________________________________ This email and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Quality Capital Management Ltd. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this email in error. You should also be aware that emails are susceptible to interference and you should not assume that the contents of this email originated from the sender above or that they have been accurately reproduced in their original form. Quality Capital Management Ltd is authorised and regulated by the Financial Services Authority in the UK and is a member of the National Futures Association in the US. ________________________________ From boris at codesynthesis.com Mon Apr 2 13:22:14 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Apr 2 13:17:32 2012 Subject: [odb-users] Strange crash with composite primary key. In-Reply-To: References: Message-ID: Hi Davide, Davide Anastasia writes: > I am trying to obtain a composite primary key using this snippet: > > [...] Support for composite primary keys is only coming in ODB 1.9.0 so in the meantime you need to use the pre-release for this functionality: http://www.codesynthesis.com/pipermail/odb-users/2012-March/000470.html With 1.9.0 you will still have to make a couple of changed to your code to make it work: 1. Get rid of id() from: #pragma db object id() class ClipSize This declares ClipSize as not having object id at all. 2. Move ClipKey out of the ClipSize class. ODB doesn't support class- scope value type declarations yet. 3. Provide the less-than comparison operator for ClipKey: bool operator< (const ClipKey&, const ClipKey&); This is required for session support. Other than that, your code should work with 1.9.0.a1. Boris From prokher at gmail.com Sat Apr 7 11:48:36 2012 From: prokher at gmail.com (Alexander A. Prokhorov) Date: Sat Apr 7 11:48:48 2012 Subject: [odb-users] Variant type mapping? Message-ID: <4F8061D4.5010802@gmail.com> Dear colleagues, I was thinking about using ODB in my project, I've tried several trivial cases and it showed itself well. Then I've faced tricky case. I need to store Variant type (QVariant or boost::variant, whatever) in DB. Do you have any recommendations how to perform this? I understand that I can create table "Variants" with columns "id", "type_id", "type_specific_id", where "type_specific_id" points to the record in the table implicitly pointed by "type_id". I feel this approach 'smells' a little. Anyway I don't have an idea how to implement this with ODB. Can you give me an advice? Any ideas? Thank you in advance. From luisvaldes88 at gmail.com Sat Apr 7 19:07:04 2012 From: luisvaldes88 at gmail.com (=?ISO-8859-1?Q?Luis_Vald=E9s?=) Date: Sat Apr 7 19:07:11 2012 Subject: [odb-users] Variant type mapping? In-Reply-To: <4F8061D4.5010802@gmail.com> References: <4F8061D4.5010802@gmail.com> Message-ID: Hi, Can't you save your data just as a BLOB type and map it as a QByteArray in your c++ class?? So, you will read the BLOB column as a QByteArray object, and you can decide what to do with it later. class Whatever { public: long m_id; QByteArray m_variantData; }; namespace qx { template <> void register_class(QxClass< Whatever> & t) { t.id(& Whatever :: m_id , "id"); t.data(& Whatever :: m_variantData , "variantData"); } } 2012/4/7 Alexander A. Prokhorov > Dear colleagues, > > I was thinking about using ODB in my project, I've tried several trivial > cases and it showed itself well. Then I've faced tricky case. I need to > store Variant type (QVariant or boost::variant, whatever) in DB. Do you > have any recommendations how to perform this? I understand that I can > create table "Variants" with columns "id", "type_id", "type_specific_id", > where "type_specific_id" points to the record in the table implicitly > pointed by "type_id". I feel this approach 'smells' a little. Anyway I > don't have an idea how to implement this with ODB. Can you give me an > advice? Any ideas? > > Thank you in advance. > > -- Atentamente. Luis Valdes luisvaldes88@gmail.com (0994) 205 781 From boris at codesynthesis.com Sun Apr 8 04:17:01 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Apr 8 04:12:34 2012 Subject: [odb-users] Variant type mapping? In-Reply-To: <4F8061D4.5010802@gmail.com> References: <4F8061D4.5010802@gmail.com> Message-ID: Hi Alexander, Alexander A. Prokhorov writes: > I was thinking about using ODB in my project, I've tried several trivial > cases and it showed itself well. Then I've faced tricky case. I need to > store Variant type (QVariant or boost::variant, whatever) in DB. Do you > have any recommendations how to perform this? Hm, interesting question. The best approach would be to map a variant to something equivalent in SQL. MS SQL and Oracle have something like this (sql_variant and anytype, respectively) but other databases that ODB currently supports (MySQL, PG, and SQLite) don't have anything like this. Plus ODB currently doesn't have support for sql_variant and anytype, either, though we can add it if there is a need. A more portable approach would be to store the data as some sort of a type id plus text or, as Luis suggested, binary representation. Text might be a better option since it will be easier to access by other users of the data. I found this thread on the PostgreSQL mailing list quite interesting, in particular the fact that the text approach might actually be more efficient, storage-wise than the native variant type: http://archives.postgresql.org/pgsql-hackers/2011-05/msg00140.php Finally, the third option that I can think is to have a separate NULL-able column for each possible data type (this will probably work better for boost::variant than for QVariant). For each variant value only one of these columns will contain the data while all others will be NULL. The problem here is that there is no nice way to map a variant to a set of values like this in ODB, yet. Though, once we have support for the virtual data members feature (coming in 1.10.0) this will change. For more information on virtual member, see this thread: http://www.codesynthesis.com/pipermail/odb-users/2011-October/000352.html With virtual members, the mapping would look along these lines: #include // Can use boost::optional instead. #pragma db object class object { ... private: friend class odb::access; #pragma db transient boost::variant v_; typedef odb::nullable nint; typedef odb::nullable nstring; #pragma db member(v_int_) virtual(nint) \ get(this->v_.which () == 0 ? nint (get (this->v_)) : nint ()) \ set(if (?) this->v_ = (?)) #pragma db member(v_string_) virtual(nstring) \ get(this->v_.which () == 1 ? nstring (get (this->v_)) : nstring ()) \ set(if (?) this->v_ = (?)) }; In the meantime, the same can be emulated using callbacks and a bit of custom code: #include #pragma db object callback(convert_variant) class object { ... private: friend class odb::access; #pragma db transient boost::variant v_; mutable odb::nullable v_int_; mutable odb::nullable v_string_; void convert_variant (odb::callback_event e, odb::database&) { switch (e) { case odb::callback_event::post_load: { if (v_int_) v_ = *v_int_; else if (v_string_) v_ = *string_; break; } case odb::callback_event::pre_persist: case odb::callback_event::pre_update: { // Delegate to const version. static_cast (this)->convert_variant (); break; } default: break; } } void convert_variant (odb::callback_event e, odb::database&) const { switch (e) { case odb::callback_event::pre_persist: case odb::callback_event::pre_update: { switch (v_.which ()) { case 0: v_int_ = get (v_); break; case 1: v_string_ = get (v_); break; } break; } default: break; } } }; Boris From boris at codesynthesis.com Sun Apr 8 04:20:50 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Apr 8 04:16:22 2012 Subject: [odb-users] Variant type mapping? In-Reply-To: References: <4F8061D4.5010802@gmail.com> Message-ID: Hi Luis, Luis Vald?s writes: > class Whatever > { > public: > long m_id; > QByteArray m_variantData; > }; > > namespace qx > { > template <> void register_class(QxClass< Whatever> & t) > { > t.id(& Whatever :: m_id , "id"); > t.data(& Whatever :: m_variantData , "variantData"); > } > } In ODB, this will be just: #pragma db value class Whatever { public: long m_id; QByteArray m_variantData; }; No registration required ;-). Boris From luisvaldes88 at gmail.com Sun Apr 8 13:24:06 2012 From: luisvaldes88 at gmail.com (=?ISO-8859-1?Q?Luis_Vald=E9s?=) Date: Sun Apr 8 13:24:14 2012 Subject: [odb-users] Variant type mapping? In-Reply-To: References: <4F8061D4.5010802@gmail.com> Message-ID: Hi Boris, I was mixing code from another library and ODB in my mind. sorry for that. =D > In ODB, this will be just: > #pragma db value > class Whatever > { > public: > long m_id; > QByteArray m_variantData; > }; > No registration required ;-). Best Regards! -- Atentamente. Luis Valdes luisvaldes88@gmail.com (0994) 205 781 From princetoad at 126.com Tue Apr 10 23:10:05 2012 From: princetoad at 126.com (PrinceToad) Date: Tue Apr 10 23:10:12 2012 Subject: [odb-users] How does one select the TOP N rows from a table using ODB? Message-ID: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> I'm using SQL Server, and I'd like to select top N rows from a certain table. How can I achieve this using ODB? From n.albeza at gmail.com Wed Apr 11 04:17:06 2012 From: n.albeza at gmail.com (Nicolas ALBEZA) Date: Wed Apr 11 04:17:14 2012 Subject: [odb-users] How does one select the TOP N rows from a table using ODB? In-Reply-To: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> References: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> Message-ID: The only way i've found is along the lines of : result r = db.query(FooQuery::bar == 42 + " ORDER BY baz LIMIT 10"); But maybe Boris will be able to help you more =p Le 11 avril 2012 05:10, PrinceToad a ?crit : > I'm using SQL Server, and I'd like to select top N rows from a certain > table. > How can I achieve this using ODB? > -- ALBEZA "Pause" Nicolas From princetoad at 126.com Wed Apr 11 05:35:13 2012 From: princetoad at 126.com (PrinceToad) Date: Wed Apr 11 05:35:22 2012 Subject: [odb-users] How does one select the TOP N rows from a table using ODB? In-Reply-To: References: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> Message-ID: <121262ec.14bea.136a0c1bd3c.Coremail.princetoad@126.com> This may works for MySQL but MS SQL Server doesn't support keyword LIMIT, which has only keyword TOP and is just after the position of SELECT . such as: select TOP N * from footable At 2012-04-11 16:17:06,"Nicolas ALBEZA" wrote: The only way i've found is along the lines of : result r = db.query(FooQuery::bar == 42 + " ORDER BY baz LIMIT 10"); But maybe Boris will be able to help you more =p Le 11 avril 2012 05:10, PrinceToad a ?crit : I'm using SQL Server, and I'd like to select top N rows from a certain table. How can I achieve this using ODB? -- ALBEZA "Pause" Nicolas From n.albeza at gmail.com Wed Apr 11 06:33:31 2012 From: n.albeza at gmail.com (Nicolas ALBEZA) Date: Wed Apr 11 06:33:37 2012 Subject: [odb-users] How does one select the TOP N rows from a table using ODB? In-Reply-To: <121262ec.14bea.136a0c1bd3c.Coremail.princetoad@126.com> References: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> <121262ec.14bea.136a0c1bd3c.Coremail.princetoad@126.com> Message-ID: Then the only solution i know about is using Native Views: http://www.codesynthesis.com/products/odb/doc/manual.xhtml#9.5. But wait for Boris's answer, i never used ODB with a MS SQL DB, so i may have missed something. Le 11 avril 2012 11:35, PrinceToad a ?crit : > This may works for MySQL > but MS SQL Server doesn't support keyword LIMIT, which has only keyword > TOP and is just after the position of SELECT . > such as: > select TOP N * from footable > > > > At 2012-04-11 16:17:06,"Nicolas ALBEZA" wrote: > > The only way i've found is along the lines of : > > result r = db.query(FooQuery::bar == 42 + " ORDER BY baz LIMIT 10"); > > But maybe Boris will be able to help you more =p > > Le 11 avril 2012 05:10, PrinceToad a ?crit : > >> I'm using SQL Server, and I'd like to select top N rows from a certain >> table. >> How can I achieve this using ODB? >> > > > > -- > ALBEZA "Pause" Nicolas > > > > -- ALBEZA "Pause" Nicolas From boris at codesynthesis.com Wed Apr 11 07:07:59 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 11 07:03:41 2012 Subject: [odb-users] How does one select the TOP N rows from a table using ODB? In-Reply-To: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> References: <1889d8b0.5f4b.1369f6123d6.Coremail.princetoad@126.com> Message-ID: Hi, PrinceToad writes: > I'm using SQL Server, and I'd like to select top N rows from a certain > table. How can I achieve this using ODB? There are several options (in order or increased difficulty): 1. If you can switch to SQL Server 2012, then you can use the new OFFSET/FETCH clauses: size_t offset (0); size_t count (10); query q ((query::last == "Doe") + "OFFSET" + query::_ref (offset) + "ROWS" + "FETCH NEXT" + query::_ref (count) + "ROWS ONLY"); result r (db->query (q)); 2. Just count the number of rows you are interested in while iterating and then stop. In SQL Server the results are streamed from the database as you are iterating (instead of, for example, being loaded all at once into the client memory). So this won't me much less efficient than the above approach: query q (query::last == "Doe"); result r (db->query (q)); size_t count (10); for (result::iterator i (r.begin ()); i != r.end () && count != 0; ++i, --count) { ... } The major limitation of this approach is that there is not way to specify offset in a subsequent query. 3. If you have to use the "SELECT TOP N" syntax, then the only option is to use a native view and specify the SELECT statement yourself: http://www.codesynthesis.com/products/odb/doc/manual.xhtml#9.5 Boris From aakmail at mail.ru Wed Apr 11 03:33:27 2012 From: aakmail at mail.ru (=?UTF-8?B?QWxleGFuZGVyIEtvbmlu?=) Date: Wed Apr 11 07:08:10 2012 Subject: [odb-users] Building ODB with MinGW (GCC port for Windows) Message-ID: Hi, First, thanks for your ORM solution - ODB, at first sight it looks fine. I need to build ODB with MinGW (on Windows). Do you provide supporting for this (make files, for instance)? Thanks. Best regards, Alex, software developer From boris at codesynthesis.com Wed Apr 11 08:30:04 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 11 08:25:46 2012 Subject: [odb-users] Building ODB with MinGW (GCC port for Windows) In-Reply-To: References: Message-ID: Hi Alexander, Alexander Konin writes: > I need to build ODB with MinGW (on Windows). Do you provide supporting > for this (make files, for instance)? Yes, we test each release of ODB on MinGW. You will need to get the pre-built ODB compiler binary for Windows and then you can build the runtimes/examples/tests using the standard autotools build system (i.e., ./configure && make; see INSTALL files in the corresponding packages for details). If you don't have the MSYS shell, then you can use one that comes with the ODB compiler (odb-X.Y.Z-i686-windows/mingw/msys.bat). This is how we build and test ODB on MinGW ourselves. Boris From hacklew at hotmail.com Fri Apr 20 05:26:21 2012 From: hacklew at hotmail.com (Wayne Hackle) Date: Fri Apr 20 05:26:28 2012 Subject: [odb-users] Weak pointer can't be converted to shared pointer Message-ID: Dear Boris and all, I used "vector >" to store a "reply" object and I am now having problem using the weak pointers. Code as follows: string strReplies; typedef vector > reply_type; reply_type vec_reply = msg.replies(); for (reply_type::iterator i(vec_reply.begin()); i != vec_reply.end(); i++) { weak_ptr wp_rep(*i); shared_ptr sp_rep = i->lock(); strReplies.append(sp_rep->content()); } debug shows the shared_ptr sp_rep address is void (all 0x000000). I am almost sure it's something dead simple but I just can't find out what it is. All my searches failed me. Before using weak_ptr, I used lazy_weak_ptr and it worked, but it has to be used with in a transaction (otherwise an out_of_transaction is thrown), which is a bit ugly or out of place. Could somebody help please, appreciate it! Hackle From boris at codesynthesis.com Fri Apr 20 06:32:36 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Apr 20 06:28:43 2012 Subject: [odb-users] Weak pointer can't be converted to shared pointer In-Reply-To: References: Message-ID: Hi Wayne, weak_ptr will only be valid if there is at least one shared_ptr still pointing to the object (for more information on the shared/weak pointers semantics, refer to their documentation). In case of ODB, this would normally mean that for weak_ptr to be valid, there needs to be another object with shared_ptr pointing to the same object or there needs to be a session. As an example, consider these two classes: class employee { shared_ptr employer_; }; class employer { weak_ptr ceo_; }; If you do something like this: shared_ptr er (db->load (...)); Then the er->ceo_ pointer will be loaded, assigned to weak_ptr, and, since there is no other shared_ptr pointing to it, immediately freed. And the er->ceo_ will be NULL. On the other hand, if we have something like this: session s; shared_ptr er (db->load (...)); Then the er->ceo_ pointer will be loaded, cached in session (as shared_ptr), and assigned to weak_ptr. Since the session holds shared_ptr, er->ceo_ will be valid. Similarly, if we have something like this: shared_ptr ee (db->load (...)); Provided that ee is the CEO, then ee->employer_.ceo_ will be valid since we hold shared_ptr. Boris From Davide.Anastasia at qualitycapital.com Wed Apr 25 09:27:42 2012 From: Davide.Anastasia at qualitycapital.com (Davide Anastasia) Date: Wed Apr 25 09:32:27 2012 Subject: [odb-users] one-many relationship with abstract class Message-ID: Hi, I would like to realize a one-many relationship between and abstract class and another class (non abstract). Inherited classes from the abstract class are already defined, but I would love to have the primary key as member of the abstract class and see the inherited as pure extension of the base-abstract class. Is this possible somehow? Thanks, Davide Anastasia Analyst, Research & Development Quality Capital Management Ltd. QCM House * Horizon Business Village No. 1 Brooklands Road Weybridge * Surrey KT13 0TJ United Kingdom Tel: +44 (0) 1932 334 400 Fax: +44 (0) 1932 334 415 Email: Davide.Anastasia@QualityCapital.com www.qualitycapital.com ________________________________ This email and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Quality Capital Management Ltd. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this email in error. You should also be aware that emails are susceptible to interference and you should not assume that the contents of this email originated from the sender above or that they have been accurately reproduced in their original form. Quality Capital Management Ltd is authorised and regulated by the Financial Services Authority in the UK and is a member of the National Futures Association in the US. ________________________________ From boris at codesynthesis.com Wed Apr 25 11:26:06 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 25 11:22:28 2012 Subject: [odb-users] one-many relationship with abstract class In-Reply-To: References: Message-ID: Hi Davide, Davide Anastasia writes: > I would like to realize a one-many relationship between and abstract > class and another class (non abstract). > > Inherited classes from the abstract class are already defined, but I > would love to have the primary key as member of the abstract class and > see the inherited as pure extension of the base-abstract class. > > Is this possible somehow? It will be with polymorphism support. The next version of ODB which adds this support should be out any day now. Boris From Davide.Anastasia at qualitycapital.com Wed Apr 25 11:23:55 2012 From: Davide.Anastasia at qualitycapital.com (Davide Anastasia) Date: Wed Apr 25 11:24:50 2012 Subject: [odb-users] one-many relationship with abstract class In-Reply-To: References: Message-ID: Hi Boris, Thanks a lot. We are currently using the 1.9.0.a1: does this version support already this feature? Best, Davide -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 25 April 2012 16:26 To: Davide Anastasia Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] one-many relationship with abstract class Hi Davide, Davide Anastasia writes: > I would like to realize a one-many relationship between and abstract > class and another class (non abstract). > > Inherited classes from the abstract class are already defined, but I > would love to have the primary key as member of the abstract class and > see the inherited as pure extension of the base-abstract class. > > Is this possible somehow? It will be with polymorphism support. The next version of ODB which adds this support should be out any day now. Boris From boris at codesynthesis.com Wed Apr 25 11:33:09 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 25 11:29:31 2012 Subject: [odb-users] one-many relationship with abstract class In-Reply-To: References: Message-ID: Hi Davide, Davide Anastasia writes: > We are currently using the 1.9.0.a1: does this version support already > this feature? No, that feature was finished after the 1.9.0.a1 release. Boris From thomas.szumowski at lmco.com Thu Apr 26 08:39:58 2012 From: thomas.szumowski at lmco.com (Szumowski, Thomas) Date: Thu Apr 26 08:40:11 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h Message-ID: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> I am trying to compile the basic person.hxx example from the top of the user manual and am running into problems. The code is below along with commands indicating my machine and gcc status. The machine is a 32-bit 11.10 Ubuntu OS. Any tips? ----------------------------------------------------------------------------- COMPILE ERROR ----------------------------------------------------------------------------- user@ubuntu-VirtualBox:/opt/odb/bin$ ./odb -d sqlite --generate-query --trace person.hxx starting plugin odb In file included from /usr/include/features.h:388:0, from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/os_defines.h:39, from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/c++config.h:275, from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/string:40, from person.hxx:4: /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory compilation terminated. ----------------------------------------------------------------------------- MACHINE INFORMATION ----------------------------------------------------------------------------- user@ubuntu-VirtualBox:/opt/odb/bin$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) user@ubuntu-VirtualBox:/opt/odb/bin$ uname -rm 3.0.0-12-generic i686 user@ubuntu-VirtualBox:/opt/odb/bin$ file /sbin/init /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped Tom Szumowski Lockheed Martin - Advanced Technology Laboratories Phone: (856) 792-9077 E-mail: thomas.szumowski@lmco.com From amr.ali.cc at gmail.com Thu Apr 26 08:46:49 2012 From: amr.ali.cc at gmail.com (Amr Ali) Date: Thu Apr 26 08:47:20 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h In-Reply-To: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> References: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> Message-ID: <4F9943B9.4060201@gmail.com> Install gcc-multilib "sudo apt-get install gcc-multilib" On 04/26/2012 02:39 PM, Szumowski, Thomas wrote: > I am trying to compile the basic person.hxx example from the top of the user manual and am running into problems. The code is below along with commands indicating my machine and gcc status. The machine is a 32-bit 11.10 Ubuntu OS. Any tips? > > > ----------------------------------------------------------------------------- > COMPILE ERROR > ----------------------------------------------------------------------------- > > user@ubuntu-VirtualBox:/opt/odb/bin$ ./odb -d sqlite --generate-query --trace person.hxx > starting plugin odb > In file included from /usr/include/features.h:388:0, > from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/os_defines.h:39, > from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/c++config.h:275, > from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/string:40, > from person.hxx:4: > /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory > compilation terminated. > > ----------------------------------------------------------------------------- > MACHINE INFORMATION > ----------------------------------------------------------------------------- > > user@ubuntu-VirtualBox:/opt/odb/bin$ gcc -v > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper > Target: i686-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu > Thread model: posix > gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) > > user@ubuntu-VirtualBox:/opt/odb/bin$ uname -rm > 3.0.0-12-generic i686 > > user@ubuntu-VirtualBox:/opt/odb/bin$ file /sbin/init > /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped > > > > Tom Szumowski > Lockheed Martin - Advanced Technology Laboratories > Phone: (856) 792-9077 > E-mail: thomas.szumowski@lmco.com > -- Amr Ali -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature Url : http://codesynthesis.com/pipermail/odb-users/attachments/20120426/8c146151/signature.pgp From thomas.szumowski at lmco.com Thu Apr 26 08:52:10 2012 From: thomas.szumowski at lmco.com (Szumowski, Thomas) Date: Thu Apr 26 08:52:27 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h In-Reply-To: References: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> Message-ID: <3D451224667B604991DC8794518186E9080A41@HVXDSP42.us.lmco.com> Thanks for the quick reply Artur. So far I installed: sudo apt-get install gcc-multilib sudo apt-get install g++-multilib When I try to install libc6-dev-i386, I get the following error below (after doing apt-get update). What's odd is in searching I've only seen this error with respect to 64 bit machines attempting to build 32-bit libraries. I am on a 64 bit machine, but using a 32-bit virtualbox image. The logs from the 1st email seem to indicate so as well. --------------------------------------- user@ubuntu-VirtualBox:/opt/odb/bin$ sudo apt-get install libc6-dev-i386 Reading package lists... Done Building dependency tree Reading state information... Done Package libc6-dev-i386 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libc6-dev-i386' has no installation candidate From: Artur Shaihullin [mailto:ashaihullin@gmail.com] Sent: Thursday, April 26, 2012 8:44 AM To: Szumowski, Thomas Subject: EXTERNAL: Re: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h May be you need install libc6-dev-i386 2012/4/26 Szumowski, Thomas > I am trying to compile the basic person.hxx example from the top of the user manual and am running into problems. The code is below along with commands indicating my machine and gcc status. The machine is a 32-bit 11.10 Ubuntu OS. Any tips? ----------------------------------------------------------------------------- COMPILE ERROR ----------------------------------------------------------------------------- user@ubuntu-VirtualBox:/opt/odb/bin$ ./odb -d sqlite --generate-query --trace person.hxx starting plugin odb In file included from /usr/include/features.h:388:0, from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/os_defines.h:39, from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/c++config.h:275, from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/string:40, from person.hxx:4: /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory compilation terminated. ----------------------------------------------------------------------------- MACHINE INFORMATION ----------------------------------------------------------------------------- user@ubuntu-VirtualBox:/opt/odb/bin$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) user@ubuntu-VirtualBox:/opt/odb/bin$ uname -rm 3.0.0-12-generic i686 user@ubuntu-VirtualBox:/opt/odb/bin$ file /sbin/init /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped Tom Szumowski Lockheed Martin - Advanced Technology Laboratories Phone: (856) 792-9077 E-mail: thomas.szumowski@lmco.com> -- Best Regards, Artur Shain From amr.ali.cc at gmail.com Thu Apr 26 09:13:14 2012 From: amr.ali.cc at gmail.com (Amr Ali) Date: Thu Apr 26 09:13:39 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h In-Reply-To: <3D451224667B604991DC8794518186E9080A41@HVXDSP42.us.lmco.com> References: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> <3D451224667B604991DC8794518186E9080A41@HVXDSP42.us.lmco.com> Message-ID: <4F9949EA.9090404@gmail.com> have you got libc6-dev installed? On 04/26/2012 02:52 PM, Szumowski, Thomas wrote: > Thanks for the quick reply Artur. So far I installed: > sudo apt-get install gcc-multilib > sudo apt-get install g++-multilib > > When I try to install libc6-dev-i386, I get the following error below (after doing apt-get update). What's odd is in searching I've only seen this error with respect to 64 bit machines attempting to build 32-bit libraries. I am on a 64 bit machine, but using a 32-bit virtualbox image. The logs from the 1st email seem to indicate so as well. > > --------------------------------------- > user@ubuntu-VirtualBox:/opt/odb/bin$ sudo apt-get install libc6-dev-i386 > Reading package lists... Done > Building dependency tree > Reading state information... Done > Package libc6-dev-i386 is not available, but is referred to by another package. > This may mean that the package is missing, has been obsoleted, or > is only available from another source > > E: Package 'libc6-dev-i386' has no installation candidate > > > From: Artur Shaihullin [mailto:ashaihullin@gmail.com] > Sent: Thursday, April 26, 2012 8:44 AM > To: Szumowski, Thomas > Subject: EXTERNAL: Re: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h > > May be you need install libc6-dev-i386 > 2012/4/26 Szumowski, Thomas > > I am trying to compile the basic person.hxx example from the top of the user manual and am running into problems. The code is below along with commands indicating my machine and gcc status. The machine is a 32-bit 11.10 Ubuntu OS. Any tips? > > > ----------------------------------------------------------------------------- > COMPILE ERROR > ----------------------------------------------------------------------------- > > user@ubuntu-VirtualBox:/opt/odb/bin$ ./odb -d sqlite --generate-query --trace person.hxx > starting plugin odb > In file included from /usr/include/features.h:388:0, > from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/os_defines.h:39, > from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-linux-gnu/bits/c++config.h:275, > from /opt/odb/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.5.1/../../../../include/c++/4.5.1/string:40, > from person.hxx:4: > /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory > compilation terminated. > > ----------------------------------------------------------------------------- > MACHINE INFORMATION > ----------------------------------------------------------------------------- > > user@ubuntu-VirtualBox:/opt/odb/bin$ gcc -v > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper > Target: i686-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu > Thread model: posix > gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) > > user@ubuntu-VirtualBox:/opt/odb/bin$ uname -rm > 3.0.0-12-generic i686 > > user@ubuntu-VirtualBox:/opt/odb/bin$ file /sbin/init > /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped > > > > Tom Szumowski > Lockheed Martin - Advanced Technology Laboratories > Phone: (856) 792-9077 > E-mail: thomas.szumowski@lmco.com> > > > > -- > Best Regards, > Artur Shain > -- Amr Ali -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature Url : http://codesynthesis.com/pipermail/odb-users/attachments/20120426/1301c473/signature.pgp From boris at codesynthesis.com Thu Apr 26 09:50:10 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Apr 26 09:46:33 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h In-Reply-To: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> References: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> Message-ID: Hi Thomas, Szumowski, Thomas writes: > /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such > file or directory I think this is caused by new Debian/Ubuntu multi-arch support. Now, architecture-specific headers are installed into separate directories and the Debian/Ubuntu-built GCC is configured to automatically add them depending on the target architecture (i.e., the -m option). On the other hand, GCC that comes with the ODB binary package is not yet equipped to deal with that. If I am right, then you should be able to find the stubs-32.h file in the /usr/include/i386-linux-gnu/gnu/ directory. If that's the case, then a simple way to resolve this error would be to add this line to the odb-X.Y.Z-i686-linux-gnu/etc/odb/default.options file: -I/usr/include/i386-linux-gnu Let me know if this method works for you so that we can add this line by default in future released of ODB. Alternatively, you can build the ODB compiler from source so that it uses the Debian/Ubuntu-built GCC. Simply get the ODB compiler source code package (odb-X.Y.Z.tar.bz2), then do: $ sudo apt-get install gcc-4.6-plugin-dev $ tar xfj odb-X.Y.Z.tar.bz2 $ cd odb-X.Y.Z $ ./configure $ make $ sudo make install Boris From danielpeterjames at gmail.com Thu Apr 26 10:14:26 2012 From: danielpeterjames at gmail.com (Daniel James) Date: Thu Apr 26 10:14:54 2012 Subject: [odb-users] clang and libc++ Message-ID: Hi All I'm running into a problem when using the binary MacOS ODB compiler and libodb*.dylib compiled with clang++ and linked to libc++. Is this supported? Here's an example of the link error I'm getting: "odb::sqlite::default_value_traits, std::__1::allocator >, (odb::sqlite::database_type_id)2>::set_image(odb::details::basic_buffer&, unsigned long&, bool&, std::__1::basic_string, std::__1::allocator > const&)", referenced from: odb::access::object_traits::init(odb::access::object_traits::image_type&, person const&, odb::sqlite::statement_kind) in person-odb.o Is it that the templates are not being instantiated for std::__1::basic_string by the ODB plugin? If this is the case can I compile/configure the ODB plugin in such a way that it will know about libc++ classes? Many thanks, Daniel From boris at codesynthesis.com Thu Apr 26 10:51:22 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Apr 26 10:47:45 2012 Subject: [odb-users] clang and libc++ In-Reply-To: References: Message-ID: Hi Daniel, Daniel James writes: > I'm running into a problem when using the binary MacOS ODB compiler > and libodb*.dylib compiled with clang++ and linked to libc++. > > Is this supported? We haven't tried this configuration ourselves yet, but it should work, provided libc++ is complete enough. > Here's an example of the link error I'm getting: > > "odb::sqlite::default_value_traits std::__1::char_traits, std::__1::allocator >, > (odb::sqlite::database_type_id)2>::set_image(odb::details::basic_buffer&, > unsigned long&, bool&, std::__1::basic_string std::__1::char_traits, std::__1::allocator > const&)", > referenced from: > odb::access::object_traits::init(odb::access::object_traits::image_type&, > person const&, odb::sqlite::statement_kind) in person-odb.o This looks like you are not linking to libodb-sqlite-*.dylib. You need to build and link to this library if you are using SQLite. > Is it that the templates are not being instantiated for > std::__1::basic_string by the ODB plugin? > > If this is the case can I compile/configure the ODB plugin in such a > way that it will know about libc++ classes? ODB plugin doesn't really instantiate anything nor does it care about which standard C++ library implementation you use to build your application. It is standard C++ in, standard C++ out. You should then be able to compile the output C++ code with any reasonably conforming compiler. Let us know how it goes. Boris From thomas.szumowski at lmco.com Thu Apr 26 11:11:04 2012 From: thomas.szumowski at lmco.com (Szumowski, Thomas) Date: Thu Apr 26 11:13:26 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h In-Reply-To: References: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> Message-ID: <3D451224667B604991DC8794518186E9080AB2@HVXDSP42.us.lmco.com> Boris, Here are my results: --------------- Option 1 - Adding to default.options: SUCCESS The stubs-32.h file is in the /usr/include/i386-linux-gnu/gnu directory, and adding the -I command to the default.options file worked. I was able to generate working executables from it. However, when I ran odb compiler with --trace enabled, I got an interesting output (attached). I attached it for completeness, but it doesn't affect my end. Everything still worked. ---------------- Option 2 - Compiling from source: SUCCESS Initially I didn't have libcutl, so I downloaded, built, and installed it from http://www.codesynthesis.com/projects/libcutl/. After that it compiled fine. Thank you for your help! Tom Szumowski Lockheed Martin - Advanced Technology Laboratories Phone: (856) 792-9077 E-mail:? thomas.szumowski@lmco.com -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Thursday, April 26, 2012 9:50 AM To: Szumowski, Thomas Cc: odb-users@codesynthesis.com Subject: EXTERNAL: Re: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h Hi Thomas, Szumowski, Thomas writes: > /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such > file or directory I think this is caused by new Debian/Ubuntu multi-arch support. Now, architecture-specific headers are installed into separate directories and the Debian/Ubuntu-built GCC is configured to automatically add them depending on the target architecture (i.e., the -m option). On the other hand, GCC that comes with the ODB binary package is not yet equipped to deal with that. If I am right, then you should be able to find the stubs-32.h file in the /usr/include/i386-linux-gnu/gnu/ directory. If that's the case, then a simple way to resolve this error would be to add this line to the odb-X.Y.Z-i686-linux-gnu/etc/odb/default.options file: -I/usr/include/i386-linux-gnu Let me know if this method works for you so that we can add this line by default in future released of ODB. Alternatively, you can build the ODB compiler from source so that it uses the Debian/Ubuntu-built GCC. Simply get the ODB compiler source code package (odb-X.Y.Z.tar.bz2), then do: $ sudo apt-get install gcc-4.6-plugin-dev $ tar xfj odb-X.Y.Z.tar.bz2 $ cd odb-X.Y.Z $ ./configure $ make $ sudo make install Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: trace.log Type: application/octet-stream Size: 0 bytes Desc: trace.log Url : http://codesynthesis.com/pipermail/odb-users/attachments/20120426/d034350f/trace-0001.obj From danielpeterjames at gmail.com Thu Apr 26 11:35:01 2012 From: danielpeterjames at gmail.com (Daniel James) Date: Thu Apr 26 11:35:30 2012 Subject: [odb-users] clang and libc++ In-Reply-To: References: Message-ID: On 26 April 2012 15:51, Boris Kolpackov wrote: > Hi Daniel, > > Daniel James writes: > >> I'm running into a problem when using the binary MacOS ODB compiler >> and libodb*.dylib compiled with clang++ and linked to libc++. >> >> Is this supported? > > We haven't tried this configuration ourselves yet, but it should work, > provided libc++ is complete enough. > > >> Here's an example of the link error I'm getting: >> >> ? "odb::sqlite::default_value_traits> std::__1::char_traits, std::__1::allocator >, >> (odb::sqlite::database_type_id)2>::set_image(odb::details::basic_buffer&, >> unsigned long&, bool&, std::__1::basic_string> std::__1::char_traits, std::__1::allocator > const&)", >> referenced from: >> ? ? ? odb::access::object_traits::init(odb::access::object_traits::image_type&, >> person const&, odb::sqlite::statement_kind) in person-odb.o > > This looks like you are not linking to libodb-sqlite-*.dylib. You need > to build and link to this library if you are using SQLite. > Indeed, my libodb-sqlite-1.8.0.dylib was causing problems. It seems I had managed to compile it with libstdc++ symbols rather than libc++. I recompiled more carefully and now things seem to be working :) For info, I'm linking to libc++.1.dylib with: $ clang --version Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) Target: x86_64-apple-darwin11.3.0 Thread model: posix I'm now looking forward to the odb-1.9.0 release! Thanks, Daniel From boris at codesynthesis.com Thu Apr 26 12:20:13 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Apr 26 12:16:38 2012 Subject: [odb-users] Can't compile simple person.hxx- gcc error in /usr/include/gnu/stubs.h In-Reply-To: <3D451224667B604991DC8794518186E9080AB2@HVXDSP42.us.lmco.com> References: <3D451224667B604991DC8794518186E9080A0F@HVXDSP42.us.lmco.com> <3D451224667B604991DC8794518186E9080AB2@HVXDSP42.us.lmco.com> Message-ID: Hi Thomas, Szumowski, Thomas writes: > Option 1 - Adding to default.options: SUCCESS > Option 2 - Compiling from source: SUCCESS Thanks for trying both and sharing the results. > However, when I ran odb compiler with --trace enabled, I got an > interesting output (attached). I think your firewall stripped it (I see a file of 0 bytes) but I think I know what it shows (I tried to run ODB with --trace and got a segfault). I've fixed the bug (it only affect the --trace option). Also, what you are probably looking for is not --trace but -v (similar to GCC's -v), which shows the underlying tools being run, etc. Boris From abodrin at gmail.com Sat Apr 28 04:04:56 2012 From: abodrin at gmail.com (=?koi8-r?B?4dLUo80g4s/E0snO?=) Date: Sat Apr 28 11:34:24 2012 Subject: [odb-users] Errors in a documentation Message-ID: Still reading it (pdf version, Revision 1.8 January 2012), but found a couple 1) page 47, 3.11 Deleting Persistent Objects Misspelling in example code line (error letter capitalized): db.erase_query (query::last == "Doe" && query::aRe < 30); I guess there must be query::age... 2) page 61, 4.3 Executing a Query At the end there is an example, declaring function named find_minors but after that calling find_underage Regards, Artem Bodrin ?????????? ? iPhone From boris at codesynthesis.com Sat Apr 28 11:47:07 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Apr 28 11:43:38 2012 Subject: [odb-users] Errors in a documentation In-Reply-To: References: Message-ID: Hi Artem, I've fixed them for the upcoming release. Thanks for reporting this, much appreciated! Boris From khaldon_hmesheh at yahoo.com Mon Apr 30 04:04:57 2012 From: khaldon_hmesheh at yahoo.com (khaldon hmesheh) Date: Mon Apr 30 04:05:05 2012 Subject: [odb-users] Use ODB Message-ID: <1335773097.37075.YahooMailNeo@web113617.mail.gq1.yahoo.com> Hallo Everybody, I got a problem when I tried to get the examples work. I am using windows xp with vc2008. I got the following error box told me that the file odb-sqlite-d-1.8-vc9.dll not found. When I looked for it I have found it in the directory ..ODB\libodb-sqlite-1.8.0\bin. Please any help. Thanks in advance Khaldon From boris at codesynthesis.com Mon Apr 30 04:23:49 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Apr 30 04:20:25 2012 Subject: [odb-users] Use ODB In-Reply-To: <1335773097.37075.YahooMailNeo@web113617.mail.gq1.yahoo.com> References: <1335773097.37075.YahooMailNeo@web113617.mail.gq1.yahoo.com> Message-ID: Hi Khaldon, khaldon hmesheh writes: > I got a problem when I tried to get the examples work. I am using windows > xp with vc2008. I got the following error box told me that the file > odb-sqlite-d-1.8-vc9.dll not found. When I looked for it I have found > it in the directory ..ODB\libodb-sqlite-1.8.0\bin. You need to add ..ODB\libodb-sqlite-1.8.0\bin (and ..ODB\libodb-1.8.0\bin) to the PATH environment variable (Control Panel->System->Advanced-> Environment Variables, look in the System Variables list). Also don't forget to log off and then log in again for the changes to take effect. Boris From danielpeterjames at gmail.com Mon Apr 30 09:25:55 2012 From: danielpeterjames at gmail.com (Daniel James) Date: Mon Apr 30 09:26:24 2012 Subject: [odb-users] lookup ambiguity on db.query member template Message-ID: Hi I'm getting the following warning when compiling with clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) driver.cxx:71:31: warning: lookup of 'query' in member access expression is ambiguous; using member of 'odb::sqlite::database' [-Wambiguous-member-template] odb::result arrays(db.query()); ^ /Users/dj5/opt/include/odb/database.ixx:243:3: note: lookup in the object type 'odb::sqlite::database' refers here query (bool cache) ^ /Users/dj5/opt/include/odb/query.hxx:71:9: note: lookup from the current scope refers here class query; ^ I've included the following, possibly relevant headers: #include #include #include #include #include #include I'm not sure if this is a known issue or if it's enough info to work with? I think the correct one has been chosen any way! Daniel From boris at codesynthesis.com Mon Apr 30 10:46:24 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Apr 30 10:43:00 2012 Subject: [odb-users] lookup ambiguity on db.query member template In-Reply-To: References: Message-ID: Hi Daniel, Daniel James writes: > I'm getting the following warning when compiling with clang: > > driver.cxx:71:31: warning: lookup of 'query' in member access expression is > ambiguous; using member of 'odb::sqlite::database' > [-Wambiguous-member-template] > odb::result arrays(db.query()); Yes, I saw these when testing the upcoming release of ODB with Clang. It looks like Clang is following some obscure (and possibly misguided) C++ rule to the letter (as it tends to do). I can't see how query in the db.query() expression can possibly be ambiguous. The part that is triggering the ambiguity is this using directive: using namespace odb::core; It brings odb::query class template to the global namespace where Clang manages to find it. I couldn't come up with a non-invasive fix for this warning on my side. It looks like the only way to get rid of it for good is to rename database::query() or odb::query (or remove odb::query from odb::core). I like none of these options. On the user side the fix is easy, however; simply don't use the using namespace odb::core directive (I see you are qualifying odb::result anyway). Boris