cppcms-users Mailing List for CppCMS C++ Web Framework (Page 116)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Artyom <art...@ya...> - 2011-03-24 15:57:35
|
The problem is once you request output stream the headers are written and thus you can't set redirect headers. You need to provide headers first (set redirect header or so) and then request output stream Requesting output stream triggers many things including headers write and saving session values. So instead of Use response().set_redirect_header( ... ) response().out() << booster::locale::as::time_zone( tz ); Artyom > >From: Pavel Kropitz <un...@fu...> >To: cpp...@li... >Sent: Thu, March 24, 2011 5:47:45 PM >Subject: [Cppcms-users] out() << timezone & redirecting > > >hello Artyom, > > >in my app i have overloaded main function where i catch db exceptions >incompatible with life and set up several things. one of them is timezone> > > >response().out() << booster::locale::as::time_zone( tz ); > > >but that causes setting ostream_requested_ & makes redirecting > > >response().set_redirect_header( ... ) > > >impossible. is there a better way how to set timezone for each response >separately or way how to hack it? > > >pavel. |
From: Pavel K. <un...@fu...> - 2011-03-24 15:47:51
|
hello Artyom, in my app i have overloaded main function where i catch db exceptions incompatible with life and set up several things. one of them is timezone> response().out() << booster::locale::as::time_zone( tz ); but that causes setting ostream_requested_ & makes redirecting response().set_redirect_header( ... ) impossible. is there a better way how to set timezone for each response separately or way how to hack it? pavel. |
From: Pavel K. <un...@fu...> - 2011-03-24 15:24:09
|
hi, download cppcms from svn. there is blog/ directory - very good, more complex example to study. to config.js you need to add> "file_server" : { "enable" : true, "document_root" : "../" }, http://art-blog.no- ip.info/wikipp/en/page/cppcms_1x_config#file_server.document_root compiled binary (from build/ direcotory) look to upper directory to find files. so in blog example template should look like <link href="/media/style-ltr.css" rel="stylesheet" type="text/css" /> (but you will find, that Artyom did it configurable :) On Thursday 24 March 2011, Renato Forti wrote: > Hi Pavel, Thanks for help. > > Now I using no web server, I am using only CPPCMS. > > > > Sorry my ignorance, but I dont understand what is document root and how > setup this. > > > > Is this: script > > { > > "service" : { > > "api" : "http", > > "port" : 8080 > > }, > > "http" : { > > "script" : "/" > > } > > } > > > > Any help ? Thanks |
From: Renato F. <re....@ay...> - 2011-03-24 14:57:58
|
Hi Pavel, Thanks for help. Now I using no web server, I am using only CPPCMS. Sorry my ignorance, but I dont understand what is document root and how setup this. Is this: script { "service" : { "api" : "http", "port" : 8080 }, "http" : { "script" : "/" } } Any help ? Thanks De: Pavel Kropitz [mailto:un...@fu...] Enviada em: quinta-feira, 24 de março de 2011 10:18 Para: cpp...@li... Assunto: Re: [Cppcms-users] RES: RES: RES: RES: RES: Run on Windows 7 hi, as Artyom said, you should use document root according to webserver you use to serve static content. cppcms have one build in, see docs/examples how to use it; or you can use nginx (performance ;), lighthttpd, apache... pavel. >> Maybe provide correct document root for the web server??? On Thursday 24 March 2011, Renato Forti wrote: > If I provide full path, this should work? > > For sample, change this: > > <link href="style.css" rel="stylesheet" type="text/css"> > > To this: > > <link href="c:\cppcms\test\website\style.css" rel="stylesheet" > type="text/css"> > > Thanks |
From: Pavel K. <un...@fu...> - 2011-03-24 13:18:29
|
hi, as Artyom said, you should use document root according to webserver you use to serve static content. cppcms have one build in, see docs/examples how to use it; or you can use nginx (performance ;), lighthttpd, apache... pavel. >> Maybe provide correct document root for the web server??? On Thursday 24 March 2011, Renato Forti wrote: > If I provide full path, this should work? > > For sample, change this: > > <link href="style.css" rel="stylesheet" type="text/css"> > > To this: > > <link href="c:\cppcms\test\website\style.css" rel="stylesheet" > type="text/css"> > > Thanks |
From: Renato F. <re....@ay...> - 2011-03-24 12:55:33
|
If I provide full path, this should work? For sample, change this: <link href="style.css" rel="stylesheet" type="text/css"> To this: <link href="c:\cppcms\test\website\style.css" rel="stylesheet" type="text/css"> Thanks -----Mensagem original----- De: Artyom [mailto:art...@ya...] Enviada em: quinta-feira, 24 de março de 2011 09:32 Para: cpp...@li... Assunto: Re: [Cppcms-users] RES: RES: RES: RES: Run on Windows 7 > > But now, I already have a technical question, (is about how load > resources, gif, jpg, css, js etc) for sample this code: > > [snip[ > > Load html of disk, and show it, but not show linked resources like: > gif, jpg, css, js See html: > > [snip[ > ================ > Things like this, is not loaded: > > <link href="style.css" rel="stylesheet" type="text/css"> <img > src="imgs/spacer.gif" width="10" height="10"> <img src="imgs/vgs.gif" > width="749" height="189"> > > How solve this? Maybe provide correct document root for the web server??? Each image and stylesheet is server by indepenent re quest that generally web server is responsible for this. And it handles such things (static files) a way better... > > 2) I have a lot of stencil (ATL SERVE) pages, I want design same > thing that allow I use attribute of ATL Server in CPPCMS, I wil > design some thing that handle this: > > <title>{{onTitle}}</title> > > {{onTitle}} is attribute that will be replaced by some text. > > Other question, I'd see "Template System" this is like a: > google-ctemplate (http://code.google.com/p/google-ctemplate/). > CppCMS has very very powerful template system that is very good integrated with it (forms loading etc), fast and allows to do many things safely. Why should you use some other template system? I can suggest you, read tutorials, take a look on examples. Artyom ---------------------------------------------------------------------------- -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2011-03-24 12:31:56
|
> > But now, I already have a technical question, (is about how load resources, > gif, jpg, css, js etc) for sample this code: > > [snip[ > > Load html of disk, and show it, but not show linked resources like: gif, > jpg, css, js > See html: > > [snip[ > ================ > Things like this, is not loaded: > > <link href="style.css" rel="stylesheet" type="text/css"> > <img src="imgs/spacer.gif" width="10" height="10"> > <img src="imgs/vgs.gif" width="749" height="189"> > > How solve this? Maybe provide correct document root for the web server??? Each image and stylesheet is server by indepenent re quest that generally web server is responsible for this. And it handles such things (static files) a way better... > > 2) I have a lot of stencil (ATL SERVE) pages, I want design same thing that > allow I use attribute of ATL Server in CPPCMS, I wil design some thing that > handle this: > > <title>{{onTitle}}</title> > > {{onTitle}} is attribute that will be replaced by some text. > > Other question, I'd see "Template System" this is like a: google-ctemplate > (http://code.google.com/p/google-ctemplate/). > CppCMS has very very powerful template system that is very good integrated with it (forms loading etc), fast and allows to do many things safely. Why should you use some other template system? I can suggest you, read tutorials, take a look on examples. Artyom |
From: Renato F. <re....@ay...> - 2011-03-24 12:22:05
|
Hi Artyom, Thanks a lot of clarification, I will try implement some small site to see how is develop using it. But now, I already have a technical question, (is about how load resources, gif, jpg, css, js etc) for sample this code: ---------------------------------------------------------------------------- --------------------------------------------------------------------------- void test::main(std::string /*url*/) { string line; ifstream myfile ("index2.html"); if (myfile.is_open()) { while ( myfile.good() ) { getline (myfile,line); response().out() << line; } myfile.close(); } else response().out()<< "Unable to open file"; } ============================================================================ ================ Load html of disk, and show it, but not show linked resources like: gif, jpg, css, js See html: ---------------------------------------------------------------------------- --------------------------------------------------------------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div class="text_gray_login" id="apDiv1">Segunda-feira, 20 de setembro de 2011.</div> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td></td> </tr> <tr> <td bgcolor="#034EA1"><img src="imgs/spacer.gif" width="10" height="10"></td> </tr> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0"> <tr> <td><img src="imgs/vgs.gif" width="749" height="189"></td> </tr> <tr> <td></td> </tr> </table></td> </tr> <tr> <td bgcolor="#666666"><table width="737" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="14"><img src="imgs/spacer.gif" width="14" height="20"></td> <td width="723" class="text_white_login"> </td> </tr> </table></td> </tr> <tr> <td bgcolor="#F9A51A"><img src="imgs/spacer.gif" width="10" height="10"></td> </tr> </table> </body> </html> ============================================================================ ================ Things like this, is not loaded: <link href="style.css" rel="stylesheet" type="text/css"> <img src="imgs/spacer.gif" width="10" height="10"> <img src="imgs/vgs.gif" width="749" height="189"> How solve this? My plan: 1) Is use EXTJS with CPPCMS (I see that CPPCMS have a good support for JSON) and EXTJS link all resources. 2) I have a lot of stencil (ATL SERVE) pages, I want design same thing that allow I use attribute of ATL Server in CPPCMS, I wil design some thing that handle this: <title>{{onTitle}}</title> {{onTitle}} is attribute that will be replaced by some text. Other question, I'd see "Template System" this is like a: google-ctemplate (http://code.google.com/p/google-ctemplate/). And finally, Thanks and congratulations. Sorry for so many questions! -----Mensagem original----- De: Artyom [mailto:art...@ya...] Enviada em: quinta-feira, 24 de março de 2011 04:43 Para: cpp...@li... Assunto: Re: [Cppcms-users] RES: RES: RES: Run on Windows 7 > > Now Work... :0) (the problema was that I buid zlib na pcre whong) > Building anything on Windows is painful... > Well I have fell questions, if you have time to answer. > > Some introduction: > > I look for "CPPCMS" because I have one site that need run fast, > this site was build in "ATL Server" > (http://201.44.136.135/ucsws/establishment/authentication/default.srf) > but now we want move to other technology (or plan is migrate to > Linux/apache) > In any case I'd suggest to move to Linux, CppCMS is developed mostly on Linux and it is the recommended deploy configuration. > Questions: > > 1) CPPCMS is a good tool to build very large site that need handle many > (thousands) users? Yes, this is what it was designed for, > 2) What is stability of CPPCMS? See this: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x And yes, it is stable, it has some unknown bugs like any other software but it is tested and stable software. > 3) We plan use it with FastCGI, because of load balance and failover, how > CPPCMS handle (distributed) sessions in this case? I need something like > mencached, or store sessions on data base? You have several options: 1. You may (and this is best) use encrypted or signed cookies so you save all the data at client side while the data is digitally signed so user can't mess with it. It does not solve **all** problems because sometimes you need server side storage: See this: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#session However you can always specify that is certain cases you want to store data on server side and this is per session option. 2. You may use distributed filesystem like NFS or Windows Share It is by the way would be generally very fast given a file system like ext3 that handles many files very well. (Generally much better then DB) 3. You can provide you own database based session backend (but be aware that database is slow for this kind of job). 4. It is not implemented yet in CppCMS 1.x.x (it exists in 0.0.x) but cppcms provides "scalability server" it is memcached like server that provides support of distributed caching and it should include support of distributed sessions. It was removed during rewriting CppCMS 0.0.x to 1.x.x and hadn't returned back yet. But it would be ready before RC1 of CppCMS 1.x.x > 4) CPPCMS is free? I can sale my products with it, or I need open source of > my products? You need to follow LGPLv3 license requirements. It means that you can use it in closed source products as long as you follow LGPLv3 license restrictions. If you don't want to follow LGPL restriction I'll be able to provide a commercial license, of course for some fee. > 5) I have plan to mix it with PHP, this is possible? Share sessions between > PHP and CPPCMS? There is no support for this. However the simplest way to share a data between PHP and CppCMS would be to use a signed cookie. Create some data in format that C++ and PHP understands sign it with hmac (CppCMS and PHP has built in support for it) and then store it as cookie at client side. > 6) You think that is possible build large site, like Facebook in CPPCMS? > Facebook convert a lot of code In C++, CPPCMS fit in it? As I told that it what it was designed for. I'm not ware of CppCMS based applications deployed for a system of size of Facebook (but I'm not aware of too many systems of scale of facebook at all) > CPPCMS is like an > Thrift? (about performance and scale) > See this: http://art-blog.no-ip.info/wikipp/en/page/benchmarks And it scales very well, I did testing on a small network of 3-4 computers and it scaled quite lineary. It is designed to be scalable, it provides memcached like distributed cache system with two levels of caches, and with advanced cache invalidation. Scalability is major goal and consern of CppCMS. Regards, Artyom ---------------------------------------------------------------------------- -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2011-03-24 07:42:39
|
> > Now Work... :0) (the problema was that I buid zlib na pcre whong) > Building anything on Windows is painful... > Well I have fell questions, if you have time to answer. > > Some introduction: > > I look for "CPPCMS" because I have one site that need run fast, this > site was build in "ATL Server" > (http://201.44.136.135/ucsws/establishment/authentication/default.srf) but > now we want move to other technology (or plan is migrate to Linux/apache) > In any case I'd suggest to move to Linux, CppCMS is developed mostly on Linux and it is the recommended deploy configuration. > Questions: > > 1) CPPCMS is a good tool to build very large site that need handle many > (thousands) users? Yes, this is what it was designed for, > 2) What is stability of CPPCMS? See this: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x And yes, it is stable, it has some unknown bugs like any other software but it is tested and stable software. > 3) We plan use it with FastCGI, because of load balance and failover, how > CPPCMS handle (distributed) sessions in this case? I need something like > mencached, or store sessions on data base? You have several options: 1. You may (and this is best) use encrypted or signed cookies so you save all the data at client side while the data is digitally signed so user can't mess with it. It does not solve **all** problems because sometimes you need server side storage: See this: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#session However you can always specify that is certain cases you want to store data on server side and this is per session option. 2. You may use distributed filesystem like NFS or Windows Share It is by the way would be generally very fast given a file system like ext3 that handles many files very well. (Generally much better then DB) 3. You can provide you own database based session backend (but be aware that database is slow for this kind of job). 4. It is not implemented yet in CppCMS 1.x.x (it exists in 0.0.x) but cppcms provides "scalability server" it is memcached like server that provides support of distributed caching and it should include support of distributed sessions. It was removed during rewriting CppCMS 0.0.x to 1.x.x and hadn't returned back yet. But it would be ready before RC1 of CppCMS 1.x.x > 4) CPPCMS is free? I can sale my products with it, or I need open source of > my products? You need to follow LGPLv3 license requirements. It means that you can use it in closed source products as long as you follow LGPLv3 license restrictions. If you don't want to follow LGPL restriction I'll be able to provide a commercial license, of course for some fee. > 5) I have plan to mix it with PHP, this is possible? Share sessions between > PHP and CPPCMS? There is no support for this. However the simplest way to share a data between PHP and CppCMS would be to use a signed cookie. Create some data in format that C++ and PHP understands sign it with hmac (CppCMS and PHP has built in support for it) and then store it as cookie at client side. > 6) You think that is possible build large site, like Facebook in CPPCMS? > Facebook convert a lot of code In C++, CPPCMS fit in it? As I told that it what it was designed for. I'm not ware of CppCMS based applications deployed for a system of size of Facebook (but I'm not aware of too many systems of scale of facebook at all) > CPPCMS is like an > Thrift? (about performance and scale) > See this: http://art-blog.no-ip.info/wikipp/en/page/benchmarks And it scales very well, I did testing on a small network of 3-4 computers and it scaled quite lineary. It is designed to be scalable, it provides memcached like distributed cache system with two levels of caches, and with advanced cache invalidation. Scalability is major goal and consern of CppCMS. Regards, Artyom |
From: Renato F. <re....@ay...> - 2011-03-23 23:35:04
|
Hi Artyom, Now Work... :0) (the problema was that I buid zlib na pcre whong) Well I have fell questions, if you have time to answer. Some introduction: I look for "CPPCMS" because I have one site that need run fast, this site was build in "ATL Server" (http://201.44.136.135/ucsws/establishment/authentication/default.srf) but now we want move to other technology (or plan is migrate to Linux/apache) Questions: 1) CPPCMS is a good tool to build very large site that need handle many (thousands) users? 2) What is stability of CPPCMS? 3) We plan use it with FastCGI, because of load balance and failover, how CPPCMS handle (distributed) sessions in this case? I need something like mencached, or store sessions on data base? 4) CPPCMS is free? I can sale my products with it, or I need open source of my products? 5) I have plan to mix it with PHP, this is possible? Share sessions between PHP and CPPCMS? 6) You think that is possible build large site, like Facebook in CPPCMS? Facebook convert a lot of code In C++, CPPCMS fit in it? CPPCMS is like an Thrift? (about performance and scale) Thanks :) -----Mensagem original----- De: Artyom [mailto:art...@ya...] Enviada em: quarta-feira, 23 de março de 2011 17:09 Para: cpp...@li... Assunto: Re: [Cppcms-users] RES: RES: Run on Windows 7 > Now work, but I need Chang name of zlib? (this zlibwapi.lib to > zlib.lib) This ok? There is ABI difference between wapi and normal zlib, there are instructions on how to build it (I think there is an nmake file or something like that) I'd recommend to use it and this is how I build zlib. wapi is different as it provides different calling conversion. It may work but not sure about it. > Linking CXX shared library booster-d.dll > Creating library booster-d.lib and object booster-d.exp > pcre_regex.cpp.obj : error LNK2019: unresolved external symbol > __imp__pcre_fulli It seems like you link with static library instead of import library of the DLL? How did you build pcre? What parameters? How did you installed it? What is content of pcre build? C:\pcre-8.12 Artyom ---------------------------------------------------------------------------- -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2011-03-23 20:08:40
|
> Now work, but I need Chang name of zlib? (this zlibwapi.lib to zlib.lib) > This ok? There is ABI difference between wapi and normal zlib, there are instructions on how to build it (I think there is an nmake file or something like that) I'd recommend to use it and this is how I build zlib. wapi is different as it provides different calling conversion. It may work but not sure about it. > Linking CXX shared library booster-d.dll > Creating library booster-d.lib and object booster-d.exp > pcre_regex.cpp.obj : error LNK2019: unresolved external symbol > __imp__pcre_fulli It seems like you link with static library instead of import library of the DLL? How did you build pcre? What parameters? How did you installed it? What is content of pcre build? C:\pcre-8.12 Artyom |
From: Renato F. <re....@ay...> - 2011-03-23 16:08:33
|
Hi Artyom, Now work, but I need Chang name of zlib? (this zlibwapi.lib to zlib.lib) This ok? CMD: cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 -DCMAKE_INCLUDE_PATH=C:\pcre-8.12 -DCMAKE_LIBRARY_PATH=C:\pcre-8.12 -DCMAKE_INCLUDE_PATH=C:\zlib-1.2.5 -DCMAKE_LIBRARY_PATH=C:\zlib-1.2.5\contrib\vstudio\vc9\x86\ZlibDllDebug Now I have one error in make, if you can help-me again: Linking CXX shared library booster-d.dll Creating library booster-d.lib and object booster-d.exp pcre_regex.cpp.obj : error LNK2019: unresolved external symbol __imp__pcre_fulli nfo referenced in function "public: void __thiscall booster::regex::assign(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?assign@regex@booster@@QAEXABV?$basic_string@DU?$char_traits@D @std@@V?$allocator@D@2@@std@@H@Z) pcre_regex.cpp.obj : error LNK2019: unresolved external symbol __imp__pcre_compi le referenced in function "public: void __thiscall booster::regex::assign(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?assign@regex@booster@@QAEXABV?$basic_string@DU?$char_traits@D@ std@@V?$allocator@D@2@@std@@H@Z) pcre_regex.cpp.obj : error LNK2019: unresolved external symbol __imp__pcre_exec referenced in function "public: bool __thiscall booster::regex::search(char cons t *,char const *,int)const " (?search@regex@booster@@QBE_NPBD0H@Z) pcre_regex.cpp.obj : error LNK2001: unresolved external symbol __imp__pcre_mallo c pcre_regex.cpp.obj : error LNK2001: unresolved external symbol __imp__pcre_free booster-d.dll : fatal error LNK1120: 5 unresolved externals LINK Pass 1 failed. with 1120 NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe"' : return code '0xffffffff' Stop. NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\BIN\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\BIN\nmake.exe"' : return code '0x2' Stop. C:\cppcms-0.99.6> Thanks Again -----Mensagem original----- De: Artyom [mailto:art...@ya...] Enviada em: quarta-feira, 23 de março de 2011 12:25 Para: cpp...@li... Assunto: Re: [Cppcms-users] RES: Run on Windows 7 Hi, If you have for example: c:\pcre\include\pcre.h c:\pcre\lib\pcre.lib c:\pcre\bin\pcre.dll Then you need to provide -DCMAKE_INCLUDE_PATH=c:\pcre\include -DCMAKE_LIBRARY_PATH=c:\pcre\lib Same for zlib. Artyom ----- Original Message ---- > From: Renato Forti <re....@ay...> > To: cpp...@li... > Sent: Wed, March 23, 2011 5:08:54 PM > Subject: [Cppcms-users] RES: Run on Windows 7 > > Hi Thanks for help, > > Like this: > > cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON > -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 > -CMAKE_INCLUDE_PATH=C:\pcre-8.12; > C:\zlib-1.2.5 -CMAKE_LIBRARY_PATH=C:\pcre-8.12; > C:\zlib-1.2.5\contrib\vstudio\vc9\x86\ZlibDllRelease > > don't work :( > > I must create a "include" and a "lib" in my "C:\"and copy all *.h and > *.lib *.dll of zlib-1.2.5 and pcre-8.12 in it? Is this? > > For sample: > > cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON > -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 > -CMAKE_INCLUDE_PATH=C:\include -CMAKE_LIBRARY_PATH=C:\lib > > > Thanks :) > > -----Mensagem original----- > De: Artyom [mailto:art...@ya...] Enviada em: quarta-feira, 23 > de março de 2011 11:54 > Para: cpp...@li... > Assunto: Re: [Cppcms-users] Run on Windows 7 > > You need to provide path to locations of zlib and pcre. as > CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH > > >PCRE_LIB > > linked by target "booster" in directory C:/cppcms-0.99.6/booster > > linked by target "booster-static" in directory > >C:/cppcms-0.99.6/booster ZLIB > > linked by target "cppcms" in directory C:/cppcms-0.99.6 > > linked by target "cppcms-static" in directory C:/cppcms-0.99.6 > >ZLIB_INCLUDE_DIR > > used as include directory in directory C:/cppcms-0.99.6 > > > >-- Configuring incomplete, errors occurred! > > > >C:\cppcms-0.99.6> > > > > > >WHAT IS THE PROBLEM? How to FIX? I have in my c:\ > > > >C:\zlib-1.2.5 > >C:\pcre-8.12 > > > >Thanks :) > > > > > > CMake does not know where to look for zlib and pcre, > > See examples: > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build#win32 > > I also can suggest to create something like > > c:\some_path\debug_libs > c:\some_path\release_libs > > And install PCRE and ZLIB in their debug and release configurations > there so you would not mess up with inconsistent versions of libraries. > > Artyom > > > > > > > > > > > > > ---------------------------------------------------------------------- > ------ > -- > Enable your software for Intel(R) Active Management Technology to > meet the growing manageability and security demands of your > customers. Businesses are taking advantage of Intel(R) vPro (TM) > technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! > http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > ---------------------------------------------------------------------- > -------- Enable your software for Intel(R) Active Management > Technology to meet the growing manageability and security demands of > your customers. Businesses are taking advantage of Intel(R) vPro (TM) > technology - will your software be a part of the solution? Download > the Intel(R) Manageability Checker today! > http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > ---------------------------------------------------------------------------- -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2011-03-23 15:25:36
|
Hi, If you have for example: c:\pcre\include\pcre.h c:\pcre\lib\pcre.lib c:\pcre\bin\pcre.dll Then you need to provide -DCMAKE_INCLUDE_PATH=c:\pcre\include -DCMAKE_LIBRARY_PATH=c:\pcre\lib Same for zlib. Artyom ----- Original Message ---- > From: Renato Forti <re....@ay...> > To: cpp...@li... > Sent: Wed, March 23, 2011 5:08:54 PM > Subject: [Cppcms-users] RES: Run on Windows 7 > > Hi Thanks for help, > > Like this: > > cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 -CMAKE_INCLUDE_PATH=C:\pcre-8.12; > C:\zlib-1.2.5 -CMAKE_LIBRARY_PATH=C:\pcre-8.12; > C:\zlib-1.2.5\contrib\vstudio\vc9\x86\ZlibDllRelease > > don't work :( > > I must create a "include" and a "lib" in my "C:\"and copy all *.h and *.lib > *.dll of zlib-1.2.5 and pcre-8.12 in it? Is this? > > For sample: > > cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 -CMAKE_INCLUDE_PATH=C:\include > -CMAKE_LIBRARY_PATH=C:\lib > > > Thanks :) > > -----Mensagem original----- > De: Artyom [mailto:art...@ya...] > Enviada em: quarta-feira, 23 de março de 2011 11:54 > Para: cpp...@li... > Assunto: Re: [Cppcms-users] Run on Windows 7 > > You need to provide path to locations of zlib and pcre. as > CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH > > >PCRE_LIB > > linked by target "booster" in directory C:/cppcms-0.99.6/booster > > linked by target "booster-static" in directory > >C:/cppcms-0.99.6/booster ZLIB > > linked by target "cppcms" in directory C:/cppcms-0.99.6 > > linked by target "cppcms-static" in directory C:/cppcms-0.99.6 > >ZLIB_INCLUDE_DIR > > used as include directory in directory C:/cppcms-0.99.6 > > > >-- Configuring incomplete, errors occurred! > > > >C:\cppcms-0.99.6> > > > > > >WHAT IS THE PROBLEM? How to FIX? I have in my c:\ > > > >C:\zlib-1.2.5 > >C:\pcre-8.12 > > > >Thanks :) > > > > > > CMake does not know where to look for zlib and pcre, > > See examples: > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build#win32 > > I also can suggest to create something like > > c:\some_path\debug_libs > c:\some_path\release_libs > > And install PCRE and ZLIB in their debug and release configurations there so > you would not mess up with inconsistent versions of libraries. > > Artyom > > > > > > > > > > > > > ---------------------------------------------------------------------------- > -- > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses are > taking advantage of Intel(R) vPro (TM) technology - will your software be a > part of the solution? Download the Intel(R) Manageability Checker today! > http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Renato F. <re....@ay...> - 2011-03-23 15:09:21
|
Hi Thanks for help, Like this: cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 -CMAKE_INCLUDE_PATH=C:\pcre-8.12; C:\zlib-1.2.5 -CMAKE_LIBRARY_PATH=C:\pcre-8.12; C:\zlib-1.2.5\contrib\vstudio\vc9\x86\ZlibDllRelease don't work :( I must create a "include" and a "lib" in my "C:\"and copy all *.h and *.lib *.dll of zlib-1.2.5 and pcre-8.12 in it? Is this? For sample: cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 -CMAKE_INCLUDE_PATH=C:\include -CMAKE_LIBRARY_PATH=C:\lib Thanks :) -----Mensagem original----- De: Artyom [mailto:art...@ya...] Enviada em: quarta-feira, 23 de março de 2011 11:54 Para: cpp...@li... Assunto: Re: [Cppcms-users] Run on Windows 7 You need to provide path to locations of zlib and pcre. as CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH >PCRE_LIB > linked by target "booster" in directory C:/cppcms-0.99.6/booster > linked by target "booster-static" in directory >C:/cppcms-0.99.6/booster ZLIB > linked by target "cppcms" in directory C:/cppcms-0.99.6 > linked by target "cppcms-static" in directory C:/cppcms-0.99.6 >ZLIB_INCLUDE_DIR > used as include directory in directory C:/cppcms-0.99.6 > >-- Configuring incomplete, errors occurred! > >C:\cppcms-0.99.6> > > >WHAT IS THE PROBLEM? How to FIX? I have in my c:\ > >C:\zlib-1.2.5 >C:\pcre-8.12 > >Thanks :) > > CMake does not know where to look for zlib and pcre, See examples: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build#win32 I also can suggest to create something like c:\some_path\debug_libs c:\some_path\release_libs And install PCRE and ZLIB in their debug and release configurations there so you would not mess up with inconsistent versions of libraries. Artyom > > ---------------------------------------------------------------------------- -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2011-03-23 14:53:45
|
You need to provide path to locations of zlib and pcre. as CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH >PCRE_LIB > linked by target "booster" in directory C:/cppcms-0.99.6/booster > linked by target "booster-static" in directory C:/cppcms-0.99.6/booster >ZLIB > linked by target "cppcms" in directory C:/cppcms-0.99.6 > linked by target "cppcms-static" in directory C:/cppcms-0.99.6 >ZLIB_INCLUDE_DIR > used as include directory in directory C:/cppcms-0.99.6 > >-- Configuring incomplete, errors occurred! > >C:\cppcms-0.99.6> > > >WHAT IS THE PROBLEM? How to FIX? I have in my c:\ > >C:\zlib-1.2.5 >C:\pcre-8.12 > >Thanks :) > > CMake does not know where to look for zlib and pcre, See examples: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build#win32 I also can suggest to create something like c:\some_path\debug_libs c:\some_path\release_libs And install PCRE and ZLIB in their debug and release configurations there so you would not mess up with inconsistent versions of libraries. Artyom > > |
From: Renato F. <re....@ay...> - 2011-03-23 14:13:44
|
Hi All, I am try run CMS on Windows, but I have errors: 1) My APTH C:\cppcms-0.99.6>path PATH=C:\pcre-8.12;C:\cppcms-0.99.6\booster\booster;C:\cppcms-0.99.6\booster; C:\p cre-8.12;C:\cppcms-0.99.6\booster\booster;C:\cppcms-0.99.6\booster;C:\cppcms -0.9 9.6\booster\booster;c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\I DE;c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;c:\Program Files (x 86)\Microsoft Visual Studio 9.0\Common7\Tools;c:\Windows\Microsoft.NET\Framework \v3.5;c:\Windows\Microsoft.NET\Framework\v2.0.50727;c:\Program Files (x86)\Micro soft Visual Studio 9.0\VC\VCPackages;C:\Program Files\Microsoft SDKs\Windows\v6. 0A\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Fi les (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Wind ows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ Prog ram Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;; E:\project.aysso\Base\Poco\Main\bin;C:\Qt\4.7.1\bin;C:\Program Files\Perforce;C: \OpenSSL-Win32\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Pr ogram Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Pr ogram Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Micr osoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\My SQL\MySQL Server 5.5\bin;C:\fcgi-2.4.0\libfcgi\Release;C:\Program Files (x86)\CM ake 2.8\bin;C:\Python27;C:\cppcms-0.99.6\booster 2) try build C:\cppcms-0.99.6>cmake -G "NMake Makefiles" -DUSE_WINDOWS6_API=ON -DCMAKE_BUILD_ TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\cppcms-0.99.6 -- The C compiler identification is MSVC -- The CXX compiler identification is MSVC -- Check for CL compiler version -- Check for CL compiler version - 1500 -- Check if this is a free VC compiler -- Check if this is a free VC compiler - no -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft Visual Studi o 9.0/VC/bin/cl.exe -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft Visual Studi o 9.0/VC/bin/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Looking for ICU libraries -- ICU not found, disabling ICU localization backend -- Performing Test BOOSTER_HAS_GCC_SYNC -- Performing Test BOOSTER_HAS_GCC_SYNC - Failed -- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD -- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD - Failed -- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD -- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD - Failed -- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC -- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC -- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC -- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_STDINT_H -- Performing Test BOOSTER_HAVE_STDINT_H - Failed -- Performing Test BOOSTER_HAVE_INTTYPES_H -- Performing Test BOOSTER_HAVE_INTTYPES_H - Failed -- Performing Test BOOSTER_AIO_HAVE_PF_INET6 -- Performing Test BOOSTER_AIO_HAVE_PF_INET6 - Failed -- Performing Test HAVE_WINDOWS6_API -- Performing Test HAVE_WINDOWS6_API - Success -- Performing Test CPPCMS_HAVE_STDINT_H -- Performing Test CPPCMS_HAVE_STDINT_H - Failed -- Performing Test CPPCMS_HAVE_INTTYPES_H -- Performing Test CPPCMS_HAVE_INTTYPES_H - Failed -- Looking for atoll -- Looking for atoll - not found -- Looking for _atoi64 -- Looking for _atoi64 - found -- Looking for snprintf -- Looking for snprintf - not found -- Looking for stat -- Looking for stat - found -- Looking for _stat -- Looking for _stat - found -- Performing Test CPPCMS_HAVE_STD_WSTRING -- Performing Test CPPCMS_HAVE_STD_WSTRING - Success -- Performing Test CPPCMS_HAVE_BSD_TM -- Performing Test CPPCMS_HAVE_BSD_TM - Failed -- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING -- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING - Failed -- Performing Test CPPCMS_HAVE_CPP_0X_AUTO -- Performing Test CPPCMS_HAVE_CPP_0X_AUTO - Failed -- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE -- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE - Failed -- Performing Test CPPCMS_HAVE_GCC_TYPEOF -- Performing Test CPPCMS_HAVE_GCC_TYPEOF - Failed -- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF -- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF - Failed -- Looking for canonicalize_file_name -- Looking for canonicalize_file_name - not found GNU-TLS Gcrypt or OpenSSL librarys are not found, disabling AES encryption suppo rt CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake file s: PCRE_LIB linked by target "booster" in directory C:/cppcms-0.99.6/booster linked by target "booster-static" in directory C:/cppcms-0.99.6/booster ZLIB linked by target "cppcms" in directory C:/cppcms-0.99.6 linked by target "cppcms-static" in directory C:/cppcms-0.99.6 ZLIB_INCLUDE_DIR used as include directory in directory C:/cppcms-0.99.6 -- Configuring incomplete, errors occurred! C:\cppcms-0.99.6> WHAT IS THE PROBLEM? How to FIX? I have in my c:\ C:\zlib-1.2.5 C:\pcre-8.12 Thanks :) |
From: Heiko W. <he...@we...> - 2011-03-21 14:25:46
|
Hi Pavel, nice. That works fine. Thanks. Am 18.03.2011 um 19:35 schrieb Pavel Kropitz: > hi, > > it's locale problem. set std::locale::global() for newly created streams and use imbue() to affect std::cout. > > int main() { > std::locale::global( booster::locale::generator().generate( "" ) ); > > std::string tz = "Canada/Eastern"; > booster::locale::date_time dt; > > std::istringstream is("1999-04-22 12:13:14"); > is >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; > > std::cout.imbue( std::locale() ); > > std::cout << booster::locale::as::time_zone(tz) << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; > } > > pavel. > > > On Friday 18 March 2011, Heiko Weber wrote: > > Hi Artyom, > > > > first, thanks for the work, I am really impressed about what I've > > discovered so far ! > > > > I am just trying to figure out what parts of "boost" are still accessable > > with booster ... so, maybe the following is just not working by intention? > > I hope you can give me some enlightment ;) > > > > This one results in an exception: > > > > terminate called after throwing an instance of 'std::bad_cast' > > what(): std::bad_cast > > Abort trap > > > > --- > > > > #include <booster/locale/date_time.h> > > #include <booster/locale/formatting.h> > > #include <booster/locale/generator.h> > > #include <booster/locale/localization_backend.h> > > #include <iostream> > > #include <sstream> > > > > int main() { > > > > booster::locale::localization_backend_manager my = > > booster::locale::localization_backend_manager::global(); // Get global > > backend > > > > my.select("icu"); > > > > std::string tz = "Canada/Eastern"; > > booster::locale::date_time dt; > > > > std::istringstream is("1999-04-22 12:13:14"); > > is >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; > > std::cout << booster::locale::as::time_zone(tz) << > > booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; } > > > > I also also tried it without the backend select, but same result. The throw > > happens at the constructor of dt, shouldn't it work without setting up a > > calendar/locale first ? > > > > Thanks in advance. > > Heiko > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d_______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- Wecos <> Heiko Weber Computer Systeme D-21644 Sauensiek <> Immenweg 5 he...@we... <> http://www.wecos.de Tel. +49 (4169) 91000 <> Fax +49 (4169) 919033 _______________________________________________________________ This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. _______________________________________________________________ Diese E-Mail kann digital signiert sein. Falls Ihr E-Mail-Programm nicht ueber die notwendigen Prueffunktionen verfuegt, ignorieren Sie bitte die angehaengte Signatur-Datei. _______________________________________________________________ This email may be digitally signed. If your email software does not support the necessary validation feature, please disregard the attached signature file. _______________________________________________________________ |
From: Abhishek K. <abh...@gm...> - 2011-03-21 11:41:31
|
Thanks Artyom, that worked for me:) Artyom <artyomtnk@...> writes: |
From: Artyom <art...@ya...> - 2011-03-21 09:14:28
|
> > 1. are there any loops stuffs in the template system of CPPCMS? > > as in PHP we have > > <?php foreach ($var as $key => $value); ?> > > <label><?php echo $key ?>:</label><label><?php echo $value ?>:</label> > > <?php end foreach; ?> Yes you can: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates_flow#Foreach.block <% foreach a in b %> <ul> <% item %><% a %><% end %> </ul> <% empty %> nothing <% end %> In your case if b is std::map then a.first would be key and a.second would be a value. > > also, in php one can mix php codes along with html codes for eg: > > <html> > <body> > <?php > > while(expr) > { > //do some stuff > } > > ?> > </body> > </html> > Yes you can but in limited way: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates_comm#Injecting.C...Code Read more at: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates > > 2. is it possible in cppcms to mix c++ and html codes the similar way? > It is not recommended unless it is necessary. Artyom |
From: Abhishek K. <abh...@gm...> - 2011-03-21 09:08:48
|
Hi Artyom, I am currently trying developing a web-application based on cppcms. Here I would like to know, 1. are there any loops stuffs in the template system of CPPCMS? as in PHP we have <?php foreach ($var as $key => $value); ?> <label><?php echo $key ?>:</label><label><?php echo $value ?>:</label> <?php end foreach; ?> also, in php one can mix php codes along with html codes for eg: <html> <body> <?php while(expr) { //do some stuff } ?> </body> </html> 2. is it possible in cppcms to mix c++ and html codes the similar way? Or is there any alternative way of doing points 1 & 2? Thanks a lot in advance Artyom :) |
From: Pavel K. <un...@fu...> - 2011-03-18 18:35:01
|
hi, it's locale problem. set std::locale::global() for newly created streams and use imbue() to affect std::cout. int main() { std::locale::global( booster::locale::generator().generate( "" ) ); std::string tz = "Canada/Eastern"; booster::locale::date_time dt; std::istringstream is("1999-04-22 12:13:14"); is >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; std::cout.imbue( std::locale() ); std::cout << booster::locale::as::time_zone(tz) << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; } pavel. On Friday 18 March 2011, Heiko Weber wrote: > Hi Artyom, > > first, thanks for the work, I am really impressed about what I've > discovered so far ! > > I am just trying to figure out what parts of "boost" are still accessable > with booster ... so, maybe the following is just not working by intention? > I hope you can give me some enlightment ;) > > This one results in an exception: > > terminate called after throwing an instance of 'std::bad_cast' > what(): std::bad_cast > Abort trap > > --- > > #include <booster/locale/date_time.h> > #include <booster/locale/formatting.h> > #include <booster/locale/generator.h> > #include <booster/locale/localization_backend.h> > #include <iostream> > #include <sstream> > > int main() { > > booster::locale::localization_backend_manager my = > booster::locale::localization_backend_manager::global(); // Get global > backend > > my.select("icu"); > > std::string tz = "Canada/Eastern"; > booster::locale::date_time dt; > > std::istringstream is("1999-04-22 12:13:14"); > is >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; > std::cout << booster::locale::as::time_zone(tz) << > booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; } > > I also also tried it without the backend select, but same result. The throw > happens at the constructor of dt, shouldn't it work without setting up a > calendar/locale first ? > > Thanks in advance. > Heiko |
From: Heiko W. <he...@we...> - 2011-03-18 16:53:55
|
Hi Artyom, first, thanks for the work, I am really impressed about what I've discovered so far ! I am just trying to figure out what parts of "boost" are still accessable with booster ... so, maybe the following is just not working by intention? I hope you can give me some enlightment ;) This one results in an exception: terminate called after throwing an instance of 'std::bad_cast' what(): std::bad_cast Abort trap --- #include <booster/locale/date_time.h> #include <booster/locale/formatting.h> #include <booster/locale/generator.h> #include <booster/locale/localization_backend.h> #include <iostream> #include <sstream> int main() { booster::locale::localization_backend_manager my = booster::locale::localization_backend_manager::global(); // Get global backend my.select("icu"); std::string tz = "Canada/Eastern"; booster::locale::date_time dt; std::istringstream is("1999-04-22 12:13:14"); is >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; std::cout << booster::locale::as::time_zone(tz) << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; } I also also tried it without the backend select, but same result. The throw happens at the constructor of dt, shouldn't it work without setting up a calendar/locale first ? Thanks in advance. Heiko |
From: Pavel K. <un...@fu...> - 2011-03-16 23:33:05
|
On Wednesday 16 March 2011, Artyom wrote: > http://cppcms.sourceforge.net/boost_locale/html/using_localization_backends > .html > > >std::string tz = "Europe/Prague"; > > Note you can use this: > > http://cppcms.sourceforge.net/boost_locale/html/namespaceboost_1_1locale_1_ > 1time__zone.html > To set global time zone. > Also you can set timezone independently on stream using as::time_zone > manipulator. yes, they are very usefull. generally, i'm trying to write an example for generating current server timestamp, generating time from user input and storing it as a number (to DB) & restore it to timezone specific date & show it to user. maybe it will be usefull to have this in documentation (with best practise how to set it up with cppcms response()). i missed "as::time_zone" and ">>" parsing possibility for the first time while going through documentation. > It seems that you need to update the ICU version. > I've tested this code (actually boost not booster, but it is the same): > #include <boost/locale.hpp> > #include <iostream> > int main() > { > std::locale::global(boost::locale::generator().generate("")); > std::stringstream s; > time_t d; > s.str("1955-07-21 07:21:07"); > s >> boost::locale::as::ftime("%Y-%m-%d %H:%M:%S") >> d; > std::cout.imbue(std::locale()); > std::cout << s.str() << std::endl; > std::cout << boost::locale::as::ftime("%Y-%m-%d %H:%M:%S") << d << > std::endl; > } > > It hadn't work for icu 3.8 (gave a year 1970) but works without problems > for icu-4.4 and 4.6, > So it seems like ICU issue. (They have bugs as well :-( ) > > It is fairly simple to compile latest ICU version. i work with icu-4.6 (gentoo package), and now tried it with 4.4.2, but without success. anyway, your example works as expected, so i figure out that s >> boost::locale::as::ftime("%Y-%m-%d %H:%M:%S") >> _time_t_ versus s >> boost::locale::as::ftime("%Y-%m-%d %H:%M:%S") >> _date_time_ is the problem. thank you :). |
From: Artyom <art...@ya...> - 2011-03-16 21:54:53
|
> >From: Pavel Kropitz <un...@fu...> >Subject: [Cppcms-users] booster::date_time parsing > > >hello Artyom, > > >first of all, great work ;). combination your framework together with mongodb >and graphicsmagick is amazingly _fast_ and pleasure to use. > > Thanks, I'm glad to hear. > >i have 2 questions about booster::date_time / timezone: > > >1) should parsing handle time before unix era (1970...)? example: > Yes, however you must use ICU backend. All other backends do not support date parsings. http://cppcms.sourceforge.net/boost_locale/html/using_localization_backends.html > >std::string tz = "Europe/Prague"; Note you can use this: http://cppcms.sourceforge.net/boost_locale/html/namespaceboost_1_1locale_1_1time__zone.html To set global time zone. Also you can set timezone independently on stream using as::time_zone manipulator. >booster::locale::calendar cal( context().locale(), tz ); >booster::locale::date_time dt( cal ); > > >std::stringstream ss; >ss.imbue( cal.get_locale() ); > > >ss << "1955-07-21 07:21:07"; // produce 1969-01-01 01:00:00 >//ss << "1985-07-21 07:21:07"; // works as expected > > >ss >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; >std::cout.imbue( cal.get_locale() ); >std::cout << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << >std::endl; > It seems that you need to update the ICU version. I've tested this code (actually boost not booster, but it is the same): #include <boost/locale.hpp> #include <iostream> int main() { std::locale::global(boost::locale::generator().generate("")); std::stringstream s; time_t d; s.str("1955-07-21 07:21:07"); s >> boost::locale::as::ftime("%Y-%m-%d %H:%M:%S") >> d; std::cout.imbue(std::locale()); std::cout << s.str() << std::endl; std::cout << boost::locale::as::ftime("%Y-%m-%d %H:%M:%S") << d << std::endl; } It hadn't work for icu 3.8 (gave a year 1970) but works without problems for icu-4.4 and 4.6, So it seems like ICU issue. (They have bugs as well :-( ) It is fairly simple to compile latest ICU version. > >booster::locale::date_time dt2( cal ); >dt2 -= 50 * booster::locale::period::year; // works as expected >// 1961-03-16 ... >std::cout << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt2 << >std::endl; > Note date_time object is just a number that is written to stream. See: http://cppcms.sourceforge.net/boost_locale/html/dates_times_timezones.html > >2) is there a way how to obtain all available timezones? currenty i use > icu::TimeZone::createEnumeration() directly. > Currently, there is no such option. Artyom P.S.: Note I use use in the code and documentation boost namespace but it is same code placed in booster namespace for CppCMS. The localization part is actually under review for inclusion in Boost. |
From: Pavel K. <un...@fu...> - 2011-03-16 20:01:25
|
hello Artyom, first of all, great work ;). combination your framework together with mongodb and graphicsmagick is amazingly _fast_ and pleasure to use. i have 2 questions about booster::date_time / timezone: 1) should parsing handle time before unix era (1970...)? example: std::string tz = "Europe/Prague"; booster::locale::calendar cal( context().locale(), tz ); booster::locale::date_time dt( cal ); std::stringstream ss; ss.imbue( cal.get_locale() ); ss << "1955-07-21 07:21:07"; // produce 1969-01-01 01:00:00 //ss << "1985-07-21 07:21:07"; // works as expected ss >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; std::cout.imbue( cal.get_locale() ); std::cout << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; booster::locale::date_time dt2( cal ); dt2 -= 50 * booster::locale::period::year; // works as expected // 1961-03-16 ... std::cout << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt2 << std::endl; 2) is there a way how to obtain all available timezones? currenty i use icu::TimeZone::createEnumeration() directly. pavel _ uni. |