Title: [BUG] Build still uses C++11 flags, although C++14 is supposed to be required · Issue #245 · etr/libhttpserver · GitHub
Open Graph Title: [BUG] Build still uses C++11 flags, although C++14 is supposed to be required · Issue #245 · etr/libhttpserver
X Title: [BUG] Build still uses C++11 flags, although C++14 is supposed to be required · Issue #245 · etr/libhttpserver
Description: Prerequisites Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo:etr/libhttpserver&type=Issues Description Changeset 1e61eae added -std=c++11 to CXX...
Open Graph Description: Prerequisites Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo:etr/libhttpserver&type=Issues Description C...
X Description: Prerequisites Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo:etr/libhttpserver&type=Issues D...
Opengraph URL: https://github.com/etr/libhttpserver/issues/245
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] Build still uses C++11 flags, although C++14 is supposed to be required","articleBody":"### Prerequisites\r\n\r\n* [x] Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=\u0026q=repo%3Aetr%2Flibhttpserver\u0026type=Issues\r\n\r\n### Description\r\n\r\nChangeset 1e61eae1f1874a26c447d0fa26ef663073ab2312 added `-std=c++11` to `CXXFLAGS` unconditionally, which is still in *configure.ac*, leading to this output:\r\n\r\n```\r\n% make :(\r\nmake all-recursive\r\nmake[1]: Verzeichnis „/mnt/data/adahl/src/libhttpserver/build“ wird betreten\r\nMaking all in src\r\nmake[2]: Verzeichnis „/mnt/data/adahl/src/libhttpserver/build/src“ wird betreten\r\n/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I../ -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -fPIC -Wall -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT libhttpserver_la-string_utilities.lo -MD -MP -MF .deps/libhttpserver_la-string_utilities.Tpo -c -o libhttpserver_la-string_utilities.lo `test -f 'string_utilities.cpp' || echo '../../src/'`string_utilities.cpp\r\nlibtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I../ -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -fPIC -Wall -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT libhttpserver_la-string_utilities.lo -MD -MP -MF .deps/libhttpserver_la-string_utilities.Tpo -c ../../src/string_utilities.cpp -fPIC -DPIC -o .libs/libhttpserver_la-string_utilities.o\r\nlibtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I../ -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -fPIC -Wall -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT libhttpserver_la-string_utilities.lo -MD -MP -MF .deps/libhttpserver_la-string_utilities.Tpo -c ../../src/string_utilities.cpp -o libhttpserver_la-string_utilities.o \u003e/dev/null 2\u003e\u00261\r\nmv -f .deps/libhttpserver_la-string_utilities.Tpo .deps/libhttpserver_la-string_utilities.Plo\r\n/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I../ -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -fPIC -Wall -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT libhttpserver_la-webserver.lo -MD -MP -MF .deps/libhttpserver_la-webserver.Tpo -c -o libhttpserver_la-webserver.lo `test -f 'webserver.cpp' || echo '../../src/'`webserver.cpp\r\nlibtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I../ -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -fPIC -Wall -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT libhttpserver_la-webserver.lo -MD -MP -MF .deps/libhttpserver_la-webserver.Tpo -c ../../src/webserver.cpp -fPIC -DPIC -o .libs/libhttpserver_la-webserver.o\r\nlibtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I../ -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -fPIC -Wall -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT libhttpserver_la-webserver.lo -MD -MP -MF .deps/libhttpserver_la-webserver.Tpo -c ../../src/webserver.cpp -o libhttpserver_la-webserver.o \u003e/dev/null 2\u003e\u00261\r\nmv -f .deps/libhttpserver_la-webserver.Tpo .deps/libhttpserver_la-webserver.Plo\r\n…\r\n```\r\n\r\nNotice those lines have `-std=c++14` first and `-std=c++11` later, it builds successfully though.\r\n\r\nThis actually bit me when I added the example from #229 to the *examples* folder and tried to build it, build fails like this then:\r\n\r\n```\r\ng++ -DHAVE_CONFIG_H -I. -I../../examples -I.. -I../../src -I../../src/httpserver/ -DDEBUG -g -Wall -Wextra -Werror -pedantic -std=c++14 -Wno-unused-command-line-argument -O0 -DUSE_FASTOPEN -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT -MT bug_229.o -MD -MP -MF $depbase.Tpo -c -o bug_229.o ../../examples/bug_229.cpp \u0026\u0026\\\r\nmv -f $depbase.Tpo $depbase.Po\r\n../../examples/bug_229.cpp: In member function ‘virtual const std::shared_ptr\u003chttpserver::http_response\u003e file_resource::render_POST(const httpserver::http_request\u0026)’:\r\n../../examples/bug_229.cpp:13:58: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14\r\n std::for_each(headers.begin(), headers.end(), [](auto\u0026 p){\r\n ^~~~\r\n../../examples/bug_229.cpp: In lambda function:\r\n../../examples/bug_229.cpp:14:32: error: request for member ‘first’ in ‘p’, which is of non-class type ‘int’\r\n std::cout \u003c\u003c p.first \u003c\u003c \" -\u003e \" \u003c\u003c p.second \u003c\u003c std::endl;\r\n ^~~~~\r\n../../examples/bug_229.cpp:14:53: error: request for member ‘second’ in ‘p’, which is of non-class type ‘int’\r\n std::cout \u003c\u003c p.first \u003c\u003c \" -\u003e \" \u003c\u003c p.second \u003c\u003c std::endl;\r\n ^~~~~~\r\n../../examples/bug_229.cpp: In member function ‘virtual const std::shared_ptr\u003chttpserver::http_response\u003e file_resource::render_POST(const httpserver::http_request\u0026)’:\r\n../../examples/bug_229.cpp:19:52: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14\r\n std::for_each(args.begin(), args.end(), [](auto\u0026 p) {\r\n ^~~~\r\n../../examples/bug_229.cpp: In lambda function:\r\n../../examples/bug_229.cpp:20:32: error: request for member ‘first’ in ‘p’, which is of non-class type ‘int’\r\n std::cout \u003c\u003c p.first \u003c\u003c \" -\u003e \" \u003c\u003c p.second \u003c\u003c std::endl;\r\n ^~~~~\r\n../../examples/bug_229.cpp:20:53: error: request for member ‘second’ in ‘p’, which is of non-class type ‘int’\r\n std::cout \u003c\u003c p.first \u003c\u003c \" -\u003e \" \u003c\u003c p.second \u003c\u003c std::endl;\r\n ^~~~~~\r\n…\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n1. Create a new file in subfolder *examples*\r\n2. Copy and paste the example code from #229 to that new file\r\n3. Adapt *examples/Makefile.am* to build that new source file\r\n4. Call *./configure* with *--enable-examples*\r\n5. Call *make*\r\n\r\n**Expected behavior:** Build does not fail.\r\n\r\n**Actual behavior:** Build fails.\r\n\r\n**Reproduces how often:** Always.\r\n\r\n### Versions\r\n\r\n* OS version: Debian GNU/Linux 10 (buster)\r\n* libhttpserver version: 0.18.2-23-g8901082 (current master)\r\n* libmicrohttpd version: 0.9.62-1 (Debian package)\r\n\r\nIf you have problems during build:\r\n* Compiler version: g++ (Debian 8.3.0-6) 8.3.0\r\n* autotools version: autoconf (GNU Autoconf) 2.69, automake (GNU automake) 1.16.1\r\n\r\n### Additional Information\r\n\r\nC++14 support is required since #227 was merged.\r\n\r\n[config.log](https://github.com/etr/libhttpserver/files/7528897/config.log)\r\n\r\nI have no experience with autotools and can not provide a fix by myself.","author":{"url":"https://github.com/LeSpocky","@type":"Person","name":"LeSpocky"},"datePublished":"2021-11-12T16:11:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/245/libhttpserver/issues/245"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:252e7ed3-7876-c36f-e47f-1b6c3961039c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E066:288515:1935D2B:21EA692:6A535B47 |
| html-safe-nonce | c675e6e41c50329f8d4be237ddfdc7521c6a168549cba022625b595e5932eda2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDY2OjI4ODUxNToxOTM1RDJCOjIxRUE2OTI6NkE1MzVCNDciLCJ2aXNpdG9yX2lkIjoiMjg3MzQ3MTEzNjE2MTY5Nzk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | aae38553b594225ff7f8cc2d4395837264bc206bd19676dfc245838da1336c3f |
| hovercard-subject-tag | issue:1052127512 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/etr/libhttpserver/245/issue_layout |
| twitter:image | https://opengraph.githubassets.com/91979c84a930d98f8549e7b4bff48ec28dabc602683a6b42b0fdf158b7de8da0/etr/libhttpserver/issues/245 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/91979c84a930d98f8549e7b4bff48ec28dabc602683a6b42b0fdf158b7de8da0/etr/libhttpserver/issues/245 |
| og:image:alt | Prerequisites Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo:etr/libhttpserver&type=Issues Description C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LeSpocky |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/etr/libhttpserver git https://github.com/etr/libhttpserver.git |
| octolytics-dimension-user_id | 1201536 |
| octolytics-dimension-user_login | etr |
| octolytics-dimension-repository_id | 3416891 |
| octolytics-dimension-repository_nwo | etr/libhttpserver |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3416891 |
| octolytics-dimension-repository_network_root_nwo | etr/libhttpserver |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width