C API

Post Reply
ibatrakov
Posts: 1
Joined: Tue Apr 11, 2017 7:48 am

C API

Post by ibatrakov »

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
Post Reply