News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

main.cpp

Started by tm2383, September 23, 2009, 11:21:15 PM

Previous topic - Next topic

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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

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

oBFusCATed

What is your CB version?

Is there a ">" arrow next to the "Sources" item in the tree?
If yes click it. If no, open the *.cbp file with a text editor and try to find the "main.cpp" file.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

tm2383

Problem solved!!! I was clicking on the folder itself (which works on Windows) I didn't realise the '>' were clickable.

Thanks for the help,

Tim

Jenna

Works for me exactly the same way on vista and linux: doubleclick on folder-name or icon toggles it, single-click on the +/- (windows) or the triangle (linux) opens or closes it (depending on the state.
On w2k the double-click seems not to work.

zabzonk

> On w2k the double-click seems not to work.

Double-click works for me on W2K SP4, using CB build SVN 5678.