Thread: [Cppcms-users] Failure to compile hello world
Brought to you by:
artyom-beilis
From: John S. <joh...@gm...> - 2016-01-10 00:32:59
|
Hi, I'm trying to run the code in: http://cppcms.com/wikipp/en/page/tut_hello_world_code but this is what I've got: ---------------------------------------------------------------------------------------------- hello.cpp:11:34: error: expected ‘)’ before ‘&’ token my_hello_world(worker_thread &worker) : ^ hello.cpp: In function ‘int main(int, char**)’: hello.cpp:30:9: error: ‘manager’ was not declared in this scope manager app(argc,argv); ^ hello.cpp:30:9: note: suggested alternative: In file included from hello.cpp:3:0: /usr/local/include/cppcms/service.h:48:9: note: ‘cppcms::views::manager’ class manager; ^ hello.cpp:30:17: error: expected ‘;’ before ‘app’ manager app(argc,argv); ^ hello.cpp:31:9: error: ‘app’ was not declared in this scope app.set_worker(new application_factory<my_hello_world>()); ^ hello.cpp:31:28: error: expected type-specifier before ‘application_factory’ app.set_worker(new application_factory<my_hello_world>()); ---------------------------------------------------------------------------------------------- This is linux mint(Ubuntu like). echo $LD_LIBRARY_PATH = /usr/local/lib/ ls /usr/local/lib/ = libbooster.a libbooster.so.0 libcppcms.a libcppcms.so.1 python2.7 libbooster.so libbooster.so.0.0.3 libcppcms.so libcppcms.so.1.0.5 python3.4 ls /usr/local/include/cppcms/ = application.h config.h forwarder.h localization.h session_dual.h url_dispatcher.h applications_pool.h copy_filter.h http_content_type.h mem_bind.h session_interface.h url_mapper.h archive_traits.h cppcms_error.h http_context.h mount_point.h session_pool.h util.h base64.h crypto.h http_cookie.h rpc_json.h session_sid.h view.h base_cache_fwd.h cstdint.h http_file.h serialization_classes.h session_storage.h views_pool.h base_content.h defs.h http_request.h serialization.h steal_buf.h xss.h base_view.h encoding.h http_response.h service.h string_key.h cache_interface.h filters.h json.h session_api.h thread_pool.h cache_pool.h form.h locale_fwd.h session_cookies.h urandom.h I spent 4 hours trying to solve this but tried everything that I could imagine without any success |
From: Joerg S. <jo...@br...> - 2016-01-10 00:49:59
|
On Sun, Jan 10, 2016 at 12:32:51AM +0000, John Soares wrote: > I'm trying to run the code in: > http://cppcms.com/wikipp/en/page/tut_hello_world_code Yeah, that looks just wrong. Instead of worker_thread, it should be cppcms::service. Joerg |
From: Marcel H. <ke...@co...> - 2016-01-10 01:18:15
Attachments:
signature.asc
|
I don't know why, but worker_thread is just wrong. You can use the examples in the svn folder itself, the hello_world program there just runs fine (where it uses the right one, cppcms::service, instead of worker_thread) Greetings, On 10.01.2016 01:32, John Soares wrote: > Hi, > > I'm trying to run the code > in: http://cppcms.com/wikipp/en/page/tut_hello_world_code > > but this is what I've got: > ---------------------------------------------------------------------------------------------- > hello.cpp:11:34: error: expected ‘)’ before ‘&’ token > my_hello_world(worker_thread &worker) : > ^ > hello.cpp: In function ‘int main(int, char**)’: > hello.cpp:30:9: error: ‘manager’ was not declared in this scope > manager app(argc,argv); > ^ > hello.cpp:30:9: note: suggested alternative: > In file included from hello.cpp:3:0: > /usr/local/include/cppcms/service.h:48:9: note: ‘cppcms::views::manager’ > class manager; > ^ > hello.cpp:30:17: error: expected ‘;’ before ‘app’ > manager app(argc,argv); > ^ > hello.cpp:31:9: error: ‘app’ was not declared in this scope > app.set_worker(new application_factory<my_hello_world>()); > ^ > hello.cpp:31:28: error: expected type-specifier before > ‘application_factory’ > app.set_worker(new application_factory<my_hello_world>()); > ---------------------------------------------------------------------------------------------- > > This is linux mint(Ubuntu like). > > echo $LD_LIBRARY_PATH = > /usr/local/lib/ > > ls /usr/local/lib/ = > libbooster.a libbooster.so.0 libcppcms.a libcppcms.so.1 > python2.7 > libbooster.so libbooster.so.0.0.3 libcppcms.so libcppcms.so.1.0.5 > python3.4 > > ls /usr/local/include/cppcms/ = > application.h config.h forwarder.h > localization.h session_dual.h url_dispatcher.h > applications_pool.h copy_filter.h http_content_type.h mem_bind.h > session_interface.h url_mapper.h > archive_traits.h cppcms_error.h http_context.h > mount_point.h session_pool.h util.h > base64.h crypto.h http_cookie.h rpc_json.h > session_sid.h view.h > base_cache_fwd.h cstdint.h http_file.h > serialization_classes.h session_storage.h views_pool.h > base_content.h defs.h http_request.h > serialization.h steal_buf.h xss.h > base_view.h encoding.h http_response.h service.h > string_key.h > cache_interface.h filters.h json.h > session_api.h thread_pool.h > cache_pool.h form.h locale_fwd.h > session_cookies.h urandom.h > > > I spent 4 hours trying to solve this but tried everything that I could > imagine without any success > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@gm...> - 2016-01-10 04:17:44
|
You are looking at the tutorial of old CppCMS version 0.0.x that is deprecated and not supported any more. Up to date tutorial for 1.0.x series is: http://cppcms.com/wikipp/en/page/cppcms_1x#Tutorials Artyom On Sun, Jan 10, 2016 at 2:32 AM, John Soares <joh...@gm...> wrote: > Hi, > > I'm trying to run the code in: > http://cppcms.com/wikipp/en/page/tut_hello_world_code > > but this is what I've got: > ---------------------------------------------------------------------------------------------- > hello.cpp:11:34: error: expected ‘)’ before ‘&’ token > my_hello_world(worker_thread &worker) : > ^ |
From: John S. <joh...@gm...> - 2016-01-10 12:00:37
|
Hi All, Yes! Reading the correct tutorial made everything work. :-) Thank you for your time trying to help me. John On 10 January 2016 at 04:17, Artyom Beilis <art...@gm...> wrote: > You are looking at the tutorial of old CppCMS version 0.0.x that is > deprecated and not supported any more. > > Up to date tutorial for 1.0.x series is: > > http://cppcms.com/wikipp/en/page/cppcms_1x#Tutorials > > Artyom > > On Sun, Jan 10, 2016 at 2:32 AM, John Soares <joh...@gm...> > wrote: > > Hi, > > > > I'm trying to run the code in: > > http://cppcms.com/wikipp/en/page/tut_hello_world_code > > > > but this is what I've got: > > > ---------------------------------------------------------------------------------------------- > > hello.cpp:11:34: error: expected ‘)’ before ‘&’ token > > my_hello_world(worker_thread &worker) : > > ^ > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |