linking an application to the driver in qnx 4

hello all,

i have the following problem in linking an application to the driver that is
running at the back end…

my code is in such a way like…

i hav 4 programs in all…one to configuration of the pci regs,one having
the defnition of library functions,one with interrupt handling,one
application.

i have generated a .lib file using
cc -A <pcimain.o ISR.o pcilib.o>

and then i am linking the application using the following syntax…

cc -o -l

now it is generating an application that doesnt run but it is generating the
following warning message…


warning(1027):file LIB.lib (/pcimain.c): redefinition of main_ ignored…

here LIB.lib is the library file i am generating and pcimain.c is the
program where i configure the pci registers and contaions a main .the other
main is in the application program.

is there any thing wrong with this procedure if so what is the way i am
supposed to proceed.

thnaking you in advance,
kalyan.

kalyano <kalyano@rediffmail.com> wrote:
[…]

here LIB.lib is the library file i am generating and pcimain.c is the
program where i configure the pci registers and contaions a main .the other
main is in the application program.

You only can have ONE main module in a C-programme, it’s the
‘starting point’. If you want to have a kind of initialization
routine, that is call at the very beginning of your ‘real’ main(), you
have to give it another name (e.g. pciinit()) and start it quite
early in your main() routine.

HTH,

:Karsten.


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld