C API
Posted: Tue Apr 11, 2017 7:55 am
after including into .C file
#include "CollisionSdkC_Api.h"
compiler gives error
CollisionSdkC_Api.h:99: error: unknown type name ‘lwContactPoint’
lwContactPoint* pointsOut, int pointCapacity);
^~~~~~~~~~~~~~
your
struct lwContactPoint
{
plVector3 m_ptOnAWorld;
plVector3 m_ptOnBWorld;
plVector3 m_normalOnB;
plReal m_distance;
};
In C you should write
typedef struct lwContactPoint
{
plVector3 m_ptOnAWorld;
plVector3 m_ptOnBWorld;
plVector3 m_normalOnB;
plReal m_distance;
} lwContactPoint;
or write everywhere
struct wContactPoint* pointsOut, int pointCapacity);
it is C and not C++
waiting for your real C API
Why not to create separate include folder for C_API and one folder for all libs
#include "CollisionSdkC_Api.h"
compiler gives error
CollisionSdkC_Api.h:99: error: unknown type name ‘lwContactPoint’
lwContactPoint* pointsOut, int pointCapacity);
^~~~~~~~~~~~~~
your
struct lwContactPoint
{
plVector3 m_ptOnAWorld;
plVector3 m_ptOnBWorld;
plVector3 m_normalOnB;
plReal m_distance;
};
In C you should write
typedef struct lwContactPoint
{
plVector3 m_ptOnAWorld;
plVector3 m_ptOnBWorld;
plVector3 m_normalOnB;
plReal m_distance;
} lwContactPoint;
or write everywhere
struct wContactPoint* pointsOut, int pointCapacity);
it is C and not C++
waiting for your real C API
Why not to create separate include folder for C_API and one folder for all libs