I want to compile following file:
https://gist.github.com/bodokaiser/5382281
which does not succeed because I get following error:
CXX(target) Release/obj.target/parser/src/parser/parser.o
In file included from ../src/parser/parser.cc:2:
../src/parser/calc_head_size.cc:67:16: error: expected expression
if (mask || isMasking(masking)) {
^
1 error generated.
make: *** [Release/obj.target/parser/src/parser/parser.o] Error 1
This does not make sense to me. Can it be that there is something else wrong?
Bodo
You seem to have a strange character in your source code that looks like a space but isn't. In this line:
if (mask || isMasking(masking)) {
// ^ here
try to delete the "space" and add a real space.
Related
I am using the # operator, and while with one casting it works fine, having two in the same rule it does not compile. The sentence is the following
configuration#RuleSetConfiguration.configurationRule[0].configurationRuleAction#FilteringAction.filteringActionType==$mspl1.configuration#RuleSetConfiguration.configurationRule[0].configurationRuleAction#FilteringAction
And it returns the following compilation error:
[ERR 102] Line 62:87 mismatched input '#' in rule "verify_same_filtering_l4_behaviour" [Message [id=1, kieBase=rules, level=ERROR, path=/home/santiago/eclipse-workspace/DroolKieServer/target/classes/com/sample/rules/Rule.drl, line=62, column=0 text=[ERR 102] Line 62:87 mismatched input '#' in rule "verify_same_filtering_l4_behaviour"], Message [id=2, kieBase=rules, level=ERROR, path=/home/santiago/eclipse-workspace/DroolKieServer/target/classes/com/sample/rules/Rule.drl, line=0, column=0 text=Parser returned a null Package]]
I have tried to use brackets but the result is the same. Is there a limitation on the castings that can be done over a rule?
Greetings
I tried to do two castings in the rule. The expected result is to compile fine due to the use of the # operator is correct, but it returns the compilation error
`
[Message [id=1, kieBase=rules, level=ERROR, path=/home/santiago/eclipse-workspace/DroolKieServer/target/classes/com/sample/rules/Rule.drl, line=62, column=0
text=[ERR 102] Line 62:87 mismatched input '#' in rule "verify_same_filtering_l4_behaviour"], Message [id=2, kieBase=rules, level=ERROR, path=/home/santiago/eclipse-workspace/DroolKieServer/target/classes/com/sample/rules/Rule.drl, line=0, column=0
text=Parser returned a null Package]]
`
The problem was about using the # operator after a list. Instead of that, the standard Java casting have being used and it works fine:
((FilteringAction)((RuleSetConfiguration)configuration).configurationRule[0].configurationRuleAction)
I'm trying to write C++ project with conan. I need to use qt/6.2.2 as dependency.
After I run
conan create . user/test
It comes out a long error message. The last few lines are:
/home/run/.conan/data/qt/6.2.2/_/_/package/e1b261f6f4c131503719b972012039d1853778f9/include/QtCore/qarraydatapointer.h:374:27: note: deduced conflicting types for parameter ‘const T’ (‘int’ and ‘qsizetype’ {aka ‘long long int’})
374 | ? n + qMax(0, (header->alloc - from.size - n) / 2)
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/Wuziqi.dir/build.make:63: CMakeFiles/Wuziqi.dir/Wuziqi.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/Wuziqi.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Wuziqi/1.0.0#user/test:
Wuziqi/1.0.0#user/test: ERROR: Package '702f20c11c28f19fd5e1d929272b0f47e81fec21' build failed
Wuziqi/1.0.0#user/test: WARN: Build folder /home/run/.conan/data/Wuziqi/1.0.0/user/test/build/702f20c11c28f19fd5e1d929272b0f47e81fec21
ERROR: Wuziqi/1.0.0#user/test: Error in build() method, line 26
cmake.build()
ConanException: Error 2 while executing cmake --build '/home/run/.conan/data/Wuziqi/1.0.0/user/test/build/702f20c11c28f19fd5e1d929272b0f47e81fec21' '--' '-j12'
There are multiple errors in the middle, like:
error: ‘is_integral_v’ is not a member of ‘std’; did you mean ‘is_integral’?
170 | template <typename Int> std::enable_if_t<std::is_integral_v<Int>, iterator>
error: ‘compare_eq_result_container’ in namespace ‘QTypeTraits’ does not name a template type
306 | QTypeTraits::compare_eq_result_container<QList, U> operator==(const QList &other) const
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: ‘is_same_v’ is not a member of ‘std’; did you mean ‘is_same’?
285 | if constexpr (std::is_same_v<std::decay_t<InputIterator>, iterator> ||
| ^~~~~~~~~
| is_same
Does it seem that there is no xxx_v in std?
How could I fix it?
Thanks, guys, I solved this problem.
It is because of the version of dependencies, just like #康桓瑋 said, I need to use C++17.
However, C++17 will lead to other conflicts. So I set
requires = "qt/5.15.2"
in conanfile.py instead of the latest version.
I am trying to execute c++ function using boost library in R. I've also installed boost header file package (BH). When I try to execute the code it give me the following error:
src <- '
#include <Rcpp.h>
#include <boost/math/special_functions/binomial.hpp>
for (unsigned long i = 0; i < 5; ++i) {
boost::math::binomial_coefficient<double>(25, i);
}'
sillyExp <- cfunction(signature(), src, convention = ".C")
Where I am going wrong?
Edit: Following is the error
Error in compileCode(f, code, language, verbose) :
Compilation ERROR, function(s)/method(s) not created! file68b0697546bd.cpp:11:54: fatal error: boost/math/special_functions/binomial.hpp: No such file or directory
#include <boost/math/special_functions/binomial.hpp>
^
compilation terminated.
make: *** [C:/PROGRA~1/R/R-34~1.3/etc/x64/Makeconf:215: file68b0697546bd.o] Error 1
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-34~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-34~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file68b0697546bd.dll" WIN=64 TCLBIN=64 OBJECTS="file68b0697546bd.o"' had status 2
If you really want to execute some C++ code, then you can use Rcpp::evalCpp:
Rcpp::evalCpp("boost::math::binomial_coefficient<double>(25, 3)",
depends="BH",
include="#include <boost/math/special_functions/binomial.hpp>")
#> [1] 2300
I want to print lines before my /ERROR/ match. The lines to be printed should be all containing INFO untill the previous ERROR is found.
So If I had a file
ERROR this is an error
INFO error found on line 2
INFO error is due to something
ERROR this is another error
I want the /ERROR/ from ERROR this is another error to print
INFO error found on line 2
INFO error is due to something
ERROR this is another error
Anyone know?
Part of my current script:
/CRITICAL/ {
print "\x1b[93;1m"
}
/ERROR/ {
print "\x1b[37m"
}
/ERROR|EMERGENCY|CRITICAL/ {
if (NR == n+1) print "";
n = NR;
print x;print
print "\x1b[0m"
};{x=$0}'
Try this one liner:
awk 'x;/ERROR/{x=1}' file
Out:
INFO error found on line 2
INFO error is due to something
ERROR this is another error
Long version:
x;/ERROR/{
x1=1;
print
}
If "ERROR" is found x=1, if x is true we've already gone through that line, then we print until we pass that line again.
Or maybe this, I don't have very clear what output you need.
awk '/ERROR/{x=1;next}/ERROR/{x=1}x'
Out
INFO error found on line 2
INFO error is due to something
I'm using Google Test to assert that certain error codes occur, and these are always hex constants. So this output is less than ideal:
mytest.cpp line 130 and its output:
EXPECT_EQ(0xBFFF0011, error) << "Expected second close to return an error";
[ RUN ] MyTest.CloseSessionFail
mytest.cpp(130): error: Value of: error
Actual: -1074130544
Expected: 0xBFFF0011
Which is: 3221159953
Expected second close to return an error
For EXPECT_EQ(expected, actual), is there some way to cause it to format hexadecimal output?
Ideally I'd like to see this:
Actual: 0xBFFA1190
Expected: 0xBFFF0011
Probably this message will help you:
https://github.com/google/googletest/issues/222