A
A
alexey_abramov2015-09-30 21:34:28
Microcontrollers
alexey_abramov, 2015-09-30 21:34:28

Combining a C-link and a C++ application when building for ARM - why is ARM not friendly with extern c?

Hello. I have a C++ application that uses 1 ss lib, with many ssh functions. They are of course described in the headings. using Extern "C" (if there is __cplusplus) The application itself is working with a lot of data, there is nothing special and confused in it. Let's compile the whole thing under x86 using g++. Everything works as it should. But this application must be uploaded to the iWave microcontroller, so an assembly for ARM is required. The compiler used is arm-linux-gnueabihf-g++. It seems that all the packages for ubuntu were downloaded and updated, for assembly using this compiler. The lib itself is enabled, there are no warnings, but errors occur in all extern functions used. Those. it is written:
/home/user/workspace/project/arm/lib.a(manager.o): In function `Agent_From': manager.c:(.text+0x69e): undefined reference to `Agent_Get' manager.c:(.text +0x6c4): undefined reference to `Agent_Get' manager.c:(.text+0x6ea): undefined reference to `Agent_Get' manager.c:(.text+0x710): undefined reference to `Agent_Get' manager.c:(. text+0x750): undefined reference to `Agent_Get'
How to be and where to dig? Maybe someone faced a similar problem? I saw on the Internet that some people solved this problem with the help of "-fpermissive", however, this problem could not be solved in this way. I can provide some additional information tomorrow. There are no problems with the assembly for Windows, and it works like a clock, with an arm bug with a link. ps the linker is given a lib created for arm of course,

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2015-10-01
@jcmvbkbc

Show the full build log, for x86 and for ARM.

V
Vitaly Filinkov, 2015-10-01
@vitfil

Digging is in the direction of the documentation for the compiler. If sclerosis does not change me, Extern "C" is not supported in it.

E
Eugene, 2015-10-05
@jk_action

undefined reference to `Agent_Get' says that when you build, you are missing exactly the library that has an implementation of this function. Attach the header file, where this function is described, the Makefile and the complete build log for ARM.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question