Hi
i trying to port my OpenGL / C++ / SDL project to VC++.NET.
Why do i get those errors. The code compiles under Linux without
problems. I beliebe to have set correctly
the include and lib dirs also the headers.
Those errors do NOT make any sense at all.
THANKS and regards
Michael
warning C4067: unexpected tokens following preprocessor directive -
expected a newline
fatal error C1070: mismatched #if/#endif pair in file 'f:\aura\src\wo rld.h'
warning C4067: unexpected tokens following preprocessor directive -
expected a newline
fatal error C1070: mismatched #if/#endif pair in file 'f:\aura\src\wo rld.h'
error C2144: syntax error : 'void' should be preceded by ';'
followed by thousand errors in gl.h 11 12478
On Thu, 27 Oct 2005 08:31:45 +0200, Michael Sgier <sg***@nospam.c h>
wrote: Hi i trying to port my OpenGL / C++ / SDL project to VC++.NET. Why do i get those errors. The code compiles under Linux without problems. I beliebe to have set correctly the include and lib dirs also the headers. Those errors do NOT make any sense at all. THANKS and regards Michael
warning C4067: unexpected tokens following preprocessor directive - expected a newline fatal error C1070: mismatched #if/#endif pair in file 'f:\aura\src\wo rld.h'
warning C4067: unexpected tokens following preprocessor directive - expected a newline fatal error C1070: mismatched #if/#endif pair in file 'f:\aura\src\wo rld.h' error C2144: syntax error : 'void' should be preceded by ';'
followed by thousand errors in gl.h
You are using something like:
#if defined(somethi ng)
#endif defined(somethi ng)
You *must* change that to:
#if defined(somethi ng)
#endif // defined(somethi ng)
Michael Sgier wrote: Hi i trying to port my OpenGL / C++ / SDL project to VC++.NET. Why do i get those errors. The code compiles under Linux without problems. I beliebe to have set correctly the include and lib dirs also the headers. Those errors do NOT make any sense at all. THANKS and regards Michael
warning C4067: unexpected tokens following preprocessor directive - expected a newline fatal error C1070: mismatched #if/#endif pair in file 'f:\aura\src\wo rld.h'
warning C4067: unexpected tokens following preprocessor directive - expected a newline fatal error C1070: mismatched #if/#endif pair in file 'f:\aura\src\wo rld.h' error C2144: syntax error : 'void' should be preceded by ';'
followed by thousand errors in gl.h
It would obviously help if you quoted the lines which cause the errors.
Is this so hard to do? Normally we see code without the error messages,
you've manged to do it the other way round.
I would guess that you have an error in the preprocessing directives in
the file mentioned, but without seeing the file it is difficult to
speculate what that might be.
john
Hello John
that's the whole file nothing cut out. I checked all files as world.h
is the last header file but still i couldn't find anything. Also i tried
to switch precomiling//precompiled headers on and off...no effect. I
copied those files to another working Ogl program ( without SDL ) and
got exactly the same errors....
THANKS
Michael
#ifndef __WORLD_H
#define __WORLD_H
//#include <dmusicc.h> // DirectMusic includes
//#include <dmusici.h>
//#include <d3d8types.h> // for D3DVECTOR
//#include <cguid.h> // for GUID_NULL
#include <typeinfo> // for RTTI
#include "gui.h"
#include "player.h"
#include "sod.h"
#include "ogro.h"
#include "entity.h"
#include "Md3.h"
#include "md2.h"
#include "object.h"
#include "camera.h"
#include "terrain.h"
//#include "audiosyste m.h"
#include "tree.h"
#define MAX_ENEMIES 10
class CWorld
{
private:
int numOgros, numSods;
int screenWidth, screenHeight;
bool gameDone;
protected:
void OnAnimate(float deltaTime);
void OnDraw(CCamera *camera, CTexture *tex);
void OnPrepare();
public:
//HWND hwnd;
CTerrain *terrain; // the terrain
CCamera *camera; // the camera
CPlayer *player;
//CPlayer *OnGetPlayer() { return player; }
// the player
//CAudioSystem *audioSystem; // the audio system
//CAudio *worldSound; // the world ambient sound
CGUI *gui;
COgroEnemy *ogroEnemy; // ogro enemies
CSodEnemy *sodEnemy; // sod enemies
float timeStart;
float timeElapsed;
CWorld();
CWorld(CCamera *c);
~CWorld();
// initialize terrain, load objects and put in container
void LoadWorld();
void UnloadWorld();
// int CountObjectType s(const type_info &classID);
// do physics calculations for all objects in the world
// including collisions
// void Animate(float deltaTime, CCamera* camera, CPlayer* player);
void Animate(float deltaTime);
// render all objects in the world
void Draw(CCamera *camera);
void Prepare() { OnPrepare(); }
int DrawCube();
void FadeScreen();
void SetScreen(int width, int height);
bool IsGameDone() { return gameDone; }
void QuitGame() { gameDone = true; }
int GetOgros() { return numOgros; }
int GetSods() { return numSods; }
};
#endif
Michael Sgier wrote: Hello John that's the whole file nothing cut out. I checked all files as world.h is the last header file but still i couldn't find anything. Also i tried to switch precomiling//precompiled headers on and off...no effect. I copied those files to another working Ogl program ( without SDL ) and got exactly the same errors.... THANKS Michael
#ifndef __WORLD_H
Avoid double underscores.
Ian
Nope that doesn't help. Still the same errors.
Michael Sgier wrote: Nope that doesn't help. Still the same errors.
Not that long ago, i had some problems with preprocessor too. In my
case, what solved the problem is the newline after header-guard #endif.
Other than that, there could be problems in the other files that you
include (VC doesn't always report the right filename), so you might
want to check them too.
Hello
Nope no help so far...It must be some sort of alignment. I tried devCPP
and thatone only stops at several #include xxx without any details to
the errors. Really strange and timeconsuming aargh.
THANKS for further tips.
Michael
Michael Sgier wrote: Hello John that's the whole file nothing cut out. I checked all files as world.h is the last header file but still i couldn't find anything. Also i tried to switch precomiling//precompiled headers on and off...no effect. I copied those files to another working Ogl program ( without SDL ) and got exactly the same errors.... THANKS Michael
#ifndef __WORLD_H #define __WORLD_H //#include <dmusicc.h> // DirectMusic includes
//#include <dmusici.h>
//#include <d3d8types.h> // for D3DVECTOR
//#include <cguid.h> // for GUID_NULL
#include <typeinfo> // for RTTI #include "gui.h"
#include "player.h"
#include "sod.h"
#include "ogro.h"
#include "entity.h"
#include "Md3.h" #include "md2.h" #include "object.h"
#include "camera.h"
#include "terrain.h"
//#include "audiosyste m.h"
#include "tree.h" #define MAX_ENEMIES 10 class CWorld
{
private:
int numOgros, numSods;
int screenWidth, screenHeight;
bool gameDone;
protected:
void OnAnimate(float deltaTime);
void OnDraw(CCamera *camera, CTexture *tex);
void OnPrepare(); public:
//HWND hwnd; CTerrain *terrain; // the terrain
CCamera *camera; // the camera
CPlayer *player; //CPlayer *OnGetPlayer() { return player; } // the player
//CAudioSystem *audioSystem; // the audio system
//CAudio *worldSound; // the world ambient sound
CGUI *gui; COgroEnemy *ogroEnemy; // ogro enemies
CSodEnemy *sodEnemy; // sod enemies float timeStart;
float timeElapsed; CWorld();
CWorld(CCamera *c);
~CWorld(); // initialize terrain, load objects and put in container
void LoadWorld();
void UnloadWorld(); // int CountObjectType s(const type_info &classID); // do physics calculations for all objects in the world
// including collisions
// void Animate(float deltaTime, CCamera* camera, CPlayer* player);
void Animate(float deltaTime);
// render all objects in the world
void Draw(CCamera *camera);
void Prepare() { OnPrepare(); } int DrawCube();
void FadeScreen();
void SetScreen(int width, int height); bool IsGameDone() { return gameDone; }
void QuitGame() { gameDone = true; }
int GetOgros() { return numOgros; }
int GetSods() { return numSods; }
};
#endif
This is a strange error. Notice there are no #if/#endif pairs in that file.
I would try removing code until the error goes away. Last bit of code
removed will be the one causing the error. Start with the CWorld class
and then try each of the #includes in turn. If removing an #include
solves the problem then it's probably something in that header.
john
John Harrison wrote: This is a strange error. Notice there are no #if/#endif pairs in that file.
I would try removing code until the error goes away. Last bit of code removed will be the one causing the error. Start with the CWorld class and then try each of the #includes in turn. If removing an #include solves the problem then it's probably something in that header.
Could be one of the other include files has a #if and no corresponding
#endif, so the compiler only spots the problem when it runs out of input
and still has an open #if.
Ian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tatu Portin |
last post by:
Have this kind of struct:
typedef struct {
char **user_comments;
/* ... */
} vorbis_comment;
/* prototype */
char * read_vorbis_string
( FILE *sc);
|
by: Anthony Gallagher |
last post by:
I have a bunch of libraries compiled using VC++ 6.0, and I am trying to
recompile one of our projects using VC++ .NET. I get all kind of linker
errors (specially in STL calls). How do I get rid of these errors??
Anthony
|
by: Hari |
last post by:
Guys please help me to solve this strange problem what Iam
getting as follows..
Trying to instantiate a global instance of a template
class as follows :-
when i build this code with debug and run this works fine.
but if build in unicode release or release this does't
work.
IS THERE ANY PROBLEM OF INSTANTIATING TEMPLATE CLASSES
|
by: vemulakiran |
last post by:
Hi all,
I have doubt regarding .NET.
I have a tool which was developed on VC++ 6.0(Win32 Application ).
The application communicates with library (API) which was developed on
VC++ 6.0 called core client.
I am planning to develop the tool or Win32 application on .NET
platform and I dont' want to migrate the VC++ library (API) to .NET.
The new .NET tool should use the previous VC++ library API ( core
client ).
Is there any possibility to...
|
by: |
last post by:
Everything seems to be moving to .NET and VC++ seems to be adding a lot of
managed code support every new release.
The questions: is unmanaged code in VC++ beeing phased out in favour of
managed code?
And suppose I still program in VC++ 6.0, can I safely assume that the code I
use in VC++ 6.0 will still be available in future VC++ versions.
Finally will VC++ 6.0 generated executables be still be able to run on futur
Windows versions and...
| |
by: ultranet |
last post by:
I have cruised around
http://msdn.microsoft.com/visualc/ and the rest of the site, and i am
not able to find a single C++ or VC++ certification exam that will be
available after June 30, 2004. I emailed support, and the reply was:
"We understand your concerns in this matter.
We would like to inform you that at this moment we do not have any plan or information if there will be replacements for the discontinued exams."
Does anybody...
|
by: Steve |
last post by:
We are considering the ways to migrate our VC++ 6.0 applications to .NET
platform.
It would be nice to rewrite them completely in C#, but due to the time
constraints
this option is out of question. We started from rewriting some dll in C# in
Visual
Studio .NET. Now we face chalenges of interoperation between old VC++ 6.0
apps and new .NET C# components. To solve this problem we considered the
following options:
|
by: um |
last post by:
When the POSIX pthreads library for w32 release 2-2-0
(http://sources.redhat.com/pthreads-win32/) is compiled with VC++6
then it compiles and passes all the benchmark tests in the subdirectory "tests".
Also, VC++ 2005 beta 1 compiles the tests fine, but here the following
tests fail in execution:
# semaphore1.pass \
# condvar2.pass \
# condvar2_1.pass \
# mutex8.pass \
|
by: Michael Tissington |
last post by:
I have a Visual Basic 6.0 ActiveX Control.
It seems there is no way with VS 2005 to create a similar control for
containers that host ActiverX controls, is this correct ?
I'm thinking of converting the VB 6 project to VC in VS 2005.
This seems to be a very different process.
Where is a good place to start?
|
by: Norman Diamond |
last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet
Framework 2. Options are set in the setup project properties, so if these
two dependencies are not already installed then this installer will install
them.
But what about the situation where VC runtime has already been installed?
In fact it's been installed twice. Although the project was built on a
Windows XP system with Visual Studio 2005 SP1 and the results were...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |