[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
newbie to g++
From: |
address@hidden |
Subject: |
newbie to g++ |
Date: |
Sat, 03 Nov 2007 10:37:22 -0700 |
User-agent: |
G2/1.0 |
hi i am using g++ on windows and trying to learn c,c++..
i was trying to make and use user defined libraries and wrote
tom.h
---------
void mylibfn(void);
tom.c
--------
void mylibfn(){
printf("my libfn called!\n");
}
then i made tom.o by
g++ -c tom.c
and using ar qv libfruit.a tom.o i created libfruit.a
i wish to call the mylibfn() from another test.c like
test.c
--------
int main(){
mylibfn();
}
how do i compile test.c using g++ ,giving the libfruit.a as argument ?
for the cc compiler it is something like
cc test.c -lfruit -L/home/sharedlib .. but i am bit confused by g++
options..
can anyone help?
dn
- newbie to g++,
address@hidden <=