Opened 8 years ago
Closed 7 years ago
#10688 closed Bugs (invalid)
Fusion vector error when using Qt
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | To Be Determined | Component: | fusion |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | fusion, vector.hpp, qt | Cc: |
Description
My code compiles fine until I added fusion to the project. I later found out that it is conflicting with the moc file used by Qt. I've attached an example to show this problem.
/usr/include/boost/fusion/container/vector/vector.hpp:25: Error: '#' is not followed by a macro parameter AUTOGEN: error: process for /home/work/daikin/dahmi/build/src/app/main.moc failed: /usr/include/boost/fusion/container/vector/vector.hpp:25: Error: '#' is not followed by a macro parameter
moc failed... src/app/CMakeFiles/dahmi_automoc.dir/build.make:49: recipe for target 'src/app/CMakeFiles/dahmi_automoc' failed make[2]: * [src/app/CMakeFiles/dahmi_automoc] Error 1 CMakeFiles/Makefile2:367: recipe for target 'src/app/CMakeFiles/dahmi_automoc.dir/all' failed make[1]: * [src/app/CMakeFiles/dahmi_automoc.dir/all] Error 2 make[1]: * Waiting for unfinished jobs.... /usr/include/boost/fusion/container/vector/vector.hpp:25: Error: '#' is not followed by a macro parameter AUTOGEN: error: process for /home/work/daikin/dahmi/build/src/lib/qml/moc_qml.cpp failed: /usr/include/boost/fusion/container/vector/vector.hpp:25: Error: '#' is not followed by a macro parameter
Attachments (2)
Change History (8)
by , 8 years ago
Attachment: | fusion_error.tar.gz added |
---|
by , 8 years ago
Attachment: | fusion_qt_error.tar.gz added |
---|
This is a stripped down version of the previous attachment that demonstrates the bug
comment:1 by , 8 years ago
Just including a moc file, generated by CMake, to a source file that includes a fusion vector.hpp is enough to get this error. On the provided example, removing vector.hpp or the include for the moc file will allow the program to compile.
comment:3 by , 8 years ago
This is not a fusion bug. Qt's moc has an incomplete c++ parser. Please report such bugs to Qt so they can "fix" their parser.
Workaround:
Put "#ifndef Q_MOC_RUN" around the fusion includes. moc will then skip the includes.
diff --git INDEX:/src/main.cpp WORKDIR:/src/main.cpp index 3a8f0a8..7fe69c1 100755 --- INDEX:/src/main.cpp +++ WORKDIR:/src/main.cpp @@ -1,5 +1,8 @@ #include <iostream> + +#ifndef Q_MOC_RUN #include <boost/fusion/include/vector.hpp> +#endif int main (int argc, char *argv[]) {
comment:4 by , 8 years ago
I was starting to think that was the case too. I'll file a bug report with Qt then. Thanks for the help.
comment:6 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
demonstrates the fusion error when using with qt