Trouble With Documentation Pipeline on Hello World
Added by Puck Norris over 10 years ago
Thanks for your time and for providing something so focused on web efficiency. We're out there! :)
I'm having a lot of frustration with the initial setup for wt on Debian using apt-get to grab the libraries. The process I'm trying to follow is:
(From a fresh install of Debian on VPS)
su
apt-get install nginx libfcgi-dev spawn-fcgi
---- configure to run fcgi by listening on port 80 ----
apt-get install witty witty-dbg witty-dev witty-doc
nano hello_witty.cpp
---- Write contents to file from http://www.webtoolkit.eu/wt/src/hello?wtd=Y0apaD1u3qSqJ7k0Jb2tOwKop6KPa8v6 ----
nginx -c /path/to/nginx.conf
g hello_witty.cpp -lfcgi -lfcgi -o hello_witty
---- AT THIS POINT I'M STOPPED BY ERRORS. Would continue like this: ----
spawn-fcgi -p 8000 -n /path/to/hello_witty
I'm happy to post any of the configs/logs/code from the above, I just wanted to ask if I'm doing all the commands properly before I go throwing a thousand details your way.
Much appreciated for your attention.
Replies (10)
RE: Trouble With Documentation Pipeline on Hello World - Added by Wim Dumon over 10 years ago
Your g command is clearly lacking the wt libraries: add -lwt
, -lwtfcgi
.
Other than that, you may have to add paths to include/library files (though I don't think this will be required on debian).
Know that using the built-in http server is easier to get to work than using an fcgi configuration for a webserver.
Wim.
RE: Trouble With Documentation Pipeline on Hello World - Added by Puck Norris over 10 years ago
I'm getting "cannot find -lwtfcgi" so I think you may indeed be right that I need to specify the include path. I am new to C compiling on Linux (though not to C) and wondering if you can point me in the right direction to make that happen if that does seem to be what's going on?
The new command executed was:
@g hello_witty.cpp -lfcgi -lfcgi -lwt -lwtfcgi -o witty_obj
Thanks again.
RE: Trouble With Documentation Pipeline on Hello World - Added by Koen Deforche over 10 years ago
This seams a reasonable explanation: http://courses.cs.washington.edu/courses/cse373/99au/unix/g.html
But you will want to learn how to interpret the error messages as you need to distinguish between compile errors and linking errors.
Alternatively you can do the compilation separately from the linking:
g -o hello_witty.o -c hello_witty.c #compilation
g -o witty_obj hello_witty.o -lfcgi -lfcgi -lwtfcgi -lwt -o witty_obj #linking
If you get 'cannot find wtfcgi' then you need to find for the location of 'libwtfcgi.*' on your system, and add -L/that/dir to the link command.
RE: Trouble With Documentation Pipeline on Hello World - Added by Puck Norris over 10 years ago
I've done sudo find / -name libwtfcgi
but it finds nothing, but when I do apt-get install witty witty-dbg witty-dev witty-doc
it says everything is up to date.
Help?
RE: Trouble With Documentation Pipeline on Hello World - Added by Koen Deforche over 10 years ago
sudo find / -name "libwtfcgi*" should pick up the correct file?
RE: Trouble With Documentation Pipeline on Hello World - Added by Puck Norris over 10 years ago
It found one instance called:
/usr/lib/debug/usr/lib/libwtfcgi.so.3.3.0
I tried compiling with -L/usr/lib/debug/usr/lib/ with no success
I then tried moving a copy of libwtfcgi.so.3.3.0
to /home/me/sandbox/cpp/lib and compiling with:
g++ hello_witty.cpp -lfcgi++ -lfcgi -lwt -lwtfcgi -o witty_obj -L/home/me/sandbox/cpp/lib
No effect. Witty still fails to compile because that library cannot be found.
Thoughts?
RE: Trouble With Documentation Pipeline on Hello World - Added by Koen Deforche over 10 years ago
/usr/lib/debug/usr/lib/libwtfcgi.so.3.3.0 is a library used by an executable that is already linked.
For development, you also need a file (which is usually a symlink):
/usr/lib/debug/usr/lib/libwtfcgi.so
This file is being searched by the linker when you specify -lwtfcgi.
Regards,
koen
RE: Trouble With Documentation Pipeline on Hello World - Added by Puck Norris over 10 years ago
After doing sudo ln -s /usr/lib/debug/usr/lib/libwtfcgi.so.3.3.0 /usr/lib/debug/usr/lib/libwtfcgi.so
AND appending -L/usr/lib/debug/usr/lib/
to the compilation arguments I now get this:
me
me-VirtualBox:~/sandbox/cpp$ g hello_witty.cpp -lwt -lwtfcgi -o witty_obj -L/usr/lib/debug/usr/lib/
In file included from /usr/include/Wt/WSignal:17:0,
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_witty.cpp:7:
/usr/include/boost/signal.hpp:17:4: warning: #warning "Boost.Signals is no longer being maintained and is now deprecated. Please switch to Boost.Signals2. To disable this warning message, define BOOST_SIGNALS_NO_DEPRECATION_WARNING." [-Wcpp]
# warning "Boost.Signals is no longer being maintained and is now deprecated. Please switch to Boost.Signals2. To disable this warning message, define BOOST_SIGNALS_NO_DEPRECATION_WARNING."
^
/usr/bin/ld: /tmp/ccX5lvgp.o: undefined reference to symbol '_ZN5boost7signals6detail9slot_base17create_connectionEv'
//usr/lib/x86_64-linux-gnu/libboost_signals.so.1.54.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status@
RE: Trouble With Documentation Pipeline on Hello World - Added by Puck Norris over 10 years ago
Any ideas? I don't think this is a stupid question?...
RE: Trouble With Documentation Pipeline on Hello World - Added by Wim Dumon over 10 years ago
It seems that you don't link to the boost signals library. Add the boost signals library (-lboostsignals, but the name depends on your boost installation) to your compilation command line.
Best regards,
Wim.