Project

General

Profile

newbie: problem with compile examples on centos6.6 server

Added by Abolfazl Khorasani almost 10 years ago

Hi

Please comment on the issue:

[root@ns1 /]# cd /usr/lib64/Wt/examples/hello/

[root@ns1 hello]# g -o hello hello.C -I/usr/local/include -L/usr/local/lib -lwthttp -lwt -lboost_random -lboost_regex -lboost_signals -lboost_system -lboost_thread -lboost_filesystem -lboost_program_options -lboost_date_time

In file included from hello.C:7:

/usr/include/Wt/WApplication:22:25: error: boost/any.hpp: No such file or directory

/usr/include/Wt/WApplication:23:32: error: boost/shared_ptr.hpp: No such file or directory

In file included from /usr/include/Wt/WApplication:25,

from hello.C:7:

/usr/include/Wt/WObject:14:39: error: boost/signals/trackable.hpp: No such file or directory

In file included from /usr/include/Wt/WWidget:14,

from /usr/include/Wt/WWebWidget:14,

from /usr/include/Wt/WBreak:10,

from /usr/include/Wt/WCssStyleSheet:14,

from /usr/include/Wt/WApplication:26,

from hello.C:7:

/usr/include/Wt/WSignal:13:26: error: boost/bind.hpp: No such file or directory

/usr/include/Wt/WSignal:15:36: error: boost/intrusive/list.hpp: No such file or directory

/usr/include/Wt/WSignal:17:28: error: boost/signal.hpp: No such file or directory

/usr/include/Wt/WSignal:18:29: error: boost/utility.hpp: No such file or directory

In file included from /usr/include/Wt/WJavaScript:14,

from /usr/include/Wt/WWidget:15,

from /usr/include/Wt/WWebWidget:14,

from /usr/include/Wt/WBreak:10,

from /usr/include/Wt/WCssStyleSheet:14,

from /usr/include/Wt/WApplication:26,

from hello.C:7:

/usr/include/Wt/WLogger:11:34: error: boost/lexical_cast.hpp: No such file or directory

In file included from /usr/include/Wt/WCssDecorationStyle:13,

from /usr/include/Wt/WCssStyleSheet:15,

from /usr/include/Wt/WApplication:26,

from hello.C:7:

/usr/include/Wt/WLink:11:29: error: boost/variant.hpp: No such file or directory

In file included from hello.C:7:

/usr/include/Wt/WApplication:32:30: error: boost/function.hpp: No such file or directory

In file included from /usr/include/Wt/WObject:12,

from /usr/include/Wt/WApplication:25,

from hello.C:7:

/usr/include/Wt/Http/Request:83: error: invalid use of '::'

/usr/include/Wt/Http/Request:83: error: expected ';' before '<' token

In file included from /usr/include/Wt/WApplication:25,

from hello.C:7:

/usr/include/Wt/WObject:101: error: 'boost::signals' has not been declared

/usr/include/Wt/WObject:101: error: expected '{' before 'trackable'

/usr/include/Wt/WObject:102: error: invalid type in declaration before '{' token

/usr/include/Wt/WObject:103: error: expected primary-expression before 'public'

/usr/include/Wt/WObject:103: error: expected '}' before 'public'

/usr/include/Wt/WObject:103: error: expected ',' or ';' before 'public'

/usr/include/Wt/WObject:116: error: expected ')' before '*' token

/usr/include/Wt/WObject:124: error: declaration of '~Wt::WObject' as non-member

/usr/include/Wt/WObject:129: error: non-member function 'unsigned int Wt::rawUniqueId()' cannot have cv-qualifier

/usr/include/Wt/WObject: In function 'unsigned int Wt::rawUniqueId()':

/usr/include/Wt/WObject:129: error: 'id_' was not declared in this scope

/usr/include/Wt/WObject: At global scope:

/usr/include/Wt/WObject:130: error: non-member function 'const std::string Wt::uniqueId()' cannot have cv-qualifier

/usr/include/Wt/WObject:145: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:145: error: non-member function 'const std::string Wt::id()' cannot have cv-qualifier

/usr/include/Wt/WObject:168: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:168: error: non-member function 'std::string Wt::objectName()' cannot have cv-qualifier

/usr/include/Wt/WObject:287: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:291: error: non-member function 'const std::vector<Wt::WObject*, std::allocator<Wt::WObject*> >& Wt::children()' cannot have cv-qualifier

/usr/include/Wt/WObject:295: error: non-member function 'Wt::WObject* Wt::parent()' cannot have cv-qualifier

/usr/include/Wt/WObject: In function 'Wt::WObject* Wt::parent()':

/usr/include/Wt/WObject:295: error: 'parent_' was not declared in this scope

/usr/include/Wt/WObject: At global scope:

/usr/include/Wt/WObject:301: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:301: error: non-member function 'bool Wt::hasParent()' cannot have cv-qualifier

/usr/include/Wt/WObject:305: error: expected unqualified-id before 'protected'

/usr/include/Wt/WObject:317: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:328: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:329: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:342: error: 'virtual' outside class declaration

/usr/include/Wt/WObject:342: error: 'Method' was not declared in this scope

/usr/include/Wt/WObject:344: error: expected unqualified-id before 'private'

/usr/include/Wt/WObject:346: error: 'Method' was not declared in this scope

/usr/include/Wt/WObject:346: error: expected primary-expression before 'const'

/usr/include/Wt/WObject:346: error: initializer expression list treated as compound expression

/usr/include/Wt/WObject:347: error: 'Method' was not declared in this scope

/usr/include/Wt/WObject:348: error: variable or field 'resetLearnedSlot' declared void

/usr/include/Wt/WObject:348: error: 'Method' was not declared in this scope

/usr/include/Wt/WObject:350: error: 'Method' was not declared in this scope

/usr/include/Wt/WObject:353: error: expected unqualified-id before 'const'

/usr/include/Wt/WObject:353: error: expected ')' before 'const'

/usr/include/Wt/WObject:369: error: 'friend' used outside of class

/usr/include/Wt/WObject:371: error: 'friend' used outside of class

/usr/include/Wt/WObject:374: error: 'friend' used outside of class

/usr/include/Wt/WObject:375: error: 'friend' used outside of class

/usr/include/Wt/WObject:379: error: 'WObject' has not been declared

/usr/include/Wt/WObject: In function 'void resetLearnedSlot(void (T::*)())':

/usr/include/Wt/WObject:381: error: invalid use of 'this' in non-member function

/usr/include/Wt/WObject:382: error: expected type-specifier before 'Method'

/usr/include/Wt/WObject:382: error: expected '>' before 'Method'

/usr/include/Wt/WObject:382: error: expected '(' before 'Method'

/usr/include/Wt/WObject:382: error: 'Method' was not declared in this scope

/usr/include/Wt/WObject: At global scope:

/usr/include/Wt/WObject:387: error: expected constructor, destructor, or type conversion before '*' token

/usr/include/Wt/WObject:394: error: expected constructor, destructor, or type conversion before '*' token

/usr/include/Wt/WObject:404: error: expected constructor, destructor, or type conversion before '*' token

/usr/include/Wt/WObject:411: error: expected declaration before '}' token

[root@ns1 hello]#


Replies (15)

RE: newbie: problem with compile examples on centos6.6 server - Added by Wim Dumon almost 10 years ago

Did you install the boost header files? On ubuntu these are usually packed in packages with -dev in the name, I don't know on centos.

Wim.

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

most of packages with -dev in the name (for centos6.6 it is -devel) have installed.

but the "boost" can not be found in files and directories !

[root@ns1 /]# find -name boost

[root@ns1 /]#

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

[root@ns1 /]# yum install boost

Loaded plugins: fastestmirror, security

Setting up Install Process

Loading mirror speeds from cached hostfile

  • base: centos.datente.com
  • epel: mirrors.n-ix.net
  • extras: mirror.softaculous.com
  • updates: centos.datente.com
    Package boost-1.41.0-27.el6.x86_64 already installed and latest version
    Nothing to do
    [root@ns1 /]#

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

yum install boost-devel

solved no boost problem

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

[root@ns1 hello]# g -o hello hello.C -I/usr/local/include -L/usr/local/lib -lwthttp -lwt -lboost_random -lboost_regex -lboost_signals -lboost_system -lboost_thread -lboost_filesystem -lboost_program_options -lboost_date_time

/usr/bin/ld: cannot find -lboost_random

collect2: ld returned 1 exit status

[root@ns1 hello]#

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

the

g -o hello hello.C -I/usr/local/include -L/usr/local/lib -lwthttp -lwt

has no output of hello.wt !?

[root@ns1 hello]# ls

CMakeLists.txt hello hello.C hello-original.wt README.md resources

[root@ns1 hello]# g -o hello hello.C -I/usr/local/include -L/usr/local/lib -lwthttp -lwt

[root@ns1 hello]# ls

CMakeLists.txt hello hello.C hello-original.wt README.md resources

[root@ns1 hello]#

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

[root@ns1 hello]# ls -l

total 140

-rw-r---r--- 1 root root 673 Oct 16 2010 CMakeLists.txt

-rwxr-xr-x 1 root root 95229 Aug 8 17:27 hello

-rw-r---r--- 1 root root 3093 Dec 6 2011 hello.C

-rwxr-xr-x 1 root root 32176 Sep 14 2012 hello-original.wt

-rw-r---r--- 1 root root 391 Feb 17 2012 README.md

lrwxrwxrwx 1 root root 23 Aug 7 19:46 resources -> /usr/share/Wt/resources

[root@ns1 hello]# ./hello ---docroot . ---http-address 0.0.0.0 ---http-port 9090

[2015-Aug-08 17:43:28.371826] 11116 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = './hello')"

[2015-Aug-08 17:43:28.372367] 11116 - [info] "WServer/wthttp: initializing built-in wthttpd"

[2015-Aug-08 17:43:28.372601] 11116 - [info] "wthttp: started server: http://0.0.0.0:9090"

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

hello binary file (without .wt extension) is successfully built.

according to http://www.webtoolkit.eu/wt/doc/tutorial/wt.html

the ./hello ---docroot . ---http-address 0.0.0.0 ---http-port 9090

has output

[2015-Aug-08 17:43:28.371826] 11116 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = './hello')"

[2015-Aug-08 17:43:28.372367] 11116 - [info] "WServer/wthttp: initializing built-in wthttpd"

[2015-Aug-08 17:43:28.372601] 11116 - [info] "wthttp: started server: http://0.0.0.0:9090"

where can I (lunch or) see the lunched hello application?

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

who to lunge or run the hello web application?

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

[root@ns1 hello]# ./hello ---docroot . ---http-address the.server.ip.address ---http-port 9090

[2015-Aug-08 17:57:16.820872] 11426 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = './hello')"

[2015-Aug-08 17:57:16.821418] 11426 - [info] "WServer/wthttp: initializing built-in wthttpd"

[2015-Aug-08 17:57:16.821651] 11426 - [info] "wthttp: started server: http://the.server.ip.address:9090"

It seems that I should open port manually on server !?

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

finally it is running.

but how can it be used within websites with port 80 ?

RE: newbie: problem with compile examples on centos6.6 server - Added by Wim Dumon almost 10 years ago

Either use a reverse proxy, or start your Wt application with ---port 80. Note that on Linux, you have to be root to listen on port < 1024.

Best regards,

Wim.

RE: newbie: problem with compile examples on centos6.6 server - Added by Abolfazl Khorasani almost 10 years ago

thanks for comment

is there a step-by-step guide to config and run a wt example application on linux / centos server with public access such as www.webtoolkit.eu ?

    (1-15/15)