Results 1 to 6 of 6

Thread: got problem when compiled QxOrm.

  1. #1
    Join Date
    Apr 2012
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default got problem when compiled QxOrm.

    Hello,
    I'm new in Qt Programming and I'm not very well in english.
    I'm interesting in your QxOrm very much. It's look like powerful program.
    I was download Boost Library and QxOrm compiled and install it.
    Everything compiled OK. and then I used your sample code to test it.
    But I got the error and got red underline on
    QX_REGISTER_HPP_MY_TEST_EXE(drug, qx::trait::no_base_class_defined, 1)
    and
    QX_REGISTER_CPP_MY_TEST_EXE(drug)
    when I compiled it.
    what should I solution this problem?
    my project.pro is :

    QT += core QxOrm

    QT -= gui

    TARGET = drugexample
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app


    SOURCES += main.cpp \
    drug.cpp

    HEADERS += \
    drug.h

    it's generated by Qt console program.

    Best Regard,
    Ole

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: got problem when compiled QxOrm.

    Hello Ole,

    The "Quick example step by step" is incomplete. You need to add:

    precompiled.h:
    Qt Code:
    1. #ifndef _QX_TEST_PRECOMPILED_HEADER_H_
    2. #define _QX_TEST_PRECOMPILED_HEADER_H_
    3.  
    4. #include <QxOrm.h>
    5.  
    6. #include "export.h"
    7.  
    8. #endif // _QX_TEST_PRECOMPILED_HEADER_H_
    To copy to clipboard, switch view to plain text mode 

    export.h
    Qt Code:
    1. #ifndef _MY_TEST_EXE_EXPORT_H_
    2. #define _MY_TEST_EXE_EXPORT_H_
    3.  
    4. #ifdef _BUILDING_MY_TEST_EXE
    5. #define MY_TEST_EXE_DLL_EXPORT QX_DLL_EXPORT_HELPER
    6. #else // _BUILDING_MY_TEST_EXE
    7. #define MY_TEST_EXE_DLL_EXPORT QX_DLL_IMPORT_HELPER
    8. #endif // _BUILDING_MY_TEST_EXE
    9.  
    10. #ifdef _BUILDING_MY_TEST_EXE
    11. #define QX_REGISTER_HPP_MY_TEST_EXE QX_REGISTER_HPP_EXPORT_DLL
    12. #define QX_REGISTER_CPP_MY_TEST_EXE QX_REGISTER_CPP_EXPORT_DLL
    13. #else // _BUILDING_MY_TEST_EXE
    14. #define QX_REGISTER_HPP_MY_TEST_EXE QX_REGISTER_HPP_IMPORT_DLL
    15. #define QX_REGISTER_CPP_MY_TEST_EXE QX_REGISTER_CPP_IMPORT_DLL
    16. #endif // _BUILDING_MY_TEST_EXE
    17.  
    18. #endif // _MY_TEST_EXE_EXPORT_H_
    To copy to clipboard, switch view to plain text mode 

    and a pro file like:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = test
    3.  
    4. CONFIG += precompile_header
    5. PRECOMPILED_HEADER = precompiled.h
    6.  
    7. INCLUDEPATH += /usr/local/QxOrm/include
    8. LIBS += -L/usr/local/QxOrm/lib -lQxOrm
    9.  
    10. # Input
    11. HEADERS += drug.h
    12. SOURCES += drug.cpp main.cpp
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Apr 2012
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: got problem when compiled QxOrm.

    Hello ChrisW67,
    Thanks for your reply. I was compiled everything in Microsoft Windows 7 and use CYGWIN to build library. Everything was compiled OK. But it's still not work then it's has another occur like this :

    debug/drug.o: In function `extended_type_info_typeid':
    c:/Qt/2010.05/qt/include/boost/serialization/extended_type_info_typeid.hpp:86: undefined reference to `boost::serialization::typeid_system::extended_typ e_info_typeid_0::extended_type_info_typeid_0(char const*)'
    c:/Qt/2010.05/qt/include/boost/serialization/extended_type_info_typeid.hpp:88: undefined reference to `boost::serialization::typeid_system::extended_typ e_info_typeid_0::type_register(std::type_info const&)'
    c:/Qt/2010.05/qt/include/boost/serialization/extended_type_info_typeid.hpp:89: undefined reference to `boost::serialization::extended_type_info::key_reg ister() const'
    .
    .
    .
    seem like it's not link to library, right?
    I try to compiled boost with visual studio 2008 and then it have error occur because the "libboost_serialization-vc90-mt-gd-1_42" not found.
    when I change the solution to compiled with CYGWIN everything is OK and it can be build QxOrm too.
    I was change my file with your recommendation and then it still error occur that I shown you on the top. What should I do?
    So sorry about my english skill and thanks a lot for your help.

    Best Regards,
    Ole.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: got problem when compiled QxOrm.

    Then you need to ensure that your linker can find the Boost libraries. You do that with appropriate LIBS options in your PRO file; probably a single "-L" option and one or more "-l" options. The exact details will depend on where you have things installed and which Boost libraries are required.

  5. #5
    Join Date
    Apr 2012
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: got problem when compiled QxOrm.

    Hello ChrisW67,

    I still not yet done on QxOrm. I'm sure about my library and include file are correct.
    Because I can build and run example program with boost library.
    Then I build QxOrm everything is done too. But I got the new problem like this :

    debug/drug.o: In function `IxClass':
    c:/Qt/2010.05/qt/include/QxRegister/IxClass.h:80: undefined reference to `vtable for qx::IxClass'
    debug/drug.o:c:/Qt/2010.05/qt/include/QxTraits/get_sql_type.h:185: undefined reference to `qx::trait::detail::get_sql_type_by_class_name(cha r const*, char const*)'
    debug/drug.o:c:/Qt/2010.05/qt/include/QxTraits/get_sql_type.h:196: undefined reference to `qx::trait::detail::get_sql_type_by_class_name(cha r const*, char const*)'
    debug/drug.o: In function `QxClass':
    c:/Qt/2010.05/qt/include/../../inl/QxRegister/QxClass.inl:178: undefined reference to `qx::IxClass::~IxClass()'
    debug/drug.o: In function `QxCollection':
    c:/Qt/2010.05/qt/include/../../inl/QxCollection/QxCollection.inl:30: undefined reference to `qx::IxCollection::~IxCollection()'
    debug/drug.o: In function `~QxCollection':
    c:/Qt/2010.05/qt/include/../../inl/QxCollection/QxCollection.inl:41: undefined reference to `qx::IxCollection::~IxCollection()'
    c:/Qt/2010.05/qt/include/../../inl/QxCollection/QxCollection.inl:41: undefined reference to `qx::IxCollection::~IxCollection()'
    c:/Qt/2010.05/qt/include/../../inl/QxCollection/QxCollection.inl:41: undefined reference to `qx::IxCollection::~IxCollection()'
    c:/Qt/2010.05/qt/include/../../inl/QxCollection/QxCollection.inl:41: undefined reference to `qx::IxCollection::~IxCollection()'
    .
    .
    .

    I see underline error on QX_DLL_EXPORT seem like the same problem in the first time that I ask you.
    What should I do next?

    Regards,
    Ole.

  6. #6
    Join Date
    Apr 2012
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: got problem when compiled QxOrm.

    I have done on boost version 1.43
    Thanks for answer me.

Similar Threads

  1. QxOrm : Persistence (ORM), Serialization, Reflection
    By QxOrm in forum Qt-based Software
    Replies: 19
    Last Post: 27th January 2014, 04:36
  2. Problem with self compiled QTCreator
    By Bavooo in forum Installation and Deployment
    Replies: 1
    Last Post: 20th October 2011, 23:08
  3. Replies: 1
    Last Post: 27th April 2011, 14:43
  4. Replies: 3
    Last Post: 20th September 2010, 22:36
  5. Replies: 4
    Last Post: 25th April 2009, 14:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.