Linker problems in Performer

New Message Reply Date view Thread view Subject view Author view

Torbjörn Håkansso (torbjorn.hakansson++at++telia.com)
Thu, 13 May 1999 11:15:26 +0200


Hi all pf Users

First I have to tell that I am not a very skilled Unix programmer.

I wonder if somebody can help me with a problem.

First i wonder if it is possible to mix libary functions,
I have Written in C in my C++ Performer App.

I have written some code in C which connect and init my Flock of Birds
from Ascension, a function that reads the data from every sensor
and convert it to meters and Radians

This code have I compiled whit the syntax Extern "C" in my header files,
It works Okay in a normal C++ program,

I compile it with:
CC -c -D_OLD_TERMIOS -Xcpluscomm -DIRIX mymain.C

And I link it to a main-program with

CC -o main mymain.o libAscBird.a -lm -v

there libAscBird.a is my lib whit all functions.
This program works good.

The problem starts when I try to use the same C++ file in Performers
Makefile, I get unresolved symbols from the linker,
I have tried to understand the Performers Makefile and pfmakedefs and pfmakerules

Where shall I include my lib - libAscBird.a file in the three files(Makefile,pfmakedefs,pfmakerules)

My Headerfile mybird_func.h :

#ifndef MYBIRD_FUNC
#define MYBIRD_FUNC

#ifdef __cplusplus
extern "C" {
#endif

int init_flock_of_birds(void);
int myreadbirddata (short * birddata,short numwords,short outputmode,short buttonmode,unsigned char addr);
int mygetmultirecords(short outputmode, short buttonmode, unsigned char datamode, unsigned char startaddr,
      unsigned char stopaddr, unsigned char *birddata);

#ifdef __cplusplus
} /* end of C++ linkage */
#endif

#endif /* MYBIRD */

I get this linker errors , only when I use Performers Makefile

Unresolved text symbol "init_flock_of_birds(void)"
-- 1st referenced by mymain.o.
Unresolved text symbol "mygetmultirecords(short,short,unsigned char,unsigned char,unsigned char,unsigned char*)"
-- 1st referenced by mymain.o.

I hope there is somebody who have a solution to my problem.

Thanks in advance

********************************************************************
Torbjörn Håkansson Multimedia Student - Lunds University

URL: http://www.hbg.lth.se/~m96tha
Mail : torbjorn.hakansson++at++telia.com
Phone: +46-(0)40-320595
ICQ: 281022
********************************************************************


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu May 13 1999 - 02:15:18 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.