Project

General

Profile

Actions

Support #324

closed

Building Hello World from Gentle Intro.

Added by Ted Smith about 15 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/04/2010
Due date:
% Done:

0%

Estimated time:

Description

Hi,

What is the correct way to build "Hello World" from listing 1 of:

A gentle introduction to the Wt C Toolkit for Web Applications.

This article is a tutorial distributed with Wt 3.1.1. The code is:

#include

#include

#include

int wmain(int argc, char **argv)

{

WApplication appl(argc, argv);

// Widgets can be added to a parent

// by calling addWidget() ...

appl.root()->addWidget(new Wtext(\"

Hello, World!

\"));

// ... or by specifying a parent at

// construction time

WPushButton *Button = new WPushButton("Quit", appl.root());

Button->clicked.connect(SLOT (&appl, Wapplication::quit));

return appl.exec();

}

I am confused by the lack of a definition for main() in the code.

A different but related question follows.

A different version of "Hello" is distributed in the examples of Wt 3.1.1.

It is hello.C. I won't include the listing, but it does include a

definition for main() (and no definition for wmain()).

I have successfully compiled this version with the command:

gcc -o hello.wthttp hello.C -I/usr/local/include -I/usr/local/include/Wt -L/usr/local/lib -lwt -lwthttp

It successfully runs on the wt-server with the command:

./hello.wthttp ---docroot . ---http-address 192.168.0.100 ---http-port 8080

However, my compilation fails when I change -lwthttp to -lfcgi and try to compile with

gcc -o hello.fcgi hello.C -I/usr/local/include -I/usr/local/include/Wt -L/usr/local/lib -lwt -lfcgi

This is an attempt to make a FastCGI executable.

But compilation fails because Wt::WRun() is not defined in -lfgci (in otherwords libfgci.so).

This makes some sense since WRun() launches the wt-server, while FastCGI wouldn't need such a launch.

What is the correct way to compile this code for FastCGI?

Thanks.

Actions #1

Updated by Wim Dumon about 15 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF