can't build "drug" sample on Linux

Forum for posting problems using QxOrm library

can't build "drug" sample on Linux

Postby curtis.bradley » Wed Nov 25, 2020 6:13 pm

Centos - 7.9.2009
GCC - gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
QT - 5.12.5
Boost - 1.74
QxOrm - 1.4.7


====
Boost, Qt and QxOrm have been fully installed.
====
Trying to build the sample, here: https://www.qxorm.com/doxygen/html/index.html
Found the missing files, here: https://www.qtcentre.org/threads/48387- ... iled-QxOrm

-- QxOrm.pri (relevant parts)
Code: Select all
defined: _QX_ENABLE_BOOST_SERIALIZATION, _QX_ENABLE_BOOST, _QX_ENABLE_QT_GUI


-- my relevant environment variables
Code: Select all
BOOST_LIB_WIDE_SERIALIZATION_RELEASE=boost_wserialization
BOOST_LIB_SERIALIZATION_DEBUG=boost_serialization
BOOST_LIB_SERIALIZATION_RELEASE=boost_serialization
BOOST_INCLUDE=/usr/local/include
BOOST_LIB=/usr/local/lib
BOOST_LIB_WIDE_SERIALIZATION_DEBUG=boost_wserialization
BOOST_ROOT=/usr/local/boost_1_74_0
PATH=/usr/local/boost_1_74_0:/usr/local/QxOrm/lib:/opt/Qt/5.12.5/gcc_64/bin/:/sbin:/bin:/usr/sbin:/usr/bin


-- drug-sample.pro
Code: Select all
TEMPLATE = app
TARGET = drug-sample
QT += widgets
CONFIG += precompile_header
PRECOMPILED_HEADER = precompiled.h
INCLUDEPATH += /usr/local/QxOrm/include
LIBS += -L/usr/local/QxOrm/lib -lQxOrm
LIBS += -L/usr/local/lib -lboost_serialization -lboost_wserialization
DEFINES += QT_DEPRECATED_WARNINGS
HEADERS += drug.h
SOURCES += drug.cpp main.cpp


=== output from make
Code: Select all
g++ -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/QxOrm/include -I/opt/Qt/5.12.5/gcc_64/include -I/opt/Qt/5.12.5/gcc_64/include/QtWidgets -I/opt/Qt/5.12.5/gcc_64/include/QtGui -I/opt/Qt/5.12.5/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/opt/Qt/5.12.5/gcc_64/mkspecs/linux-g++ -x c++-header -c precompiled.h -o drug-sample.gch/c++
In file included from /usr/local/QxOrm/include/QxDao/QxDaoThrowable.h:47:0,
                 from /usr/local/QxOrm/include/QxOrm.h:113,
                 from precompiled.h:4:
/usr/local/QxOrm/include/QxDao/QxSqlError.h: In constructor ‘qx::dao::sql_error::sql_error(const QSqlError&)’:
/usr/local/QxOrm/include/QxDao/QxSqlError.h:70:187: warning: ‘void QSqlError::setType(QSqlError::ErrorType)’ is deprecated (declared at /opt/Qt/5.12.5/gcc_64/include/QtSql/qsqlerror.h:92) [-Wdeprecated-declarations]
    sql_error(const QSqlError & err) : std::exception(), m_error(err) { if (! m_error.text().isEmpty() && (m_error.type() == QSqlError::NoError)) { m_error.setType(QSqlError::UnknownError); }; m_errorMessage = m_error.text().toLocal8Bit(); }
                                                                                                                                                                                           ^
g++ -c -include drug-sample -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/QxOrm/include -I/opt/Qt/5.12.5/gcc_64/include -I/opt/Qt/5.12.5/gcc_64/include/QtWidgets -I/opt/Qt/5.12.5/gcc_64/include/QtGui -I/opt/Qt/5.12.5/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/opt/Qt/5.12.5/gcc_64/mkspecs/linux-g++ -o drug.o drug.cpp
g++ -c -include drug-sample -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/QxOrm/include -I/opt/Qt/5.12.5/gcc_64/include -I/opt/Qt/5.12.5/gcc_64/include/QtWidgets -I/opt/Qt/5.12.5/gcc_64/include/QtGui -I/opt/Qt/5.12.5/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/opt/Qt/5.12.5/gcc_64/mkspecs/linux-g++ -o main.o main.cpp
main.cpp: In function ‘int main(int, char**)’:
main.cpp:56:23: error: ‘qx::serialization::xml’ has not been declared
    qx::serialization::xml::to_file(lst_drug, "./export_drugs.xml");
                       ^
main.cpp:60:23: error: ‘qx::serialization::xml’ has not been declared
    qx::serialization::xml::from_file(lst_drug_tmp, "./export_drugs.xml");
                       ^
main.cpp:48:9: warning: unused variable ‘lDrugCount’ [-Wunused-variable]
    long lDrugCount = qx::dao::count<drug>();
         ^
main.cpp:75:11: warning: unused variable ‘pDummy’ [-Wunused-variable]
    drug * pDummy = new drug();
           ^
make: *** [main.o] Error 1
curtis.bradley
 
Posts: 4
Joined: Wed Nov 25, 2020 5:16 pm

Re: can't build "drug" sample on Linux

Postby qxorm » Thu Nov 26, 2020 10:22 am

Hello and welcome to this forum,

Have you tried to build all samples projects from ./test/ directory of QxOrm package ?
I think this is the first thing to do to check if your dev environment is ok to work with QxOrm library.

Another thing : I see you are using boost.
boost is optional, and if you don't need it, I would recommend to not include it, at least to start : it is easier to build QxOrm without boost.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: can't build "drug" sample on Linux

Postby curtis.bradley » Mon Nov 30, 2020 7:12 pm

I'm able to build all except:

1. qxBlogMongoDB
error: Project ERROR: unable to use QxOrm MongoDB database driver : please define _QX_ENABLE_MONGODB compilation option in QxOrm.pri configuration file

This require installing Mongo...which I'll not be using and would rather not spend time with if it isn't essential.


2. qxClientServer
I'm having cmake issues because I'm not familiar with cmake (I'm a MSVC guy). This looks like it should be fine once I figure out cmake. Again, I'd rather not spend time with this if it isn't essential

if you think it's necessary that I get these to build in order to verify my installation or ???, I will.

Thanks!
curtis.bradley
 
Posts: 4
Joined: Wed Nov 25, 2020 5:16 pm

Re: can't build "drug" sample on Linux

Postby curtis.bradley » Tue Dec 01, 2020 2:15 am

Ok, I've removed BOOST serialization, rebuilt QxOrm and tried to re-build the drug example (with references to BOOST serialization removed). I'm back to the exact error as before.

I got a little smarter about cmake and successfully rebuilt the entire QxOrm/test tree, except for qxBlogMongoDB (I don't have Mongo Installed)

Thanks for you're help! I'm evaluating this for use on my Linux (PostgreSQL) project.
curtis.bradley
 
Posts: 4
Joined: Wed Nov 25, 2020 5:16 pm

Re: can't build "drug" sample on Linux

Postby qxorm » Tue Dec 01, 2020 10:03 am

...qxBlogMongoDB...qxClientServer...

About MongoDB and client-server, this is extra-features.
So if you don't need it, do not enable compilation option for that.

Thanks for you're help! I'm evaluating this for use on my Linux (PostgreSQL) project.

I don't understand : is it ok now ?
About the drug sample : this is a very old example. I didn't update the web page but the qxBlog example project from ./test/ package is much more complete and up-to-date.

I would recommend to create your first QxOrm classes with QxEntityEditor application : https://www.qxorm.com/qxorm_en/manual_qxee.html
You can use it free of charge with a limitation of 5 entities per project.
You cannot be wrong with QxEntityEditor : the C++ generated code will be OK for QxOrm library.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: can't build "drug" sample on Linux

Postby curtis.bradley » Tue Dec 01, 2020 4:06 pm

Ok, I'll try tp get the qxBlog sample working. Thanks
curtis.bradley
 
Posts: 4
Joined: Wed Nov 25, 2020 5:16 pm


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 6 guests

cron