I have been using Codeblocks, but I think I need to better understand what the "project" concept is all about.

My original assumption was that it was a group of source, header and object files that pertained to a particular project.

I'm discovering, however, that the IDE doesn't like more than ONE object file in a directory. The first one compiled is the perminent default, not to mention compiler complaints when I attempt to compile a second file. Even if I select the file every way possible, the co-existance doen't seem possible.

How do I collect a bunch of small unrelated source and object files in an IDE directory, such that I can compile, run, and debug them independently?

Does the 'project" only alow one executable and the rest must be header files? :confused:

Recommended Answers

All 5 Replies

Hmm.. never ever encountered such a problem, but just to make one thing sure..

Are you right clicking on the project in the project window to your left and selecting "set as active project" to the project which you are working on ?

No, I didn't. I'll try that.
The system seems to "know" what project it's in, but the files within confuse the compiler and debugger. It spews out a message that main() was already defined in the other file and won't compile the new one within that source didrectory!

Just wanted to let you know that you cant have more than one int main( ) function in your project.

And also try out the thing about right clicking on the project view. One of these two can most likely help you out.

That's what I thought was the problem. OK then, what is the advantage of a "project"?. Is that you can compile a bunch of headers with the push of a button? I found that as long as the headers are in the the same directory (external to the IDE) the compiler will find them anyway.

Like I said said, I don't understand how a "project" is used in the real world.
Could you tell me what a typical file "lineup" found in a project might be? Ie; just one *.cpp and any number of *.hpp's?

They are useful to organize large projects, often with over 100 files. It is easy to have them all in one organized list rather than scattered all over the folder.

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.