Compiling Errors bubbleRobClient

Typically: "How do I... ", "How can I... " questions
Post Reply
sneaker
Posts: 12
Joined: 11 Dec 2013, 22:21

Compiling Errors bubbleRobClient

Post by sneaker »

Hello,

I am trying to compile the bubbleRobClient example in Eclipse. Same Code, I did no changes.
But I am only getting compiling errors. I included the include-folder and the remoteApi-folder to my project and I also did the preprocessor definitions.

Can you help me what I am missing?

Image

Sneaker

coppelia
Site Admin
Posts: 10361
Joined: 14 Dec 2012, 00:25

Re: Compiling Errors bubbleRobClient

Post by coppelia »

Hello Sneaker,

not sure what is wrong. Did you include the remote API via

Code: Select all

extern "C" {
    #include "extApi.h"
}
?

Sometimes you have also to tell the compiler it is compiling C (and not C++) code for the remote API (i.e. by specifying for each remote API C file, that it should be handled as a C-file)

Cheers

qizzle
Posts: 15
Joined: 27 Nov 2013, 19:49

Re: Compiling Errors bubbleRobClient

Post by qizzle »

There is a lot of config you first have to go to your extApi.h and define which os you're using be it _WIN32 or __LINUX or whatever and then #include "extApi.h" to all your other headers. Make sure you #define MAX_EXT_API_CONNECTIONS and NON_MATLAB_PARSING somewhere and link it to all your other headers too. This should narrow down the errors, then you it'll ask for things like winsock and threads you need to link your project to the library where windows.h is and link your project to where process.h because you use those for socket comm and making threads gl.

sneaker
Posts: 12
Joined: 11 Dec 2013, 22:21

Re: Compiling Errors bubbleRobClient

Post by sneaker »

thanks a lot for your answers..

After some hours of testing I figured it out.
The solution for my problem was rather easy and was actually already posted in this thread:
viewtopic.php?f=9&t=924&p=3414&hilit=pthread#p3414

I just had to specifically include the extApi.c and extApiPlatform.c files inside the extern "C" block:

Code: Select all

extern "C" {
    #include "extApi.h"
    #include "extApi.c"
    #include "extApiPlatform.c"
/*	#include "extApiCustom.h" if you wanna use custom remote API functions! */
}
Additionally I had to link the pthread library.
In eclipse:
1. Rightclick on project folder -> Properties
2. Add pthread library
Image

I'm on ubuntu linux.

Sneaker

Post Reply