- Joined
- Mar 21, 2008
- Messages
- 2,555
- Reaction score
- 1,190
- Points
- 128
- Location
- Saco, ME
- Website
- mwhume.space
- Preferred Pronouns
- he/him
I've been bitten by the addon dev bug again recently and I'm getting back into the Orbiter API and C++.
I'm having trouble with the very simple bit of code below.
The compiler gives me this error:
when I try to compile it, which doesn't make sense to me.
If I remove the
line it will compile and orbiter will load it, and it does exactly what I want.
My question is, why??
I'm having trouble with the very simple bit of code below.
Code:
#define STRICT
#define ORBITER_MODULE
#include <OrbiterSDK.h>
DLLCLBK void opcPreStep(double simt, double simdt, double mjd)
{
sprintf(oapiDebugString(), "%.10f", oapiGetSimStep());
}
The compiler gives me this error:
Code:
1>------ Build started: Project: Moth, Configuration: Debug Win32 ------
1>moth.cpp
1>c:\orbiter\orbiter2016\orbitersdk\include\orbiterapi.h(7227): error C2440: 'return': cannot convert from 'const char [12]' to 'char *'
1>c:\orbiter\orbiter2016\orbitersdk\include\orbiterapi.h(7227): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
1>Done building project "Moth.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
when I try to compile it, which doesn't make sense to me.
If I remove the
Code:
#define ORBITER_MODULE
My question is, why??