Home  /  RSS  /  RSS Comments  /  Enter

First Beta Version of CppCMS is Out!

7/11/08, by artyom ; Posted in: Progress; 16 comments

First beta version is avalibile under LGPL 2.1 from SourceForge.

It includes:

Good Luck!

Comments

Tobias, at 7/16/08, 1:56 AM

Simply awesome, keep on the good work. This is just what I was looking for and thought about myself :)

Tobias, at 7/16/08, 2:00 AM

PS: Did you think about integrating CppCMS directly into Apache as a module, or try something like tntnet: http://www.tntnet.org/, thus using a http-server-library right directly with the application instead of CGI,FastCGI, etc.?

artyom, at 7/16/08, 7:27 AM

This is just what I was looking for and thought about myself :)

Thanks, you know, beta testers are more then welcome ;)

PS: Did you think about integrating CppCMS directly into Apache as a module, or try something like tntnet: http://www.tntnet.org/, thus using a http-server-library right directly with the application instead of CGI,FastCGI, etc.?

Actually I thought about creating something like "mod_socgi" -- a simple Apache module that would load a given shared object of an application and execute it.

Probably it even will be best to create a general shared object interface derived from CGI model in order to let any webserver load an application that uses this model.

Something like:

typedef int (*in_t)(void *session,void *,size_t);
typedef int (*out_t)(void *session, const void*,size_t);
int so_entry(void *session,int_t,out_t,char **envp);

When apache calls some entry of shared object giving typical cgi facilities like read function, write function and environment variables.

However, I just didn't get to it yet.

But I must admit that FastCGI/SCGI are very powerful and extremely fast interfaces allowing execution of the application by almost any web server. There are usually no performance disadvantages running apache_mod_xyz over running webserver_mod_fcgi + xyz_fcgi

Tobias, at 7/26/08, 8:25 PM

I have problems compiling it with all necessary libs installed and gcc/g++ 4.3.1 at Debian/testing:

make [...]
g++ -DHAVE_CONFIG_H -I. -I. -I. -Wall -g -O2 -MT libcppcms_la-global_config.lo -MD -MP -MF .deps/libcppcms_la-global_config.Tpo -c global_config.cpp  -fPIC -DPIC -o .libs/libcppcms_la-global_config.o
global_config.cpp: In member function 'void cppcms::cppcms_config::load(const char*)':
global_config.cpp:149: error: 'atol' was not declared in this scope
global_config.cpp:153: error: 'atof' was not declared in this scope
global_config.cpp: In member function 'void cppcms::cppcms_config::load(int, char**, const char*)':
global_config.cpp:200: error: 'getenv' was not declared in this scope

PS: Name, and Email are lost after using the Preview button.

Tobias , at 7/26/08, 8:40 PM

Well, I fixed this one by including cstdlib. But here comes the next:

g++ -DHAVE_CONFIG_H -I. -I. -I. -Wall -g -O2 -MT libcppcms_la-scgi.lo -MD -MP -MF .deps/libcppcms_la-scgi.Tpo -c scgi.cpp  -fPIC -DPIC -o .libs/libcppcms_la-scgi.o
In file included from cgi_api.h:3,
             from scgi.h:11,
             from scgi.cpp:1:
cgicc_connection.h:21: error: ISO C++ forbids declaration of 'auto_ptr' with no type
cgicc_connection.h:21: error: expected ';' before '<' token
cgicc_connection.h: In constructor 'cppcms::cgicc_connection_cgi::cgicc_connection_cgi()':
cgicc_connection.h:23: error: class 'cppcms::cgicc_connection_cgi' does not have any field named 'save_cgi'
cgicc_connection.h: In member function 'virtual cgicc::Cgicc& cppcms::cgicc_connection_cgi::cgi()':
cgicc_connection.h:30: error: 'save_cgi' was not declared in this scope
make[1]: *** [libcppcms_la-scgi.lo] Error 1
artyom, at 7/26/08, 8:46 PM

Ok,

global_config.cpp:149: error: 'atol' was not declared in this scope

It seems to be my bug:

  1. You can add a line in global_config.cpp: #include <stdlib.h>
  2. You can try to get a version from SVN (I had just fixed it)

Thanks for report, I never compiled with gcc 4.3 version.

PS: Name, and Email are lost after using the Preview button.

What browser do you use? Have you Java script enabled? Do you have some "developer tools" installed different addons?

Just checked, it seems to work.

Thanks for reports!

cgicc_connection.h:21: error: ISO C++ forbids declaration of 'auto_ptr' with no type

Ok I missed #include <memory> header... As I told, never compiled with 4.3

artyom, at 7/26/08, 8:48 PM

P.S.: I'd be glad if you try to report me all problems in order to fix them in next release

I still do not have much beta testers, both fixes commited to svn thanks!

Tobias, at 7/26/08, 9:14 PM

OK, the lost name and email issue is solved for me too. I didn't allow cookies for this blog, and with these two fixes cppcms compiles fines.

(Examples seem to compile fine too)

Tobias, at 7/26/08, 9:44 PM

More issues with compiling the template system:

trans_factory.cpp: In member function 'void transtext::trans_factory::load(const std::string&, const std::string&, const std::string&)':
trans_factory.cpp:23: error: 'strcpy' was not declared in this scope
trans_factory.cpp:27: error: 'strtok_r' was not declared in this scope

adding an include for string.h helps here

Further:

In file included from renderer.cpp:1:
renderer.h:45: warning: 'typedef' was ignored in this declaration
renderer.h:85: warning: 'typedef' was ignored in this declaration
renderer.h:197: error: multiple parameters named 'param'
renderer.h:217: error: 'std::tm' has not been declared

including ctime helps. Last issue:

renderer.h:198: error: multiple parameters named 'param'
renderer.cpp: In member function 'void tmpl::renderer::create_formated_string(const std::string&, std::string&, const int&)':
renderer.cpp:167: warning: comparison between signed and unsigned integer expressions
renderer.cpp: In member function 'bool tmpl::renderer::get_external_filter(boost::shared_ptr<tmpl::renderer::filter>&, uint16_t)':
renderer.cpp:480: warning: comparison between signed and unsigned integer expressions
renderer.cpp: In member function 'void tmpl::renderer::display(const boost::any&, std::string&, uint16_t, uint16_t)':
renderer.cpp:553: warning: comparison between signed and unsigned integer expressions

(error is in line 197 without that new include line)

artyom, at 7/26/08, 10:09 PM

Thanks a lot!

Ok, it seems that gcc-4.3 much more strict to the standard I really defined in headers duplicate "param" that shouldn't be (easy fix just remove them).

Commited fixes to SVN...

Tobias, at 7/26/08, 10:49 PM

Works, now hello_world_templates example compiles too.

But I think you still forgot to add "#include <string.h>" to transtext/trans_factory.cpp, which is required to compile with 4.3.

artyom, at 7/26/08, 10:56 PM

Thanks, fixed!

Tobias, at 7/27/08, 12:46 AM

I got a problem running the example message_board:

~/cppcms/examples/message_board$ ./bb.fcgi -c conf.txt 
Failed to load backend

with "process" I get 1 message, with "prefork" a message flood (as probably expected). I tried to grep the libdbi and cppcms source to find where this error comes from but I didn't succeed. Using gdb and interrupting I get the following bt (I hope this helps):

(gdb) Failed to load backend
bt
#0  0x00c17774 in fork () from /lib/tls/libc.so.6
#1  0x0024a712 in cppcms::details::prefork::execute (this=0x86b5248) at manager.cpp:403
#2  0x0024b32f in cppcms::manager::execute (this=0xbfffb5d8) at manager.cpp:506
#3  0x0804ef20 in main ()
artyom, at 7/27/08, 6:41 AM

Have you installed package: libdbd-sqlite3

Libdbi has different backends for working with databases. If it fails to load backend that it is just not installed.

With libdbi you can use different databases and load them on runtime: mysql, postgresql and so on (however this forum was written for sqlite3)

Tobias, at 7/29/08, 12:21 AM

Thanks, I missed that.

I'm just making my first steps with cppcms and trying to create models for the database layout.

If you are interested in db connection pooling you might want to check out: http://sqlrelay.sourceforge.net/

artyom, at 7/29/08, 7:21 AM

create models for the database layout.

I must admit, that in comparison to major frameworks like RoR, Django; At this point CppCMS missing ORM layer, however I still not convinced that it is mandatory feature.

Thanks for the link to sqlrelay. I must admit I missed it.

As I noticed in remarks on dbixx, it is yet another sql layer that can be used but it is not mandatory. IMHO it is useful due to nice syntax sugar. At some point I used SOCI, however I found libdbi more mature.

Anyway I can suggest you looking to the code of this blog (cms project in svn) that can give you some ideas what this framework can do. Meanwhile I'll continue writing reference documentation and tutorials. There are still many topics like: caching, framework API and so on.

I'll be glad for any feedback negative or positive you give.

Thanks.

Add Comment:

 
 the email would not displayed
 

You can write your messages using Markdown syntax.

You must enable JavaScript in order to post comments.

Pages

Categories