Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Error during catkin_make #8

Open
ayush-j9 opened this issue Mar 7, 2019 · 9 comments
Open

Error during catkin_make #8

ayush-j9 opened this issue Mar 7, 2019 · 9 comments

Comments

@ayush-j9
Copy link

ayush-j9 commented Mar 7, 2019

error: invalid conversion from ‘u32 ()(u8, u32, void*) {aka unsigned int ()(unsigned char, unsigned int, void*)}’ to ‘s32 ()(u8, u32, void*) {aka int ()(unsigned char, unsigned int, void*)}’ [-fpermissive]

/usr/local/include/libsbp/sbp.h:89:4: note: initializing argument 2 of ‘s8 sbp_process(sbp_state_t*, s32 ()(u8, u32, void*))’
s8 sbp_process(sbp_state_t *s, s32 (*read)(u8 buff, u32 n, void context));
^
swiftnav_ros/CMakeFiles/swiftnav_ros_driver.dir/build.make:62: recipe for target 'swiftnav_ros/CMakeFiles/swiftnav_ros_driver.dir/src/swiftnav_ros_driver.cpp.o' failed
make[2]: *** [swiftnav_ros/CMakeFiles/swiftnav_ros_driver.dir/src/swiftnav_ros_driver.cpp.o] Error 1
CMakeFiles/Makefile2:10607: recipe for target 'swiftnav_ros/CMakeFiles/swiftnav_ros_driver.dir/all' failed

@r91andersson
Copy link

yes same here!

@leocorp96
Copy link

Hi all,
So we did run into this same error and fortunately we figured out the solution. Its quite simple.
First, In the "libspb/c/include/sbp.h":
Modify the line 89 ..... s8 sbp_process(sbp_state_t *s, s32 (*read)(u8 buff, u32 n, void context));
To look like this ........ s8 sbp_process(sbp_state_t s, u32 (read)(u8 buff, u32 n, void context));

And then, in the corresponding ".cpp" file;
Modify the line 308 .... s8 sbp_process(sbp_state_t *s, s32 (*read)(u8 *buff, u32 n, void *context))
To look like this .......... s8 sbp_process(sbp_state_t *s, u32 (*read)(u8 buff, u32 n, void context))

Now make sure to clean the previous build "make clean", re-build the library and "sudo make install"
It turns out to have been probably a typo.

Credits. User @mardom95 and myself. Happy Navigation!!

@JeffSampson
Copy link

I just ran into this. I found that the commit for libsbp on Aug 29, 2018 changed various u32 to s32:
https://github.com/swift-nav/libsbp/commit/0332b5f0030d475541c8d581d153c7b5da37915e#diff-3bfa6056449f25827dec667f04b15635
And in swiftnav_ros you can change two instances of u32 read_data(...) to s32 read_data(...):
https://github.com/swift-nav/swiftnav_ros/search?q=read_data&unscoped_q=read_data

It compiles now but I haven't taken it outside to verify it is working correctly.
A better fix may be to have a conditional check for libsbp version and have it make this change if greater than a specific version number.

@jwangjie
Copy link

I just ran into this. I found that the commit for libsbp on Aug 29, 2018 changed various u32 to s32:
https://github.com/swift-nav/libsbp/commit/0332b5f0030d475541c8d581d153c7b5da37915e#diff-3bfa6056449f25827dec667f04b15635
And in swiftnav_ros you can change two instances of u32 read_data(...) to s32 read_data(...):
https://github.com/swift-nav/swiftnav_ros/search?q=read_data&unscoped_q=read_data
It compiles now but I haven't taken it outside to verify it is working correctly.
A better fix may be to have a conditional check for libsbp version and have it make this change if greater than a specific version number.

Hi @JeffSampson ,

I wonder can you specify more what you did to fix the problem? Thank you.

@JeffSampson
Copy link

JeffSampson commented Aug 23, 2020 via email

@jwangjie
Copy link

It's a compile error error: invalid conversion from ‘u32 ()(u8, u32, void*) {aka unsigned int ()(unsigned char, unsigned int, void*)}’ to ‘s32 ()(u8, u32, void*) {aka int ()(unsigned char, unsigned int, void*)}’ of swiftnav_ros package. You mentioned a solution. @JeffSampson

@JeffSampson
Copy link

JeffSampson commented Aug 23, 2020 via email

@leocorp96
Copy link

leocorp96 commented Aug 24, 2020 via email

@jwangjie
Copy link

Hi @jie Wang (王捷)mailto:[email protected] Its quite unfortunate but I can't seem to find the (first) issue around this error where I proposed a working solution anywhere. But I remember I only had to change the datatype (in both the .h and .c) to a specific function and with that, my solution. NB: If you happen to stumble on the issue I opened/closed, you will find what you are looking for. Regards Ephson. LEOCORP => htttp://www.leocorp.net

________________________________ From: Jie Wang (王捷) [email protected] Sent: Sunday, August 23, 2020 3:51 PM To: swift-nav/swiftnav_ros [email protected] Cc: Ephson [email protected]; Comment [email protected] Subject: Re: [swift-nav/swiftnav_ros] Error during catkin_make (#8) I just ran into this. I found that the commit for libsbp on Aug 29, 2018 changed various u32 to s32: swift-nav/libsbp@0332b5f#diff-3bfa6056449f25827dec667f04b15635 And in swiftnav_ros you can change two instances of u32 read_data(...) to s32 read_data(...): https://github.com/swift-nav/swiftnav_ros/search?q=read_data&unscoped_q=read_data It compiles now but I haven't taken it outside to verify it is working correctly. A better fix may be to have a conditional check for libsbp version and have it make this change if greater than a specific version number. Hi @JeffSampsonhttps://github.com/JeffSampson , I wonder can you specify more what you did to fix the problem? Thank you. — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#8 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACB2JEQ4WQ3AIST7FPZ3R43SCE3HLANCNFSM4G4ILT6Q.

Hello Ephson,

Thanks for your reply. Your solution didn't solve my problem, but you are very correct about the datatype in .h and .c file. My solution is:

In sbp_device.c, change line 143 from u32 read_data( u8 *data, u32 num_bytes, void* context ) to s32 read_data( u8 *data, u32 num_bytes, void* context )

In sbp_device.h, change line 68 from u32 read_data( u8 *data, u32 num_bytes, void* context ) to s32 read_data( u8 *data, u32 num_bytes, void* context ) .

Regards,
Jie

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants