Open fangqiao opened 6 years ago
Same on Arch since GCC 8.1.0 update.
Edit: GCC 8.1.1 update did not fix the issue. I guess we will have to wait.
If clang is not an option, you can still install GCC 7.3.0 from AUR (you can find it under the name gcc-7) and use it explicitly for your compilation. Worked for me.
same problem on arch . any solution !!!!??
In the original issue:
Update:
Using clang compilation passed. It is indeed a gcc bug. I leave the issue here for reference.
Using clang (6.0.0) on Arch also works. Have to wait till gcc 8.1 gets fixed.
for someone if need to solve this issue :: https://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake
This also happens on the newest gcc 8.2.
Is amalgamation required condition to observe this issue? IOW, is anyone who does not use amalgamation seeing this?
For anyone who is using gcc 8 and met this issue, and is willing to use c++1y features, you may change the definition of the route function to use auto return type deduction, and remove the trailing return type.
template <uint64_t Tag>
auto& route(std::string&& rule)
{
//...
}
Then it should compile with gcc.
Did you get it to build with the above workaround? I am getting an error after removing the trailing return type as suggested above:
/usr/bin/c++ --version
c++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0
/usr/bin/c++ -Icrow/include -std=c++11 -o foo.o -c foo.cpp
In file included from crow/include/crow.h:23,
from crow/crowmfix.h:1,
from crowmfix.cpp:13:
crow/include/crow/app.h:62:38: error: ‘route’ function uses ‘auto’ type specifier without trailing return type
auto& route(std::string&& rule)
@mwm126 You should use -std=c++1y
, but not -std=c++11
Oh thank you, yeah that worked.
I had the same problem a while ago and I froze the gcc version I was using. However, I just tried compiling with gcc 9.1.0 and it worked
@ricargoes
Good it worked. Though it does not change the fact that crow is pretty much dead at this point. The last commit was in 2017.
GCC 9 fixed the error on arch as well.
Recently I am working on a project using crow to expose some REST api.
It used to compile well on archlinux and centos with gcc 7.3.
Now I tested it on fedora 28. With gcc 8 coming with Fedora 28 and then gcc 7.3 I manually installed, such compilation error occured:
I understand it is most likely a gcc bug on Fedora 28 environment but I can't wait for a fix from gcc. Is there any idea how to quickly fix this problem from crow code ?
Thanks,
Update:
Using clang compilation passed. It is indeed a gcc bug. I leave the issue here for reference.