Project

General

Profile

DSP Hello World won't link

Added by Mary Frantz over 11 years ago

I am following the instruction for the DSP Hello Word project wiki page.

First Problem:

I got a compile error for this line:

lpMessageOutbound->SendMessage(lpMessageBuffer, strlen(lpMessageBuffer)+1);

saying that there was no function "SendMessage()" with these parameters. I looked at ipc_outbound.h and noted that SendMessage() only has one parameter, the pointer to the message. I replace the line as follows:

// lpMessageOutbound->SendMessage(lpMessageBuffer, strlen(lpMessageBuffer)+1);
lpMessageOutbound->SendMessage(lpMessageBuffer);

I was able to compile, but not link.

Here is the output to the console for a build:

  • Rebuild of configuration Debug for project HelloDsp **
  • Internal Builder is used for build ***
    arm-angstrom-linux-gnueabi-g++ -I/home/mitydsp/MDK_2012-08-10/sw/ARM/linux/libdsp -O0 -g3 -Wall -c -fmessage-length=0 -oarm_main.o ../arm_main.cpp
    arm-angstrom-linux-gnueabi-g++ -L/home/mitydsp/MDK_2012-08-10/lib/ARM/Debug -oHelloDsp arm_main.o ../../../MDK_2012-08-10/lib/ARM/Debug/dsplink.lib -ldsp -lpthread
    /usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: Dwarf Error: mangled line number section.
    /home/mitydsp/MDK_2012-08-10/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_insert(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>, MityDSP::tcIPCInbound_private::CB_Info const&)':
    ipc_inbound.cpp:(.text._ZNSt4listIN7MityDSP20tcIPCInbound_private7CB_InfoESaIS2_EE9_M_insertESt14_List_iteratorIS2_ERKS2_[std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_insert(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>, MityDSP::tcIPCInbound_private::CB_Info const&)]+0x3c): undefined reference to `std::_List_node_base::_M_hook(std::_List_node_base
    )'
    /home/mitydsp/MDK_2012-08-10/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_erase(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>)':
    ipc_inbound.cpp:(.text._ZNSt4listIN7MityDSP20tcIPCInbound_private7CB_InfoESaIS2_EE8_M_eraseESt14_List_iteratorIS2_E[std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_erase(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>)]+0x1c): undefined reference to `std::_List_node_base::_M_unhook()'
    /home/mitydsp/MDK_2012-08-10/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_insert(std::_List_iterator<MityDSP::tcIPCHandler*>, MityDSP::tcIPCHandler* const&)':
    ipc_inbound.cpp:(.text._ZNSt4listIPN7MityDSP12tcIPCHandlerESaIS2_EE9_M_insertESt14_List_iteratorIS2_ERKS2_[std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_insert(std::_List_iterator<MityDSP::tcIPCHandler*>, MityDSP::tcIPCHandler* const&)]+0x3c): undefined reference to `std::_List_node_base::_M_hook(std::_List_node_base*)'
    /home/mitydsp/MDK_2012-08-10/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_erase(std::_List_iterator<MityDSP::tcIPCHandler*>)':
    ipc_inbound.cpp:(.text._ZNSt4listIPN7MityDSP12tcIPCHandlerESaIS2_EE8_M_eraseESt14_List_iteratorIS2_E[std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_erase(std::_List_iterator<MityDSP::tcIPCHandler*>)]+0x1c): undefined reference to `std::_List_node_base::_M_unhook()'
    collect2: ld returned 1 exit status
    Build error occurred, build is stopped
    Time consumed: 2017 ms.

What is "Dwarf Error: mangled line number section."?

I am using MDK 2012-08-10 and am very new to Linux.

Thanks,
Mary


Replies (7)

RE: DSP Hello World won't link - Added by Gregory Gluszek over 11 years ago

Hi Mary,

In regards to your first issue, the fix you made is correct. The arm_main.cpp file is simply out of date and needs to be updated. I will look into that.

As far as your linking issue, it looks like you are using the toolchain with GCC 4.3.3. My guess is that the libraries in the MDK you are using were compiled with the toolchain with GCC 4.5.4. Try installing the Mar-2012 SDK (instructions can be found here http://support.criticallink.com/redmine/projects/arm9-platforms/wiki/GCC_Toolchain) and see if that fixes your linking problem.

Let us know if this does not fix your issue, or you run into further problems.

Thanks,
\Greg

RE: DSP Hello World won't link - Added by Mary Frantz over 11 years ago

I had originally downloaded Aug-2012 SDK (angstrom-eglibc-i686-armv5te-toolchain-qte-v2012.05.tar.bz2)and installed this using the following command:

sudo tar xjvf angstrom-eglibc-i686-armv5te-toolchain-qte-v2012.05.tar.bz2 -C /

then

. /usr/local/oecore-i686/environment-setup-armv5te-angstrom-linux-gnueabi

I also downloaded and ran release_2012-08-10.run

Checking the gcc version using gcc -v shows the version as 4.4.3

I retried installing with the above commands and noticed this time an error message from tar. Something like "tar failed due to previous errors".

I then downloaded the Mar-2012 toolchain as you suggested (angstrom-eglibc-i686-armv5te-toolchain-qte-v2012.03.tar.bz2). Ran tar without any error and re-ran the environment setup.

gcc -v still says version 4.4.3

Compiling still produces the same messages as before.

  • Build of configuration Debug for project HelloDsp **
  • Internal Builder is used for build ***
    arm-angstrom-linux-gnueabi-g++ -L/home/mitydsp/MDK_2012-03-12/lib/ARM/Debug -oHelloDsp arm_main.o ../../../MDK_2012-03-12/lib/ARM/Debug/dsplink.lib -ldsp -lpthread
    /usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: Dwarf Error: mangled line number section.
    /home/mitydsp/MDK_2012-03-12/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_insert(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>, MityDSP::tcIPCInbound_private::CB_Info const&)':
    ipc_inbound.cpp:(.text._ZNSt4listIN7MityDSP20tcIPCInbound_private7CB_InfoESaIS2_EE9_M_insertESt14_List_iteratorIS2_ERKS2_[std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_insert(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>, MityDSP::tcIPCInbound_private::CB_Info const&)]+0x3c): undefined reference to `std::_List_node_base::_M_hook(std::_List_node_base
    )'
    /home/mitydsp/MDK_2012-03-12/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_erase(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>)':
    ipc_inbound.cpp:(.text._ZNSt4listIN7MityDSP20tcIPCInbound_private7CB_InfoESaIS2_EE8_M_eraseESt14_List_iteratorIS2_E[std::list<MityDSP::tcIPCInbound_private::CB_Info, std::allocator<MityDSP::tcIPCInbound_private::CB_Info> >::_M_erase(std::_List_iterator<MityDSP::tcIPCInbound_private::CB_Info>)]+0x1c): undefined reference to `std::_List_node_base::_M_unhook()'
    /home/mitydsp/MDK_2012-03-12/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_insert(std::_List_iterator<MityDSP::tcIPCHandler*>, MityDSP::tcIPCHandler* const&)':
    ipc_inbound.cpp:(.text._ZNSt4listIPN7MityDSP12tcIPCHandlerESaIS2_EE9_M_insertESt14_List_iteratorIS2_ERKS2_[std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_insert(std::_List_iterator<MityDSP::tcIPCHandler*>, MityDSP::tcIPCHandler* const&)]+0x3c): undefined reference to `std::_List_node_base::_M_hook(std::_List_node_base*)'
    /home/mitydsp/MDK_2012-03-12/lib/ARM/Debug/libdsp.a(ipc_inbound.o): In function `std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_erase(std::_List_iterator<MityDSP::tcIPCHandler*>)':
    ipc_inbound.cpp:(.text._ZNSt4listIPN7MityDSP12tcIPCHandlerESaIS2_EE8_M_eraseESt14_List_iteratorIS2_E[std::list<MityDSP::tcIPCHandler*, std::allocator<MityDSP::tcIPCHandler*> >::_M_erase(std::_List_iterator<MityDSP::tcIPCHandler*>)]+0x1c): undefined reference to `std::_List_node_base::_M_unhook()'
    collect2: ld returned 1 exit status
    Build error occurred, build is stopped
    Time consumed: 656 ms.

RE: DSP Hello World won't link - Added by Gregory Gluszek over 11 years ago

Hi Mary,

My guess is that somewhere (most likely your bashrc script) the environment for the old toolchain is being setup and that is why even after running the setup script for the new toolchain you still see gcc as version 4.4.3.

So, try opening your basrc script (located at ~/.bashrc) and search for a line such as ". /usr/local/angstrom/arm/environment-setup" Find that line, comment it out, and add in its place ". /usr/local/oecore-i686/environment-setup-armv5te-angstrom-linux-gnueabi" and open a fresh command prompt. Then see if gcc -v returns the proper version number.

Let us know how things turns out.

Thanks,
\Greg

RE: DSP Hello World won't link - Added by Mary Frantz over 11 years ago

Sorry, there was no such entry in ~/.bashrc nor in /etc/bash.bashrc

I think there is something amiss in my Eclipse settings. I noticed that the newer toolchain releases extract to a different directory structure than the older ones.

The gcc and g++ executables for the older versions reside in:

/usr/angstrom/arm/arm-angstrom-linux-gnueabi/bin

Whereas the new version (MAR_2012, AUG_2012) gcc and g++ reside in:

/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi

In Eclipse, I opened the Properties and went to C/C++ Build->Settings->Cross Settings and changed the Path
from
/usr/local/angstrom/arm
to
/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/

Looking in the C/C++ -> Environment, I saw the PATH variable was changed from
/usr/local/angstrom/arm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:sbin:/bin:/usr/games
to
usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr

which seems correct to me.

However, I could not compile. I got the following message in the Console:

  • Rebuild of configuration Debug for project HelloDsp **
  • Internal Builder is used for build **
    arm-angstrom-linux-gnueabi-g++ -I/home/mitydsp/MDK_2012-03-12/sw/ARM/linux/libdsp -O0 -g3 -Wall -c -fmessage-length=0 -oarm_main.o ../arm_main.cpp
    Internal Builder: Cannot run program "arm-angstrom-linux-gnueabi-g++": Unknown reason
    Build error occurred, build is stopped
    Time consumed: 9 ms.

I checked the g++ version in a terminal:

mitydsp@mitydsp-dev:~/workspace/HelloDsp$ arm-angstrom-linux-gnueabi-g++ -v

The version reported was "gcc version 4.5.4 20111126 (prerelease) (GCC)
Also, I checked the permissions which were -rwxr-xr-x (owner and group are root)

Running the compile step from the terminal worked though:

mitydsp@mitydsp-dev:~/workspace/HelloDsp/Debug$ arm-angstrom-linux-gnueabi-g++ -I/home/mitydsp/MDK_2012-03-12/sw/ARM/linux/libdsp -O0 -g3 -Wall -c -fmessage-length=0 -oarm_main.o ../arm_main.cpp

This ran and created arm_main.o

Why won't this work from Eclipse?

Mary

RE: DSP Hello World won't link - Added by Dominic Giambo over 11 years ago

Hi Mary,

Your PATH would need /usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi/ prior to running Eclipse for it to locate the compiler. I think you can also edit the C++ environment within Eclipse as you stated, but I haven't tried this myself.

The path you provided [/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin] is not specific enough to locate the compiler.

RE: DSP Hello World won't link - Added by Gregory Gluszek over 11 years ago

Hi Mary,

In Eclipse in the Properties->C/C++ Build->Settings->Cross Settings try setting Path to "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi" (And make sure that Prefix is set to "arm-angstrom-linux-gnueabi-"). This is how Eclipse is setup for me to compile with the latest toolchain.

Let us know if this gets Eclipse working for you.

Thanks,
\Greg

RE: DSP Hello World won't link - Added by Mary Frantz over 11 years ago

Almost ...

In Eclipse in Properties->C/C++ Build->Settings->Cross Settings I changed Path to "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi" as you suggested. Still did not compile.

I had to edit the C/C++ Build->Envinronment PATH variable to change it

from
/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

to

/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

There's an extra "/bin" appended from the Path entry in Cross Settings.

Now it finishes the build.
Thanks
Mary

    (1-7/7)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)