Compiler errors in QxEE Service generated code.

Forum for posting problems using QxOrm library

Compiler errors in QxEE Service generated code.

Postby SteveW » Tue Jan 26, 2016 2:28 pm

Hi

Not sure if this is a QxEE help question or QxORM...

First some info, as I've posted before with various questions... I am using Serialization enalbed, have build the required boost DLLs. I have set the QxORM projects to NOT static build, and I can build and run the qxClientServer tutorial code fine.

So after importing our database schema from an ODBC datasource, I have generated the Exported the C++ Entities Project. That compiles fine to a .DLL
Next I exported the Services Project. The export went ok in QxEE, and it has generated the project, but when compiling I hit a group of compiler errors relate to Input/Output parameters, such as:-

Function:-

Code: Select all
contact_address_ptr contact_address_services::fetchById(long id, const QStringList & columns /* = QStringList() */, const QStringList & relations /* = QStringList() */)
{
...
   this->setInputParameter(input);
...
   contact_address_output_ptr output = this->getOutputParameter();
...


Comiler errors are:-
Code: Select all
C:\__Sum-It\Dorothy\code\crm\service\source\src\contact_address.services.gen.cpp:364: error: C2664: 'void qx::service::IxService::setInputParameter(qx::service::IxParameter_ptr)' : cannot convert argument 1 from 'services::contact_address_input_ptr' to 'qx::service::IxParameter_ptr'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called


...and...

Code: Select all
C:\__Sum-It\Dorothy\code\crm\service\source\src\contact_address.services.gen.cpp:367: error: C2440: 'initializing' : cannot convert from 'std::shared_ptr<OUTPUT>' to 'boost::shared_ptr<services::contact_address_output>'
with
[
    OUTPUT=services::contact_address_output
]
No constructor could take the source type, or constructor overload resolution was ambiguous


There are hundres of similar errors. And there is another group of errors related to the "setService" call. Such as...

Code...
Code: Select all
qx_bool contact_address_services_async::fetchById(contact_address_ptr p, const QStringList & columns /* = QStringList() */, const QStringList & relations /* = QStringList() */)
{
...
   m_pAsyncHelper = qx::service::QxClientAsync_ptr(new qx::service::QxClientAsync());
...
   m_pAsyncHelper->setService(pAsyncService, "fetchById");
...
}


Compiler errors are:
Code: Select all
C:\__Sum-It\Dorothy\code\crm\service\source\src\contact_address.services_async.gen.cpp:48: error: C2664: 'void qx::service::QxClientAsync::setService(qx::service::IxService_ptr,const QString &)' : cannot convert argument 1 from 'services::contact_address_services_ptr' to 'qx::service::IxService_ptr'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called



And finally there is a 3rd group of compiling errors related to "setService" which are:-

Code: Select all
void dataset_operator_link_services_async::doAsyncFinished()
{
...
   dataset_operator_link_services_ptr pAsyncService = boost::static_pointer_cast<dataset_operator_link_services>(m_pAsyncHelper->getService());
...
}


Errors:

Code: Select all
C:\__Sum-It\Dorothy\code\crm\service\source\src\dataset_operator_link.services_async.gen.cpp:451: error: C2784: 'boost::intrusive_ptr<T> boost::static_pointer_cast(const boost::intrusive_ptr<U> &)' : could not deduce template argument for 'const boost::intrusive_ptr<U> &' from 'qx::service::IxService_ptr'


...and ...

Code: Select all
C:\__Sum-It\Dorothy\code\crm\service\source\src\dataset_operator_link.services_async.gen.cpp:451: error: C2784: 'boost::shared_ptr<X> boost::static_pointer_cast(const boost::shared_ptr<U> &)' : could not deduce template argument for 'const boost::shared_ptr<U> &' from 'qx::service::IxService_ptr'


As these all appear to be pointer/casting issues the C++ section of my QxORM.PRI file has all options defined, so reads

Code: Select all
# By default, QxOrm library supports smart pointers and containers of Qt library and boost library : QHash, QList, QSharedPointer, boost::shared_ptr, boost::unordered_map, etc...
# QxOrm library supports also by default containers of previous C++03 standard library : std::vector, std::list, std::map, std::set
# If you want to enable smart pointers and containers of the new C++11 standard library, you can define the compilation options _QX_CPP_11_SMART_PTR, _QX_CPP_11_CONTAINER and _QX_CPP_11_TUPLE :
# - With _QX_CPP_11_SMART_PTR : std::unique_ptr, std::shared_ptr, std::weak_ptr
# - With _QX_CPP_11_CONTAINER : std::unordered_map, std::unordered_set, std::unordered_multimap, std::unordered_multiset
# - With _QX_CPP_11_TUPLE : std::tuple

CONFIG += c++11
DEFINES += _QX_CPP_11_SMART_PTR
DEFINES += _QX_CPP_11_CONTAINER
DEFINES += _QX_CPP_11_TUPLE


Any help appreciated?

Thanks
Steve.
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Compiler errors in QxEE Service generated code.

Postby SteveW » Tue Jan 26, 2016 2:35 pm

P.s This above errors are when building the Client Service.

When building the server service, I get similar errors but for the <INPUT> pointers...

Code: Select all
void contact_address_services::fetchById_()
{
   contact_address_input_ptr input = getInputParameter();
...


Error:-

Code: Select all
C:\__Sum-It\Dorothy\code\crm\service\source\src\contact_address.services.gen.cpp:106: error: C2440: 'initializing' : cannot convert from 'std::shared_ptr<INPUT>' to 'boost::shared_ptr<services::contact_address_input>'
with
[
    INPUT=services::contact_address_input
]
No constructor could take the source type, or constructor overload resolution was ambiguous
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Compiler errors in QxEE Service generated code.

Postby qxorm » Wed Jan 27, 2016 3:29 pm

Hello,

Not sure if this is a QxEE help question or QxORM...

This is a QxEntityEditor issue.
Quick explanation : QxEntityEditor 1.1.8 was released with QxOrm 1.3.2.
Then, we released later QxOrm 1.4.1 with deep changes compared to QxOrm 1.3.2, but no version of QxEntityEditor was released (we are still in version QxEntityEditor 1.1.8).
In QxOrm 1.4.1, we have started to reduce boost dependency when it is possible : if you enable C++11 smart pointer, then QxOrm uses internally std::shared_ptr (and not boost::shared_ptr).
This modification is private to QxOrm library, except for QxService module where there is a public API using std::shared_ptr or boost::shared_ptr.
QxOrm 1.4.1 provides a typedef named qx_shared_ptr which manages std::shared_ptr or boost::shared_ptr depending on your selected options.

Anyway, here are the link with the fix :
- QxOrm_1.4.2_BETA_35 : http://www.qxorm.com/version/QxOrm_1.4.2_BETA_35.zip
- QxEntityEditor_1.1.9_BETA_21_win_32b : http://www.qxorm.com/version/QxEntityEd ... in_32b.zip

Could you try these versions please ?
Do you have any error with these versions ?
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Postby SteveW » Thu Jan 28, 2016 6:50 pm

Hello

Now, I cannot build the QxORM library. (This is the MSVC2013 build).

It's probably easiest if I attach a screenshot of the Qt Creator showing the start of the compiling errors.

The previous BETA version I was supplier to cure the Boost incompatibility built fine in Qt Creator configured for both MSVC 2013 and MinGW builds.

Steve.
Attachments
qxorm_compile_error.png
qxorm_compile_error.png (158.2 KiB) Viewed 9628 times
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Compiler errors in QxEE Service generated code.

Postby qxorm » Thu Jan 28, 2016 7:14 pm

Yes, sorry for that, there is a compilation error with some compilers with the std::static_pointer_cast redefinition.
Here is the fix : http://www.qxorm.com/version/QxOrm_1.4.2_BETA_36.zip

Please let me know if you have other problems with this BETA version.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Compiler errors in QxEE Service generated code.

Postby SteveW » Wed Feb 03, 2016 12:02 pm

Hi

Apologies for delayed reply, it has taken this long to get everything configured & built.

Yes I can now fully build the Client/Server Service projects, the Server project and the Client ModelView DLLs ok.

A couple of issues -

1 - Build times.

Our schema has around 40 tables with avg contents 6-8 fields, and various links. I would not consider this a particularly large schema, but yet the time to build each project/configuration is around 1hour.

So with Client/Server service projects, Server and Client project multiplied by the number of configs required (Debug, Release, MinGw, Msvc), that equates to around 16 hours build time just for the QxORM based components of the system.

2 - Linker crash

When building the Client Service DLL and the Client ModelView DLL in MinGW Debug Mode (MinGW Release & MSVC2013 Debug/Release are ok), the Linker (LD.exe) crashes with error code 5. I watched this build a few times, keeping my eyes on the LD.exe's memory consumption, and it exceeds 2gig of RAM before it crashes. As MinGS is a 32 bit program and if it is using signed integers internally, this might explain the crash. I have not yet tried MinGW64 (havent even checked to see if it even exists yet!). The object file generation of these projects prior to linking is aroung 800Meg.

Is there anyway to reducude the size of the MinGW debug builds to see if I can avoid the linker crashes?

Thanks
Steve
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Compiler errors in QxEE Service generated code.

Postby qxorm » Wed Feb 03, 2016 3:49 pm

Hello,

Our schema has around 40 tables

How do you generate 40 C++ classes without a QxEntityEditor license key ?
Did you write them yourself ?

the time to build each project/configuration is around 1hour

This is definitively too long !
What kind of processor do you have ?
Did you disable precompiled headers ?
Are you using all cores provided by your processor when you compile ?

Here is a topic in the FAQ : http://www.qxorm.com/qxorm_en/faq.html#faq_70
For MSVC, you should create the environment variable : SET CL=/MP
For MinGW, to use 8 processors : SET MAKE_COMMAND=make -j8

The best solution to reduce compilation times (and binaries size) is to not enable boost::serialization (disabled by default).
I know that you want to use QxService module : so you should test if the QDataStream and QJson serialization engines are sufficient in your case.

On my environments, MSVC (2012 in my case) is much faster to compile than MinGW : is it true in your case too ?

Another question : is your schema stable ?
Because if your schema doesn't change too much, you don't have to rebuild all generated classes each time.

MinGW Linker (LD.exe) crashes with error code 5

I'm not an expert in MinGW, but I think there are compilation flags to optimize output size.
On Linux with GCC (so maybe with MinGW too), you can define these options to reduce size :
Code: Select all
QMAKE_CXXFLAGS_RELEASE += -ffunction-sections -fdata-sections -Os -pipe
QMAKE_CFLAGS_RELEASE += -ffunction-sections -fdata-sections -Os -pipe
QMAKE_LFLAGS_RELEASE += -Wl,--gc-sections -s
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Compiler errors in QxEE Service generated code.

Postby SteveW » Wed Feb 03, 2016 6:00 pm

Hi

"How do you generate 40 C++ classes without a QxEntityEditor license key ?"


We have a licence for QxEE.

Thanks for the other info... I'll look into those options once I have a running QxORM Client/Server where the client app is a QML based application and uses QxModelService derived classes (seems I jumped in at the deep end here using just about everything QxORM has to offer in my very first project!)

Steve.
SteveW
 
Posts: 53
Joined: Tue Jan 19, 2016 4:12 pm

Re: Compiler errors in QxEE Service generated code.

Postby qxorm » Wed Feb 03, 2016 6:53 pm

seems I jumped in at the deep end here using just about everything QxORM has to offer in my very first project!

Yes : dao layer >> services >> model/view connected to services.
Your project will use a large part of QxOrm features.

Please create new topics on this forum if you have any other issues/questions.
The compilation error of this topic is fixed now.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 14 guests