## Is There A Portable Version Of The C++ b0 API?

Typically: "How do I... ", "How can I... " questions
Sniggyfigbat
Posts: 7
Joined: 18 Nov 2019, 15:32

### Is There A Portable Version Of The C++ b0 API?

I have a C++ project set up using the old API, which I manage through GitHub, and uses premake to avoid actually uploading/moving/merging Visual Studio solution files. I have done this because I am moving between various machines, with varying levels of access.

I am attempting to upgrade to the modern b0 API. So far, this requires me to copy paste some include files (fine), directly link to a bunch of files within the V-REP program files (not fine), and install Boost (very spectacularly not fine). I'm slightly stunned by how involved this process is, and by how limited the docs are (following these steps gives me the incorrect locations for certain files, and doesn't work anyway because it can't find Boost).

Has anyone set up a sane, drag-and-drop, single-include, portable version of the API? I cannot understand why this is not available, especially since it was fairly trivial to set up for the old API. Any help would be much appreciated!

coppelia
Posts: 7450
Joined: 14 Dec 2012, 00:25

### Re: Is There A Portable Version Of The C++ b0 API?

Hello,

not sure... are you talking about the B0-based remote API? So you basically want to compile e.g. the simpleTest program of the B'-based remote API?

Cheers

Sniggyfigbat
Posts: 7
Joined: 18 Nov 2019, 15:32

### Re: Is There A Portable Version Of The C++ b0 API?

I am indeed talking about b0 Remote API, apologies if that was unclear.

I'm not quite sure what you mean by "compile e.g. the simpleTest program". If, by that, you mean I'm using premake to do a similar function to the 'rebuild-windows' batch file, then yes, that is roughly what I'm trying to do. The issue is that the batch file requires horribly messy links into the V-REP program files, and also doesn't actually work. I'm looking for a standalone version of the remote API; ideally as a single library or hpp file, but any self-contained, portable structure would work. I believe this is a reasonable requirement, given that the client could theoretically be on an entirely different machine to the VREP simulation, and I fear that the lack of such functionality means I may have misunderstood something.

Also, I don't quite understand why the remote API requires Boost functionality that has since been implemented in the STL. Perhaps this isn't a problem for most users, but it's fairly impractical for my purposes. I can circumvent this if absolutely necessary, but it is inconvenient.

coppelia
Posts: 7450
Joined: 14 Dec 2012, 00:25

### Re: Is There A Portable Version Of The C++ b0 API?

Sorry about the delay, super busy with the new release.

Still not sure what you mean. In previous versions, things were a bit more complicated... do you also have this?

Code: Select all

@ECHO OFF

set VCVARSALL_STRING="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64

set COMPILER_FLAGS=/W3 /O1 /EHsc /c
set COMPILER_DEFINES=/D "WIN32" /D "_WINDOWS" /D "NDEBUG"
set COMPILER_INCLUDES=/I"..\..\..\blueZero\include\b0\bindings" /I".." /I"..\msgpack-c\include" /I"C:\local\boost_1_62_0"
set COMPILERSTRING=%COMPILER_INCLUDES% %COMPILER_DEFINES% %COMPILER_FLAGS%

REM  b0.lib is normally located in the same folder as coppeliaSim.exe

if not defined DevEnvDir (
call %VCVARSALL_STRING%
)

cl simpleTest.cpp %COMPILERSTRING%
cl ..\b0RemoteApi.cpp %COMPILERSTRING%
link simpleTest.obj b0RemoteApi.obj %LINKERSTRING%
the simplified Qt project file counter part is:

Code: Select all

include(config.pri)

QT -= core
QT -= gui

TARGET = simpleTest
TEMPLATE = app

DEFINES -= UNICODE
CONFIG   += console
CONFIG   -= app_bundle

INCLUDEPATH += $$BOOST_INCLUDEPATH INCLUDEPATH +=$$B0_INCLUDEPATH/b0/bindings
INCLUDEPATH += ..
INCLUDEPATH += ../msgpack-c/include

win32 {
LIBS += $$B0_LIB LIBS += -L$$BOOST_LIB_PATH
}

macx {
LIBS += $$B0_LIB } unix:!macx { LIBS +=$$B0_LIB
LIBS += -lboost_system
}

../b0RemoteApi.h \

SOURCES += \
simpleTest.cpp \
../b0RemoteApi.cpp \

unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
INSTALLS += target
}

What is it that is problematic in above files?

Cheers