stm32 error mavlink keil c++ project

218 views
Skip to first unread message

julien savy

unread,
Jan 28, 2020, 12:05:00 PM1/28/20
to MAVLink
hi every body

I am trying to set up a communication between Pixhaw and an STM32
I use the c_library_v2 from github.
I am using a c++ project .
I have add the include path on keil and the include file mavlink.h at the top of main.cpp file 
when i compile there are 30 error :
I don't understand why it doesn't work
I hope somebody can help me

Julien 

Capture.JPG

 

Arvydas Tomkus

unread,
May 20, 2020, 4:55:40 AM5/20/20
to MAVLink
Hey. Have you found a solution ? I have the same compilation errors. Maybe the problem is that Keil projects are C++, while c_library_v2 from github is in C ? I am not able to generate mavlink library in C++ in python, I have problems downloading future module.

Arsenii Soitu

unread,
May 20, 2020, 5:13:52 AM5/20/20
to mav...@googlegroups.com
Seems that --c 99 shouldn't be here. If You have C++ project.

ср, 20 мая 2020 г. в 11:55, Arvydas Tomkus <tomkus...@gmail.com>:
--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com.
Wenn Sie diese Diskussion im Web verfolgen möchten, rufen Sie https://groups.google.com/d/msgid/mavlink/5584cad4-eaa7-4c17-bda6-bbe88ffb3433%40googlegroups.com auf.

Arvydas Tomkus

unread,
May 20, 2020, 7:42:51 AM5/20/20
to MAVLink
Could you please explain that --c 99 in more detail ? 

I am using mavlink/c_library_v2 (the one that is generated on github) in Keil MDK environment. I have the same compilation errors, as Julien has written above.

Thank you.


On Wednesday, May 20, 2020 at 12:13:52 PM UTC+3, Arsenii Soitu wrote:
Seems that --c 99 shouldn't be here. If You have C++ project.

ср, 20 мая 2020 г. в 11:55, Arvydas Tomkus <tomkus...@gmail.com>:
Hey. Have you found a solution ? I have the same compilation errors. Maybe the problem is that Keil projects are C++, while c_library_v2 from github is in C ? I am not able to generate mavlink library in C++ in python, I have problems downloading future module.

On Tuesday, January 28, 2020 at 7:05:00 PM UTC+2, julien savy wrote:
hi every body

I am trying to set up a communication between Pixhaw and an STM32
I use the c_library_v2 from github.
I am using a c++ project .
I have add the include path on keil and the include file mavlink.h at the top of main.cpp file 
when i compile there are 30 error :
I don't understand why it doesn't work
I hope somebody can help me

Julien 

Capture.JPG

 

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mav...@googlegroups.com.

Arsenii Soitu

unread,
May 20, 2020, 8:28:25 AM5/20/20
to mav...@googlegroups.com
Yes. If You change main.cpp to main.c, Your code will be successfully built. But You want to mix C++ code and C library. Keil Compiler gets confused. You need to explain Keil how to build Your sources. But unfortunately I don't know how

ср, 20 мая 2020 г. в 14:42, Arvydas Tomkus <tomkus...@gmail.com>:
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com.
Wenn Sie diese Diskussion im Web verfolgen möchten, rufen Sie https://groups.google.com/d/msgid/mavlink/5a85190e-6d5c-4eba-bc33-5f62e24c0266%40googlegroups.com auf.

Arvydas Tomkus

unread,
May 20, 2020, 8:51:46 AM5/20/20
to MAVLink
I made a mistake. My main file is main.c, so I am using C in Keil. Library mavlink/c_library_v2 is also in C, so both mavlink library and my Keil code is in C. What could be the problem then, if the project doesn't compile ?

The first error in compiler says that function pack() is undefined. pask() is used in this macro definition:

#define MAVPACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )

All 30 errors come from MAVPACKED being undefined. What are your thoughts ?

Thank you.

ads1.PNG


ads2.PNG

ads3.PNG

ads4.PNG


Message has been deleted

Arvydas Tomkus

unread,
May 20, 2020, 8:55:43 AM5/20/20
to MAVLink
Pictures showing the errors are attached
ads2.PNG
ads3.PNG
ads4.PNG
ads1.PNG

Arsenii Soitu

unread,
May 20, 2020, 9:15:07 AM5/20/20
to mav...@googlegroups.com
Okay, so now I see that You should check "GNU extensions" flag

ср, 20 мая 2020 г. в 15:55, Arvydas Tomkus <tomkus...@gmail.com>:
--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com.
Wenn Sie diese Diskussion im Web verfolgen möchten, rufen Sie https://groups.google.com/d/msgid/mavlink/cdc94633-f6eb-4351-b0a2-233059290fb1%40googlegroups.com auf.

Arvydas Tomkus

unread,
May 20, 2020, 11:45:12 AM5/20/20
to MAVLink
GNU extensions did the trick. Thank you !

Arsenii Soitu

unread,
May 20, 2020, 11:50:02 AM5/20/20
to mav...@googlegroups.com
My pleasure

ср, 20 мая 2020 г. в 18:45, Arvydas Tomkus <tomkus...@gmail.com>:
GNU extensions did the trick. Thank you !

On Wednesday, May 20, 2020 at 4:15:07 PM UTC+3, Arsenii Soitu wrote:
Okay, so now I see that You should check "GNU extensions" flag

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com.
Wenn Sie diese Diskussion im Web verfolgen möchten, rufen Sie https://groups.google.com/d/msgid/mavlink/650b8e13-551e-4369-8355-dc4819974942%40googlegroups.com auf.

Сергей Кунцевич

unread,
May 24, 2020, 7:13:12 PM5/24/20
to MAVLink
I didn’t manage to run C ++, I use simple C

среда, 20 мая 2020 г., 18:50:02 UTC+3 пользователь Arsenii Soitu написал:
С удовольствием

Ср, 20 мая 2020 года в 18:45, Арвидас Томкус < tomkus ... @ gmail.com >:
Расширения GNU сделали свое дело. Спасибо !

В среду, 20 мая 2020 года, в 16:15:07 UTC + 3, Арсений Сойту написал:
Хорошо, теперь я вижу, что Вы должны проверить флаг "Расширения GNU"

-
Вы получили это сообщение, потому что подписались на электронные письма из группы MAVLink в группах Google.
Если вы хотите отписаться от этой группы и больше не хотите получать электронную почту от этой группы, отправьте электронное письмо по адресу mav ... @ googlegroups.com . Чтобы
следить за этим обсуждением в Интернете, перейдите на страницу https://groups.google.com/d/ msgid / mavlink / 650b8e13-551e- 4369-8355-dc4819974942% 40googlegroups.com .
Message has been deleted

jan Khan

unread,
Jul 20, 2023, 5:03:14 AM7/20/23
to MAVLink
need help
Reply all
Reply to author
Forward
0 new messages