Problems compiling bubbleRobClient.cpp

Typically: "How do I... ", "How can I... " questions
Post Reply
bruss86
Posts: 6
Joined: 20 Feb 2014, 22:07

Problems compiling bubbleRobClient.cpp

Post by bruss86 »

Hello, how are you? Several days ago I try to compile the bubbleRobClient.cpp project in Qt Creator 2.4.1 in C + +. I did all the steps (I believe) describing Enabling the Remote API - client side, ie, add to my project folder:
extApi.h
extApi.c
extApiPlatform.h
extApiPlatform.c
Which is also included in the bubbleRobClient.cpp follows:
extern "C" {
    # include "extApi.h"
# include "extApi.c"
# include "extApiPlatform.h"
# include "extApiPlatform.c"
}
Also I defined MAX_EXT_API_CONNECTIONS NON_MATLAB_PARSING = 1 and = 255 as a preprocessor definition in the pro file with Qt Creator, as follows.:
DEFINES + = NON_MATLAB_PARSING = 1
DEFINES + = MAX_EXT_API_CONNECTIONS = 255

Then when I compile the project onto me many errors extApi_getTimeInMs `function '.
Do not know what else to do. Any council will be welcome.

Keep it that the V-REP is a great simulator.

Greetings from Argentina.

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

Re: Problems compiling bubbleRobClient.cpp

Post by coppelia »

Hello,

in the bubbleRobClient.cpp file, do not include all the files. Following should be enough:

Code: Select all

extern "C" {
    #include "extApi.h"
}
Can you show us the actual output of the compiler?

Cheers

bruss86
Posts: 6
Joined: 20 Feb 2014, 22:07

Re: Problems compiling bubbleRobClient.cpp

Post by bruss86 »

Hi, Thanks for the prompt reply, if I included extApi.h nomas, and define NON_MATLAB_PARSING = 1
. MAX_EXT_API_CONNECTIONS = 255 and in the *.pro file with Qt Creator tells me: error: [debug / bubbleRobClient.o] Error 1. If you do not define preprocessors shoot me the following errors:
In function 'int main (int, char **)':
'simx_opmode_continuous' was not Declared In this scope
'extApi_sleepMs' was not Declared In this scope
'simx_error_noerror' was not Declared In this scope
'simx_opmode_oneshot' was not Declared In this scope
'extApi_sleepMs' was not Declared In this scope
Layers I'm doing wrong definition of the preprocessors.
Greetings.

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

Re: Problems compiling bubbleRobClient.cpp

Post by coppelia »

Try with following PRO file content:

Code: Select all

TARGET = bubbleRobClient
TEMPLATE = app

DEFINES -= UNICODE
CONFIG   += console

DEFINES += NON_MATLAB_PARSING
DEFINES += MAX_EXT_API_CONNECTIONS=255

*-msvc* {
	QMAKE_CXXFLAGS += -O2
	QMAKE_CXXFLAGS += -W3
}
*-g++* {
	QMAKE_CXXFLAGS += -O3
	QMAKE_CXXFLAGS += -Wall
	QMAKE_CXXFLAGS += -Wno-unused-parameter
	QMAKE_CXXFLAGS += -Wno-strict-aliasing
	QMAKE_CXXFLAGS += -Wno-empty-body
	QMAKE_CXXFLAGS += -Wno-write-strings

	QMAKE_CXXFLAGS += -Wno-unused-but-set-variable
	QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
	QMAKE_CXXFLAGS += -Wno-narrowing

	QMAKE_CFLAGS += -O3
	QMAKE_CFLAGS += -Wall
	QMAKE_CFLAGS += -Wno-strict-aliasing
	QMAKE_CFLAGS += -Wno-unused-parameter
	QMAKE_CFLAGS += -Wno-unused-but-set-variable
	QMAKE_CFLAGS += -Wno-unused-local-typedefs
}


win32 {
	LIBS += -lwinmm
	LIBS += -lWs2_32
}

macx {
}

unix:!macx {
}


INCLUDEPATH += "../include"
INCLUDEPATH += "../remoteApi"

SOURCES += \
    bubbleRobClient.cpp \
    ../remoteApi/extApi.c \
	../remoteApi/extApiPlatform.c

HEADERS +=\
    ../remoteApi/extApi.h \
	../remoteApi/extApiPlatform.h

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

bruss86
Posts: 6
Joined: 20 Feb 2014, 22:07

Re: Problems compiling bubbleRobClient.cpp

Post by bruss86 »

Hello, I consider the code in the *.pro ​​as I stated, and the program is compiled without any problems. Thank you very much for the great help.
Cheers and keep well.

Post Reply