(C++) stat: No such file or directory. Document root ("") not valid.

January 25, 2018 · View on GitHub

 

 

 

 

 

(C++) WtQt CreatorUbuntu stat: No such file or directory. Document root ("") not valid.

 

misc error.

 

 

 

 

 

 

Full error message

 


stat: No such file or directory Document root ("") not valid.

 

 

 

 

 

Operating system(s) or programming environment(s)

 

IDE(s):

Project type:

  • console Console application

Compiler(s):

Libraries used:

  • Boost Boost: version 1.42
  • Qt Qt: version 4.7.0 (32 bit)
  • STL STL: GNU ISO C++ Library, version 4.4.5
  • Wt Wt: version 3.1.2

 

 

 

 

 

Project file

 


#------------------------------------------------- # # Project created by QtCreator 2010-11-18T12:10:20 # #------------------------------------------------- QT       += core QT       -= gui TARGET = CppHelloWtQtCreatorUbuntu LIBS += -L/usr/lib -lwt -lwthttp QMAKE_CXXFLAGS += -DNDEBUG CONFIG   += console CONFIG   -= app_bundle TEMPLATE = app SOURCES += main.cpp

 

 

 

 

 

Build log

 


Running build steps for project CppHelloWtQtCreatorUbuntu... Configuration unchanged, skipping qmake step. Starting: "/usr/bin/make" -w make: Entering directory `/home/richel/qtsdk-2010.04/bin/Projects/Website/CppHelloWtQtCreatorUbuntu-build-desktop' g++ -c -pipe -DNDEBUG -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../CppHelloWtQtCreatorUbuntu -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -I../CppHelloWtQtCreatorUbuntu -I. -o main.o ../CppHelloWtQtCreatorUbuntu/main.cpp g++ -o CppHelloWtQtCreatorUbuntu main.o -L/usr/lib -L/usr/lib -lwt -lwthttp -lQtCore -lpthread make: Leaving directory `/home/richel/qtsdk-2010.04/bin/Projects/Website/CppHelloWtQtCreatorUbuntu-build-desktop' The process "/usr/bin/make" exited normally.

 

 

 

 

 

Source code

 

This source was copied literally from the Wt website (http://www.webtoolkit.eu/wt\#/src/hello).

 


 

 

 

 

 

Process

 

In a terminal, I checked if stat was present:


stat

 

The following screen output convinced me it was:

 


stat: missing operand Try `stat --help' for more information. richel@richel1-desktop:~$

 

Obtaining the version of stat:

 


richel@richel1-desktop:~$ stat --version

 

Resulting in the following screen output, convincing me to have version 8.5 of stat:

 


 

Adding some linker flags, by adding the lines below to the project file, does not solve the problem:

 


QMAKE_LFLAGS += \   --docroot=. \   --http-server=0.0.0.0 \   --http-port=8080

 

 

 

 

 

Solution

 

The program needs to have arguments supplied. Add the following arguments to the Run Settings:

 


--docroot . --http-address 0.0.0.0 --http-port 8080