Skip navigation.
Home
The QNX Community Portal

View topic - Having Trouble Building SPI Test Program

Having Trouble Building SPI Test Program

For discussion of realtime and/or embedded programming.

Having Trouble Building SPI Test Program

Postby jewdongkuo » Wed Aug 19, 2009 10:05 pm

Hello,

I am trying to port MPC8349 SPI driver to MPC8360E. I have created the SPI test application. The thing is the build complained about anything to do with spi_xyz, e.g. "undefined reference to `spi_open(char const*), spi_read, spi_close, spi_xchange, ..."

I have included the spi header to the c file:

#include <../../BSP/prebuilt/usr/include/hw/spi-master.h>

I think I need to link with a static library. But where can I get the SPI library?

Thanks,
Jew-Dong
jewdongkuo
New Member
 
Posts: 7
Joined: Mon Jul 20, 2009 11:03 pm

How Do I Get SPI Test Program to Link with SPI Library?

Postby jewdongkuo » Thu Aug 20, 2009 12:28 am

This may sound like simple, but it does not build in my environment. My SPI test program does the following:

main()
{
spi_open()
spi_xchange()
spi_close()
}

I am using QNX 6.41:

1. To be sure, I specifically copied the PowerPC libspi-master.a and libspi-masterS.a to both of C:/QNX641/target/qnx6/ppcbe/ and C:/QNX641/target/qnx6/ppcbe/usr/lib directories, which are supposed to the default directories.

2. I then specified extra libraries llibspi-master.a under Properties/QNX C/C++ Project/Linker tab.

The build failed.

ntoppc-ld: cannot find -lllibspi-master.a

What could be wrong? I have attached the detailed build log below.

Thanks,
Jew-Dong

C:\QNX641\host\win32\x86\usr\bin\make -k all --file=C:/DOCUME~1/CONFER~1/LOCALS~1/Temp/QMakefile125072704337535293.tmp
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Cppc -fMakefile all
make[1]: Entering directory `C:/Multibeam/Gen4/Firmware/SPITest/ppc'
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co-be -fMakefile all
make[2]: Entering directory `C:/Multibeam/Gen4/Firmware/SPITest/ppc/o-be'
C:/QNX641/host/win32/x86/usr/bin/rm -f C:/Multibeam/Gen4/Firmware/SPITest/ppc/o-be/SPITest
C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntoppc -Wl,--no-keep-memory -lang-c++ -lang-c++ -oC:/Multibeam/Gen4/Firmware/SPITest/ppc/o-be/SPITest SPITest.o -L . -L C:/QNX641/target/qnx6/ppcbe/lib -L C:/QNX641/target/qnx6/ppcbe/usr/lib -Wl,--rpath-link . -Wl,--rpath-link C:/QNX641/target/qnx6/ppcbe/lib -Wl,--rpath-link C:/QNX641/target/qnx6/ppcbe/usr/lib -Bstatic -lllibspi-master.a -Bdynamic -EB
C:\QNX641\host\win32\x86\usr\bin\ntoppc-ld: cannot find -lllibspi-master.a
make[2]: Leaving directory `C:/Multibeam/Gen4/Firmware/SPITest/ppc/o-be'
jewdongkuo
New Member
 
Posts: 7
Joined: Mon Jul 20, 2009 11:03 pm

Problem Solved

Postby jewdongkuo » Thu Aug 20, 2009 6:19 pm

The problem is resolved. This is due to name mangling in C++. The library is done in C.

Thanks,
Jew-Dong
jewdongkuo
New Member
 
Posts: 7
Joined: Mon Jul 20, 2009 11:03 pm

Re: Having Trouble Building SPI Test Program

Postby pauloqnx » Thu Aug 15, 2013 8:34 pm

I have the same problem!

How you resolved this problem?
pauloqnx
New Member
 
Posts: 3
Joined: Thu Aug 15, 2013 8:31 pm

Re: Problem Solved

Postby pauloqnx » Thu Aug 15, 2013 8:35 pm

jewdongkuo wrote:The problem is resolved. This is due to name mangling in C++. The library is done in C.

Thanks,
Jew-Dong


I have the same problem!

How you resolved this problem?
pauloqnx
New Member
 
Posts: 3
Joined: Thu Aug 15, 2013 8:31 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 2 guests