how do i have multiple classes?
-
- CodeLite Enthusiast
- Posts: 11
- Joined: Thu Dec 26, 2013 10:00 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
how do i have multiple classes?
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.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: how do i have multiple classes?
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
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
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 11
- Joined: Thu Dec 26, 2013 10:00 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: how do i have multiple classes?
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: ) 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.
Code: Select all
diff df; df.main();
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: how do i have multiple classes?
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
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