Page 1 of 1

how do i have multiple classes?

Posted: Thu Dec 26, 2013 10:12 pm
by theatron
I've been using codelite for some days now, and now i'm trying to figure out how to add another class to my workspace :| , I've been trying by rebuilding the workspace a couple times and some other stuff and my new class still didn't come up in the "src" folder. So am i supposed to have a plugin or something just to add a new class to my project? Thanks.

Re: how do i have multiple classes?

Posted: Fri Dec 27, 2013 12:12 am
by eranif
When you create files on the file system - they won't appear in your workspace...
You need to add them:

Right click on a folder within your project (if you don't have a folder, right click on the project and select 'Add Virtual Folder')
and select "Add an existing file" - when the dialog pops-up - select the files you want to add

Or, you could create the classes within codelite: right click on any folder and select "New Class..." - this will open the "New Class" dialog

Eran

Re: how do i have multiple classes?

Posted: Sun Dec 29, 2013 3:33 am
by theatron
Im having a problem tring to include my other class into my main.cpp or in other words call functions from my different class from my main.cpp. When i put the class name and an instance and the first function(ex:

Code: Select all

diff df; df.main();
) it didnt work and i did add it to my project it and its header(.h) file is in my project. Codelite gives me the error "... was not declared in the scope". please help.

Re: how do i have multiple classes?

Posted: Sun Dec 29, 2013 11:58 am
by DavidGH
Hi,

You need to fix "not declared in this scope" errors in your own code in the normal C++ way: it means that you forgot to add a #include to that particular cpp file.

Perhaps you should do this by hand, just for practice ;) However CodeLite can help: right-click over the name of the class (do you really call it 'diff'?) and select the top item, 'Add Include File for "diff"', then follow the instructions.

Regards,

David