Trouble compiling a plugin

Report crashes, strange behaviour, or apparent bugs
starplayer
Posts: 7
Joined: 17 Oct 2014, 15:57

Trouble compiling a plugin

Post by starplayer »

Hello. I'm trying to make a plugin for v-rep for my master thesis.

I'm going to modify the v_repExtBubbleRob plugin to work with a different robot.

However, when I open the project with codeblocks, using the Microsoft Visual Studio Project Importer, I get the error that I'm missing zlib1.dll.

I installed the mingw codeblocks version, and I'm trying to use the GNU C++ compiler.

I already downloaded zlib, and put the library in the system32 folder, as well as the other files in the mingw folders.

Should I use a different setup that is more compatible, instead of codeblocks and minGW, or does anyone else have any ideas? This is driving me crazy.

Edit:I guess this should be moved to the general questions forum, some mod please do that if he thinks apropriate.

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

Re: Trouble compiling a plugin

Post by coppelia »

Hello,

In the project folder you have the make file, the MSV project file, and the Qt project file. My suggestion would be to use Qt with minGW since you already have minGW.

Cheers

starplayer
Posts: 7
Joined: 17 Oct 2014, 15:57

Re: Trouble compiling a plugin

Post by starplayer »

Thank you very much, I will try that!

starplayer
Posts: 7
Joined: 17 Oct 2014, 15:57

Re: Trouble compiling a plugin

Post by starplayer »

Okay, I've tried doing that.
However, in QT creator, when In try to "Build-> Rebuild Project v_repExtBubbleRob", I get three "issues":

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\BACKUP_v_repExtBubbleRob\v_repExtBubbleRob.cpp:133: warning: C4100: 'reservedInt' : unreferenced formal parameter

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\BACKUP_v_repExtBubbleRob\v_repExtBubbleRob.cpp:133: warning: C4100: 'reservedPointer' : unreferenced formal parameter

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\BACKUP_v_repExtBubbleRob\v_repExtBubbleRob.cpp:213: warning: C4100: 'replyData' : unreferenced formal parameter


Any ideas why this might be happening?

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

Re: Trouble compiling a plugin

Post by coppelia »

The three issues are warnings. You can correct this by removing those unused variables. But it will still compile like that. Did you even try the created plugin?

Cheers

starplayer
Posts: 7
Joined: 17 Oct 2014, 15:57

Re: Trouble compiling a plugin

Post by starplayer »

Thank you for your answer.

However, If I for example remove the variable correspondet to the first warning ("declared" in the function header), I get

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\BACKUP_v_repExtBubbleRob\v_repExtBubbleRob.cpp:135: error: C2733: second C linkage of overloaded function 'v_repStart' not allowed

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\BACKUP_v_repExtBubbleRob\v_repExtBubbleRob.cpp:134: see declaration of 'v_repStart'


Anyway, even using the compiled dll created with "Rebuild project "v_repExtBubleRob" in QT Creator, found in

build-v_repExtBubbleRob-Desktop_Qt_5_1_1_MSVC2010_32bit-Debug\debug\v_repExtBubleRob.dll

v-rep doesnt detect it when I replace it with the original dll. Which figures, since this compiled dll has 153 KB and the original has 300 KB. So something must be off. Any ideas?

BTW I'm on windows 8.1 if that might be of any weird help.
Than you for tour time.

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

Re: Trouble compiling a plugin

Post by coppelia »

You have to be sure to use the same compiler and Qt version as V-REP's dll (if you use specific Qt functionality), otherwise it will not load. It seems you are using a different compiler. I suggest you try with a more simple example first, for instance v_repExtSimpleFilter or v_repExtPluginSkeleton to see if those ones load fine.

Cheers

starplayer
Posts: 7
Joined: 17 Oct 2014, 15:57

Re: Trouble compiling a plugin

Post by starplayer »

Thank you for your answer.

Okay, I changed the compiler to mingW, and the qt version should be the correct one, as is indicated in the folder name

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\build-v_repExtSimpleFilter-Desktop_Qt_5_1_1_MinGW_32bit-Debug\

since the about screen of v-rep it is written (QT version 5.1.1, MingW), so I believe that should be fine.

I tried with simpleFilter, which had a pro file so it should run ok.

However, the created dll has 785 KB, while the original has only 102 KB.

When I run Vrep with the new dll, it says in the command line:

Plugin 'RemoteApi': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load failed (could not load). The plugin probably couldn'
t load dependency libraries.

And when I compiled it, qt creator gave me the following warnings:

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\v_repExtSimpleFilter\v_repExtSimpleFilter.cpp:-1: In function 'void* v_repMessage(int, int*, void*, int*)':

C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\v_repExtSimpleFilter\v_repExtSimpleFilter.cpp:173: warning: unused variable 'inputImage' [-Wunused-variable]
float* inputImage=(float*)ptrs[0]; // original image from the vision sensor
^
C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\v_repExtSimpleFilter\v_repExtSimpleFilter.cpp:174: warning: unused variable 'inputDepth' [-Wunused-variable]
float* inputDepth=(float*)ptrs[1]; // original depth map from the vision sensor
^
C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\v_repExtSimpleFilter\v_repExtSimpleFilter.cpp:176: warning: unused variable 'buffer1' [-Wunused-variable]
float* buffer1=(float*)ptrs[3]; // buffer 1 image
^
C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\v_repExtSimpleFilter\v_repExtSimpleFilter.cpp:177: warning: unused variable 'buffer2' [-Wunused-variable]
float* buffer2=(float*)ptrs[4]; // buffer 2 image
^
C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\v_repExtSimpleFilter\v_repExtSimpleFilter.cpp:178: warning: unused variable 'outputImage' [-Wunused-variable]
float* outputImage=(float*)ptrs[5]; // output image
^

Any ideas?
Thank you very much for your time.

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

Re: Trouble compiling a plugin

Post by coppelia »

Try to compile the project in release mode.

Cheers

starplayer
Posts: 7
Joined: 17 Oct 2014, 15:57

Re: Trouble compiling a plugin

Post by starplayer »

Thank you for your answer.

That worked for the simple filter plugin, thank you very much.

However, when I try the same for the bubblerob plugin, altough it says that it was loaded successfully in the command line, inside V-Rep in the plugins menu it doesn't appear the bubblerob plugin.

I tried with the mtb plugin and everything worked fine. However with the bubblerob one no luck. Alas, the compiled file size is 104 KB while the original is 300. The other two plugins I tried had very close file sizes.

Any ideas?

Thank you very much for your help.

Post Reply