fatal error: 'Wt/WApplication' file not found
Added by gokhan rod over 10 years ago
Hi,
I am completely new in the world of Wt, git, brew,..
I believe I have correctly installed all the dependencies and wt itself correctly.
But when I try to run the first example "Hello.cc" by entering the command:
"g -o hello hello.cc -lwthttp -lwt"
I am getting this error:
"hello.cc:1:10: fatal error: 'Wt/WApplication' file not found"
I understand what the proemial is, it can not find the link in the first line"#include "
With my limited OS X knowledge, when I go into the wt folder "OSX/Users/MYUSERNAME/wt" there is a file named "WApplication"
To give some details, I have created the "hello.cc" in a folder located on the desktop,
with my miniorior knowledge, the browser does not display anything when I try http://localhost:8080
I have OSx 10.10.5
Do you think the wt install is not complete? Or am I not running the fist code wrongly?
Replies (3)
RE: fatal error: 'Wt/WApplication' file not found - Added by Stefan Arndt over 10 years ago
Hi,
you are probably missing the include path - the compiler does not know where to find the Wt header files.
I doubt that your "OSX/Users/MYUSERNAME/wt" is in the compilers include path, but you can check it using the info given here:
http://stackoverflow.com/questions/11946294/dump-include-paths-from-g
You may have something like:
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/x86_64-unknown-linux-gnu
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/backward
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include
/usr/local/include
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include-fixed
/usr/include
End of search list
In case any header files you need are not within the standard search path, you will have to tell the compiler where to find those. You can do this by using "-Ipath".
If you use "#include <ABC/Header.h>" in your source, you might have to tell the compiler where to find the folder ABC using:
"g source.cpp -I"
Not sure about Mac, but this might work for you:
"g -o hello hello.cc -I/OSX/Users/MYUSERNAME" -lwthttp -lwt\"
(All this is very basic stuff. You might want to read about header files and include pathes in general, before diving deeper.)
Hope this helps :)
Stefan
RE: fatal error: 'Wt/WApplication' file not found - Added by Stefan Arndt over 10 years ago
Oh, and of course this is a compiler error. Hence the compilation fails and you do not get any binary to start and reply to your request at localhost:8080...
RE: fatal error: 'Wt/WApplication' file not found - Added by gokhan rod over 10 years ago
Thank you!
The issue is solved :)