Chris Columbus Chris Columbus -4 years ago 68
C++ Question

Why windows g++ doesn't find external header files

My filename :

firstnana.cpp


Current Folder :
D:\projects\cpp\guinana


My headers :

#include <nana/gui.hpp>
#include <nana/gui/widgets/label.hpp>
#include <nana/gui/widgets/button.hpp>


Compiling :

g++ firstnana.cpp -I./nana/include/nana


Example :
The
<nana/gui.hpp>
is located in
D:\projects\cpp\guinana\nana\include\nana\gui.hpp


The output Error :
firstnana.cpp:1:24: fatal error: nana/gui.hpp: No such file or directory
compilation terminated.

Answer Source

you already have "nana" directory in your -I parameter. Don't repeat it in the includes.

#include <gui.hpp>
#include <gui/widgets/label.hpp>
#include <gui/widgets/button.hpp>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download