User forums > Using Code::Blocks

Making C::B compiling project list

(1/1)

PJani:
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


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

MortenMacFly:

--- Quote from: PJani on January 21, 2009, 12:07:56 am ---i get missing classes and other stuff...

--- End quote ---
This information is not very helpful. Post the exact errors or don't expect helpful answers.


--- Quote from: PJani on January 21, 2009, 12:07:56 am ---Do i have to write header files for each cpp module?

--- End quote ---
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.

PJani:
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:


--- End code ---

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...

Jenna:
It it as Martin wrote:


--- Quote from: MortenMacFly on January 21, 2009, 07:18:19 am ---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.

--- End quote ---

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 !

Navigation

[0] Message Index

Go to full version