Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: PJani on January 21, 2009, 12:07:56 am

Title: Making C::B compiling project list
Post by: PJani on January 21, 2009, 12:07:56 am
Hy im having one problem i wrote this program with few cpp modules... i added thows cpp modules to project workspace and when i try to compile i get missing classes and other stuff...
this is all my file list
(http://www.shrani.si/f/3X/iA/2H6lcO1/project.jpg)

how do i include thows cpp-s in project i tried with #include but makes things "working & not working" any idea?
Do i have to write header files for each cpp module?

Thnx for help and your time
Title: Re: Making C::B compiling project list
Post by: MortenMacFly on January 21, 2009, 07:18:19 am
i get missing classes and other stuff...
This information is not very helpful. Post the exact errors or don't expect helpful answers.

Do i have to write header files for each cpp module?
That's the usual way, yes. You don't have to, but if you are using the classes in another file that a header file is the way to go. Take yourself a good programming book and read about this topic in more detail.
Title: Re: Making C::B compiling project list
Post by: PJani on January 21, 2009, 08:15:00 am
long way...

this is top part of main.cpp
Code
#include <Ogre.h>
#include <CEGUI/CEGUI.h>
#include <OIS/OIS.h>

#include <OgreCEGUIRenderer.h>
#include <Caelum/caelum.h>


#include <./simple_text.h>
//#include <./basic/textoverlay.h>
#include <stack>
#include <map>
using namespace Ogre;
////
//#include <./math/pj_math.cpp>
////

#include <./container/obj_container.cpp>
#include <./winsock/winsock_class.cpp>
#include <./collision/collision_detection.cpp>
#include <./controls/controls.cpp>
#include <./controls/debug.cpp>
#include <./controls/camera.cpp>

////
#include <./md5/md5.h>
#include <./md5/md5wrapper.h>

//#include <./base/display>


class ExitListener : public FrameListener{
public:


when i try to use classes from other topper sub files i get error files class not definited...but when i add in that sub #include whit proper class declaration i get error class redefinited...
example...
in ./controls/camera.cpp i need to include ./math/pj_math.cpp in which are proper clasess so camera.cpp can work
in ./collision/collision_detection.cpp i need to again include ./math/pj_math.cpp

but i get class redefinited

if i add
./math/pj_math.cpp include to main and i remove ./math/pj_math.cpp from thows sub files i get error class not def. in sub files...
Title: Re: Making C::B compiling project list
Post by: Jenna on January 21, 2009, 09:36:37 am
It it as Martin wrote:

That's the usual way, yes. You don't have to, but if you are using the classes in another file that a header file is the way to go. Take yourself a good programming book and read about this topic in more detail.

You seem to lack absolutely basic knowledge of C/C++.

This is not the right forum for you.

According to our forum rules, only C::VB related questions are allowed.

Therefore the topic gets locked !