1.) I am about to run to class and work for the day so I wanted to get this up before I left.

2.) I am using code blocks on Windows.

3.) I ma having an issue where either my main.cpp cannot find my header file, or if I change the directory of all files I no longer seem to have the std library because things like cout and endl are not defined.

4.) Does anyone use code blocks that has tips? I am just trying to get a simple program with 2 classes, one inheriting from the other but before I can even really get going this directory stuff is killing me.

[IMG]http://cl.ly/2r1t3G1419183W3E093I/Image%202012-01-25%20at%209.46.57%20AM.png[/IMG]

Recommended Answers

All 4 Replies

have you included iostream?

are you inheriting the header correctly?
#include "header.h"

another thing to keep in mind is your .cpp will inherit everything from your header including the libraries your including

edit: just looked at the screen shot you posted, as long as iostream was included in your header file all should be ok, if not it might need a code blocks specific fix... all else fails get yourself a copy of vs2010 :)

Ok thanks for the help so far, now I have a different probably simple issue.
It cannot find the header files..It cannot find the file or directory..
I have googled around trying to change the scope of where the program looks but to no avail. I really like code blocks but just getting out of the gate is rough. The header by default I read on some other places isn't placed correctly to be looked for?

Problem --- >
http://cl.ly/1D1e3M220e0o1r0j3k23/Image%202012-01-29%20at%206.51.22%20PM.png

Edit: I seemed to have just fixed it temporarily by setting the exact path to the folder, something I was unable to do from the folder browser. ;/

The way I see it, you should not change the dirs, just include the files properly.

The #include <> directive includes files from the compilers include path.
The #include "" directive includes files from the local folder.

I hope this clears things up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.