Adding files to a project

General questions regarding the usage of CodeLite
fobits
CodeLite Curious
Posts: 1
Joined: Mon Nov 12, 2012 3:25 am
Genuine User: Yes
IDE Question: C++
Contact:

Adding files to a project

Post by fobits »

This may take the prize for the dumbest question ever asked here, but I hope that someone will take pity on a confused hobbyist...

After creating a new workspace and project, how do you add existing .cpp, .h and .rc files to it? There is nothing in the on-line tutorial about it and I don't see the option anywhere.

I have an old program compiled with MinGW and Dev-C++ which I want to revise a bit. Dev-C++ doesn't work with the newer versions of MinGW, so I installed Codelite... but can't even get my sourcecode files into it. :cry:
nicenick
CodeLite Curious
Posts: 1
Joined: Mon Nov 12, 2012 4:50 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding files to a project

Post by nicenick »

I am a rookie to programming and I have the similar problem:How to add existing .h to it

Besides,I wrote a small simple program like "hello,world" under an existing workspace and an existing project,and failed to build and run it.

Do I have to create a new workspace or just a new project to make this right? Apparently new file is not enough.

Sorry to start another question in your thread.I couldn't find any help in any website in my language about Codelite. So I came here.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding files to a project

Post by eranif »

fobits wrote:After creating a new workspace and project, how do you add existing .cpp, .h and .rc files to it? There is nothing in the on-line tutorial about it and I don't see the option anywhere.
Files can be added to virtual folders only and not directly to a project

Your tree should look something like this:

Code: Select all

Workspace 
    |------project
                 |--- Folder
                 |----Folder2
 
To add a "Folder" - right click on the project and select "New Virtual Folder". Now right clicking on the virtual folder will give you menu with entries like "Add new file", "Add an existing file" etc.
Virtual folders does not really exists on the disk, they are entities that allows you to organize your code, usually people create folders named "src" and one named "include" etc

If you create console project of type "Simple executable (g++)" (from the main menu: workspace -> new project) it will create by default the following layout for you:

Code: Select all

Workspace 
    |------project
                 |--- src
                         |--- main.cpp
 
@nicenick:
Besides,I wrote a small simple program like "hello,world" under an existing workspace and an existing project,and failed to build and run it.
Create a "Simple executable (g++)" (from the main menu: workspace -> new project), open teh main.cpp file and replace its content with your
Hit F7 ...
Eran
Make sure you have read the HOW TO POST thread
Post Reply