General Question Errors while compiling for 2010-P1

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
10,550
Reaction score
4,375
Points
203
Location
Dallas, TX
I have visual C++ 2008 express edition. I set the directories for the sdk
but when I try to compile I get these errors:
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(3526) : error C2146: syntax error : missing ';' before identifier 'GetDevMesh'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(3526) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(3526) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(3526) : warning C4183: 'GetDevMesh': missing return type; assumed to be a member function returning 'int'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(3805) : error C2061: syntax error : identifier 'ANIMATION'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4511) : error C2061: syntax error : identifier 'EXHAUSTSPEC'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4549) : error C2061: syntax error : identifier 'EXHAUSTSPEC'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4797) : error C2143: syntax error : missing ';' before '*'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4797) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4797) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4797) : warning C4183: 'AddPointLight': missing return type; assumed to be a member function returning 'int'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4817) : error C2143: syntax error : missing ';' before '*'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4817) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4817) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4817) : warning C4183: 'AddSpotLight': missing return type; assumed to be a member function returning 'int'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4833) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4833) : error C2143: syntax error : missing ';' before '*'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4833) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4833) : warning C4183: 'GetLightEmitter': missing return type; assumed to be a member function returning 'int'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(4844) : error C2061: syntax error : identifier 'LightEmitter'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5714) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5729) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5748) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5769) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5793) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5793) : error C2535: 'int VESSEL3::RegisterPanelArea(void)' : member function already defined or declared
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5769) : see declaration of 'VESSEL3::RegisterPanelArea'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5863) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5915) : error C2653: 'oapi' : is not a class or namespace name
C:\orbiter2010p1\Orbitersdk\include\VesselAPI.h(5915) : error C2061: syntax error : identifier 'Sketchpad'
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(330) : error C2653: 'oapi' : is not a class or namespace name
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(330) : error C2061: syntax error : identifier 'Sketchpad'
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(341) : error C2653: 'oapi' : is not a class or namespace name
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(341) : error C2061: syntax error : identifier 'Sketchpad'
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(367) : error C2653: 'oapi' : is not a class or namespace name
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(367) : error C2143: syntax error : missing ';' before '*'
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(367) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(367) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(367) : warning C4183: 'GetDefaultPen': missing return type; assumed to be a member function returning 'int'
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(384) : error C2653: 'oapi' : is not a class or namespace name
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(384) : error C2143: syntax error : missing ';' before '*'
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(384) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(384) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\orbiter2010p1\Orbitersdk\include\MFDAPI.h(384) : warning C4183: 'GetDefaultFont': missing return type; assumed to be a member function returning 'int'
.\MOONBASEALPHA1.cpp(116) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
.\MOONBASEALPHA1.cpp(3447) : warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data
Build log was saved at "file://c:\ORBITER2010P1\Orbitersdk\samples\MOONBASEALPHA1\Release\BuildLog.htm"
MOONBASEALPHA1 - 37 error(s), 8 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
What other files you have? Do you have a .h? And by setting the directories you did the includes and libraries, right?
 
Last edited:
additional librarys:C:\orbiter2010p1\Orbitersdk\include;"C:\Program Files\Microsoft Platform SDK\Include"
Linker
additional Libray directories:"C:\Program Files\Microsoft Platform SDK\Lib";C:\Orbiter2010p1\Orbitersdk\lib

which includes?
 
It looks like you did:
Code:
#include VesselAPI.h
when you need to only this line:
Code:
#include Orbitersdk.h
 
This is the first of the cpp
Code:
// ==============================================================
//                 ORBITER MODULE: MOONBASEALPHA1
//                  Part of the ORBITER SDK
//          Copyright (C) 2002-2004 Martin Schweiger
//                   All rights reserved
//
// MOONBASEALPHA1.cpp
// Control module for MOONBASEALPHA1 vessel class
//

// ==============================================================
#define STRICT
#define ORBITER_MODULE
#define DOORCLOSE                1    
#define AIRLOCKCLOSE             2    
#define ELEVATOR                 3
#define RAIL             4    
#define CRANE                 5

#include "orbitersdk.h"
#include "MOONBASEALPHA1A.h"
#include "MOONBASEMESH1.h"
#include "OrbiterSoundSDK35.h"
#include "ColorNames.h"
VISHANDLE MainExternalMeshVisual = 0;
 
What #includes do you have in these?
  • MOONBASEALPHA1A.h
  • MOONBASEMESH1.h
 
#ifndef __MOONBASEALPHA1_H
#define __MOONBASEALPHA1_H

#include "resource.h"


#include "orbitersdk.h"
#include "UMmuSDK.h"

in the .h
none in the moonbasemesh
 
One sure way to track down difficult syntax/typo errors buried somewhere in the code is to:

1. Simplify the code by commenting out larger and larger blocks of it using '#if 0 / #endif' until it compiles again.
2. Then gradually start reducing the amount of commented-out code by shrinking/removing some '#if 0 / #endif' block(s) and seeing if it still compiles cleanly.
3. Repeat step 2 until the compile fails again with the same error. Once that happens, carefully examine the block of code you just uncommented (added back in).

That way you can narrow down the problem code block enough to see what caused the error. [Always worked for me. :thumbup:]
 
One sure way to track down difficult syntax/typo errors buried somewhere in the code is to:

1. Simplify the code by commenting out larger and larger blocks of it using '#if 0 / #endif' until it compiles again.
2. Then gradually start reducing the amount of commented-out code by shrinking/removing some '#if 0 / #endif' block(s) and seeing if it still compiles cleanly.
3. Repeat step 2 until the compile fails again with the same error. Once that happens, carefully examine the block of code you just uncommented (added back in).

That way you can narrow down the problem code block enough to see what caused the error. [Always worked for me. :thumbup:]

Aside from that, reading the compile time errors also helps :P
 
I thought I had this working. This cpp and H worked fine in Orbiter2006 Ithink I have all the libraries set. But I saw this from the command line

/Os /Oy /GT /GL /I "C:\ORBITER2010P1\Orbitersdk\include" /I "C:\Program Files\Microsoft Platform SDK\Include" /I "C:\Orbiter\Orbitersdk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_CRT_SECURE_NO_WARNINGS" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /GF /FD /EHsc /MD /GS- /Fo"./Release\\" /Fd"./Release\vc90.pdb" /W3 /nologo /c /TP /errorReport:prompt

linker:

/OUT:"c:\ORBITER2010P1\Modules\eagle3.dll" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\ORBITER2010P1\Orbitersdk\lib" /LIBPATH:"C:\Program Files\Microsoft Platform SDK\Lib" /LIBPATH:"C:\Orbiter\Orbitersdk\lib" /DLL /MANIFEST /MANIFESTFILE:"./Release\eagle3.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"msvcirt.lib" /NODEFAULTLIB:"libcmt.lib" /NODEFAULTLIB:"libcpmt.lib" /OPT:ICF /LTCG /DYNAMICBASE:NO /IMPLIB:"./Release/eagle3.lib" /MACHINE:X86 /ERRORREPORT:PROMPT orbiter.lib Orbitersdk.lib orbiter.lib orbitersdk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
 
yeah... that sounds about right - ain't it funny how the worst problem are commonly caused by the most trivial mistakes? :lol:

just the other day at work, i had a world of headache before i realised i had swapped true and false for a function's return value :P - my game wouldn't even start :facepalm:


did that fix it, anyhow?
 
here is what I have set up
c++
Additional Include Libraries
C:\ORBITER2010P1\Orbitersdk\include;"C:\Program Files\Microsoft Platform SDK\Include"

Linker:
Output files
c:\ORBITER2010P1\Modules\eagle3.dll
Additional Library directories
C:\ORBITER2010P1\Orbitersdk\lib;"C:\Program Files\Microsoft Platform SDK\Lib"
 
Is VesselAPI.h physically in your project files?
 
No does it need to be there. This is a vessel2 vessel that I am trying to fix a bug for 2010p1
 
No does it need to be there.
Neither VesselAPI.h nor either of libraries need to be added to project file. That's what additional include and library paths are used for.

---------- Post added at 15:20 ---------- Previous post was at 15:15 ----------

Is your project using Visual Studio properties from Orbiter 2010, i.e. "Orbiter vessel.vsprops" or "Orbiter plugin.vsprops"?

And if so, then have you set path to Orbiter in orbiterroot.vsprops?
 

Is your project using Visual Studio properties from Orbiter 2010, i.e. "Orbiter vessel.vsprops" or "Orbiter plugin.vsprops"?

And if so, then have you set path to Orbiter in orbiterroot.vsprops?

Is this in the vcproj?
 
Is this in the vcproj?

The orbiterroot.vsprops file is in "<Orbiter_dir>/Orbitersdk/resources".

To check if you're using mentioned property sheets, look at "Inherited Project Property Sheets" in "General" of "Configuration Properties", and whether there is something like this (might be among other):
Code:
$(SolutionDir)../../resources/Orbiter vessel.vsprops
 
Thanks
This is what I have:


$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops;$(SolutionDir)../../resources/Orbiter vessel.vsprops
 
Last edited:
And if so, then have you set path to Orbiter in orbiterroot.vsprops?
Have you set appropriate path to Orbiter there, i.e. in "C:\ORBITER2010P1\Orbitersdk\resources\orbiterroot.vsprops"?
There should be this for that Orbiter:
Code:
<UserMacro
	Name="OrbiterDir"
	Value="C:\ORBITER2010P1"
	PerformEnvironmentSet="true"
/>
And then if you have that, you don't need to configure neither additional library nor include paths for Orbiter headers/libs, nor other paths and even file names, because they will be automatically configured from inherited Orbiter property sheets.

Your earlier post shows "C:\Orbiter\Orbitersdk\include" and "C:\Orbiter\Orbitersdk\lib" as set paths, which could be caused by incorrect path to Orbiter set in orbiterroot.vsprops file. Then you added additional search paths in your project file, so you probably have 2 sets of include and library paths, and files that are found first by compiler or linker are being used.
 
I don't have that file:
C:\ORBITER2010P1\Orbitersdk\resources\orbiterroot .vsprops


I have this
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="orbiterroot"
>
<UserMacro
Name="OrbiterDir"
Value="C:\Orbiter2010p1"
PerformEnvironmentSet="true"
/>
</VisualStudioPropertySheet>

for orbiterroot

but still get
Compiling...
EAGLE3.cpp
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(3526) : error C2146: syntax error : missing ';' before identifier 'GetDevMesh'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(3526) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(3526) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(3526) : warning C4183: 'GetDevMesh': missing return type; assumed to be a member function returning 'int'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(3805) : error C2061: syntax error : identifier 'ANIMATION'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4511) : error C2061: syntax error : identifier 'EXHAUSTSPEC'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4549) : error C2061: syntax error : identifier 'EXHAUSTSPEC'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4797) : error C2143: syntax error : missing ';' before '*'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4797) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4797) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4797) : warning C4183: 'AddPointLight': missing return type; assumed to be a member function returning 'int'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4817) : error C2143: syntax error : missing ';' before '*'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4817) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4817) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4817) : warning C4183: 'AddSpotLight': missing return type; assumed to be a member function returning 'int'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4833) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4833) : error C2143: syntax error : missing ';' before '*'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4833) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4833) : warning C4183: 'GetLightEmitter': missing return type; assumed to be a member function returning 'int'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(4844) : error C2061: syntax error : identifier 'LightEmitter'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5714) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5729) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5748) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5769) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5793) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5793) : error C2535: 'int VESSEL3::RegisterPanelArea(void)' : member function already defined or declared
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5769) : see declaration of 'VESSEL3::RegisterPanelArea'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5863) : error C2061: syntax error : identifier 'PANELHANDLE'
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5915) : error C2653: 'oapi' : is not a class or namespace name
C:\ORBITER2010P1\Orbitersdk\include\VesselAPI.h(5915) : error C2061: syntax error : identifier 'Sketchpad'
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(330) : error C2653: 'oapi' : is not a class or namespace name
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(330) : error C2061: syntax error : identifier 'Sketchpad'
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(341) : error C2653: 'oapi' : is not a class or namespace name
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(341) : error C2061: syntax error : identifier 'Sketchpad'
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(367) : error C2653: 'oapi' : is not a class or namespace name
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(367) : error C2143: syntax error : missing ';' before '*'
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(367) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(367) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(367) : warning C4183: 'GetDefaultPen': missing return type; assumed to be a member function returning 'int'
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(384) : error C2653: 'oapi' : is not a class or namespace name
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(384) : error C2143: syntax error : missing ';' before '*'
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(384) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(384) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ORBITER2010P1\Orbitersdk\include\MFDAPI.h(384) : warning C4183: 'GetDefaultFont': missing return type; assumed to be a member function returning 'int'
.\EAGLE3.cpp(1385) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
.\EAGLE3.cpp(1488) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
Build log was saved at "file://c:\ORBITER2010P1\Orbitersdk\samples\EAGLE3\Release\BuildLog.htm"
EAGLE3 - 37 error(s), 8 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
Last edited:
Back
Top