Author Topic: Making C::B compiling project list  (Read 4621 times)

Offline PJani

  • Single posting newcomer
  • *
  • Posts: 8
Making C::B compiling project list
« 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


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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Making C::B compiling project list
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline PJani

  • Single posting newcomer
  • *
  • Posts: 8
Re: Making C::B compiling project list
« Reply #2 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...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Making C::B compiling project list
« Reply #3 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 !