User forums > Help

main.cpp

(1/2) > >>

tm2383:
Hi,
I am fairly new to C++ programming and have just installed Code::Blocks on my computer running Ubuntu Linux 9.04. When I start a new project, I assumed that when I clicked on the source folder on the tree at the left hand side of Code::Blocks, main would appear, which I could then click on to open, but this is not the case. The source folder appears to be totally empty. Is this meant to be the case and if so, how do I create a main file?

Thanks,
Tim
   

oBFusCATed:
What kind of project have you made?
Do you click on the checkbox -> empty project?

tm2383:
Sorry, should have said!  It was a console application.

Thanks,
tim

zabzonk:
If yous start CB and do:

File|New|Project..

then select:

Console application

then hit Go, and select C++ and then Next, you should get the Console application dialog. This is very far from being a great example of the GUI designer's art, but if you enter "xxx" (no spaces or anything ambitious) in the Project Title field (it of course is not the title, but the name) ,  and then hit Next, it should create a project and main file for you somewhere - exactly where is spelled out in the "Resulting filename" field.

This dialog drives me nuts every time I use it, but it does always create a main.cpp somewhere, at least on my Windows version of CB - I don't use CB on Linux.



tm2383:
Hi,
Thanks for the reply. If I navigate to the folder containing the new project,  I see the main.cpp file, but can't seem to add it to the codeblocks tree. When using Codeblocks on Windows, when I click the source folder folder on the menu tree, main drops down, which can then be clicked on to open it.

tim
 

Navigation

[0] Message Index

[#] Next page

Go to full version