Thursday, 15 August 2013

c++11 - C++ Cannot find Include -


In the main.cpp I get the error saying that print was not defined (and other types of errors.

I have been defined as print () which is under the header file named "Miscellaneous"

misc # include & lt; iostream & gt; # include & lt; cstdlib & gt; # include & lt; fstream & gt; # defined MISC_H #ifndef MISC_H zero print (string str) {Cout & lt;

then main.cpp in #include Headers / misc.h " (The header file is located in a separate folder)

Is something wrong I On not?

Without knowing the compile commands that I see, what is wrong is wrong.

The first order #define MISC_H will cause the macro to start existing. After that, when you call #ifndef MISC_H it will always be false, because you have defined it now, the effect is that the source of this file is always discarded .

You need to look at these lines like this:

  #ifndef MISC_H # MISC_H Define  

No comments:

Post a Comment