Referencing Kovan C++ code from C

1 reply [Last post]
brada
Title: NooBot
Joined: 03/23/2012
Posts:
BotPoints: 36
User offline. Last seen 8 years 24 weeks ago.

I was looking in the Kovan source code today, and I saw that the c++ class create.cpp has a method called move.

looking at the create_c.cpp it seems like I should be able create a C++ library that only has this code, and then call it from my C program after dealing with extern issues.

  1. void create_move(int distance, int speed)
  2. {
  3. Create::instance()->move(distance, speed);
  4. }

What would I have to #include to have access to the Create Object?

Thanks
Brad

Brad A.
Team 13-0624
Fairfield, IL

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 7 years 20 weeks ago.

The Create class is defined in create.hpp
I'm not sure what will happen if you include it into C code though.