lbellonda / qxmledit

QXmlEdit XML editor. Downloads: https://sourceforge.net/projects/qxmledit/files
http://qxmledit.org
Other
164 stars 48 forks source link

Compilation error in openSUSE #36

Closed LazyKent closed 8 years ago

LazyKent commented 8 years ago

I get compilation error in openSUSE Factory.

 data_access/sqllitegenericdata.cpp:313:28: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
  #define QRY_READ_TAGS_TYPE "select tr.objectId, t.tag from "TABLE_TAGS_RELATIONS" tr join "TABLE_GENERIC_OBJECTS" o on o.type=:type and o.id=tr.objectId join " TABLE_TAGS " t on t.id=tr.tagId "
                             ^
 data_access/sqllitegenericdata.cpp:313:81: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
  #define QRY_READ_TAGS_TYPE "select tr.objectId, t.tag from "TABLE_TAGS_RELATIONS" tr join "TABLE_GENERIC_OBJECTS" o on o.type=:type and o.id=tr.objectId join " TABLE_TAGS " t on t.id=tr.tagId "
                                                                                  ^
 data_access/sqllitegenericdata.cpp:314:35: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
  #define QRY_READ_TAGS_TYPE_AND_ID "select tr.objectId, t.tag from "TABLE_TAGS_RELATIONS" tr join "TABLE_GENERIC_OBJECTS" o on o.type=:type and o.id=tr.objectId and o.id=:id join " TABLE_TAGS " t on t.id=tr.tagId "
                                    ^
 data_access/sqllitegenericdata.cpp:314:88: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
  #define QRY_READ_TAGS_TYPE_AND_ID "select tr.objectId, t.tag from "TABLE_TAGS_RELATIONS" tr join "TABLE_GENERIC_OBJECTS" o on o.type=:type and o.id=tr.objectId and o.id=:id join " TABLE_TAGS " t on t.id=tr.tagId "
                                                                                         ^
lbellonda commented 8 years ago

Could you specify the version of the compiler and the OS? Can you paste the command line? Are the logs public?

LazyKent commented 8 years ago

openSUSE Factory or Tumbleweed. It was OK before system upgrade to Qt 5.6.0. May it be related somehow?

Here is the build log: https://build.opensuse.org/build/home:Lazy_Kent:devel/openSUSE_Tumbleweed/x86_64/qxmledit/_log

lbellonda commented 8 years ago

The cause of the problem is the activation of the C++11 syntax via the "-std=gnu++0x". Can you replace the two lines that contain the error with the following ones (note the different spaces) and restart the build to test if there are other incompatibilities? the lines are: 313, 314 of the file: src/sessions/data_access/sqllitegenericdata.cpp

define QRY_READ_TAGS_TYPE "select tr.objectId, t.tag from " TABLE_TAGS_RELATIONS " tr join " TABLE_GENERIC_OBJECTS " o on o.type=:type and o.id=tr.objectId join " TABLE_TAGS " t on t.id=tr.tagId "

define QRY_READ_TAGS_TYPE_AND_ID "select tr.objectId, t.tag from " TABLE_TAGS_RELATIONS " tr join " TABLE_GENERIC_OBJECTS " o on o.type=:type and o.id=tr.objectId and o.id=:id join " TABLE_TAGS " t on t.id=tr.tagId "

I have not yet a Qt 5.6 test environment.

lbellonda commented 8 years ago

The commit 8682e0a5d51a9c79b326fe3e1ce4d84c10653b1c on trunk compiles with gcc and c++11 enabled. You can test the trunk.

LazyKent commented 8 years ago

Compiled succeed with changes in src/sessions/data_access/sqllitegenericdata.cpp. Thanks.

Tested the trunk and got errors 'isnan' was not declared in this scope The log: https://gist.github.com/LazyKent/cb9a56eef97ecbcd0ec8b2de0b24b376#file-qxmledit-build-log

lbellonda commented 8 years ago

I see, I need to test with the new gcc libraries to solve for the upcoming version. What version of gcc is installed?

LazyKent commented 8 years ago

Installed gcc5-c++-5.3.1+r234891 and gcc-c++-5-2.50. I don't understand, which one is in use.

lbellonda commented 8 years ago

defining: export QXMLEDIT_NO_QWTPLOT=y before invoking qmake

you should be able to disable the component that gives problems until the problem is solved.

lbellonda commented 8 years ago

Hello, the current version at master contains the fixes for c++11 compatibility (0.9.4).

lbellonda commented 8 years ago

The 0.9.4 release include the fix to this issue. Waiting for confirmation to close the issue.

LazyKent commented 8 years ago

Confirmed. Fixed. Compiled in openSUSE without errors. Thanks! Closed.