Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Strange C++ problem

This topic is 5323 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I was doing a regular programming,I tried to compile and he pointed to a problem in one of my headers files.I looked for hour trying to figure what''s the problem, but I couldn''t find it. code: -------------------------------------------------------------------------------- #ifndef __HARVESTER_H_INCLUDED__ #define __HARVESTER_H_INCLUDED__ #include "irrlicht.h" #include "Cmain.h" ISceneNode* harvesternode = 0; IAnimatedMesh* harvester = 0; void loadharvester() { harvester = smgr->getMesh("Data/hunter.3ds"); harvesternode = smgr->addAnimatedMeshSceneNode(harvester); if (harvesternode) { harvesternode->setMaterialFlag(EMF_LIGHTING, false); harvesternode->setPosition(vector3df(24100,798,-8205)); } }; #endif -------------------------------------------------------------------------------- Here is the error: c:\program files\irrlicht\the scout\harvester.h(7) : error C2146: syntax error : missing '';'' before identifier ''ISceneNode'' c:\program files\irrlicht\the scout\harvester.h(7) : fatal error C1004: unexpected end of file found Why do I need to put ";"? Thanks

Share this post

Link to post
Share on other sites
Your problem is not in that file. Look in CMain.h for a missing closing brace or missing semi-colon or something like that.


Share this post

Link to post
Share on other sites
Look at the end of your function, you have a ; at the end of the function definition... try removing that first.

If things seem bad, think that they can get a whole load worse, and they don''t seem so bad anymore


Share this post

Link to post
Share on other sites
Tried all you said, nothing goes.
Here is my Cmain:

#ifndef __CMAIN_H_INCLUDED__
#define __CMAIN_H_INCLUDED__

#include <irrlicht.h>
#include <wchar.h>
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <fstream.h>
#include <hejka.h>
#include <harvester.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

const wchar_t edit[2]=L"/";
const wchar_t inputedit=0;
const int key=0;
bool consoleon = false;
int fps;

IVideoDriver* driver;
ISceneManager* smgr;
IGUIEnvironment* guienv;
ICameraSceneNode* camera = 0;
IrrlichtDevice *dvc;
ISceneNode* skyboxnode=0;
IGUIWindow* console=0;
IGUIEditBox* consoleedit=0;
position2d mouseconsole(0,0);
s32 id;
ISceneNode* uk7node = 0;
IAnimatedMesh* uk7 = 0;
ISceneNode* firebirdnode = 0;
IAnimatedMesh* firebird = 0;

IGUIImage* mainm=0;
IGUIImage* newgamebutton=0;
IGUIImage* optionsbutton=0;
IGUIImage* missionsbutton=0;
IGUIImage* creditsbutton=0;
IGUIImage* quitbutton=0;


Share this post

Link to post
Share on other sites
Ok, it''s a guess: this worked once for me when I had a similar problem:

- create a new file
- write (not copy/paste) the code of "harvester.h" to that new file
- delete the old "harvester.h"
- rename your new file to "harvester.h"

Why this may work: It is possible that you got a command character into your textfile which is not recognized by your editor but which IS recognize by the compiler (that''s why you should NOT copy/paste). -> that would explain the second compiler error message.

Lord Jake

x = rx ( 1 - x ) ; r > 3.5699
... and chaos may begin ...

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!