[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

g++ and ar



Hi all,

I am developing an applications using g++. I am also generating a library of
classes that I will be reusing. I use the following commands to compile and
archive a library class:

gandalf {/development/projects/link/Isys/CIsysSocket} $make
g++ -D _GNU_SOURCE -D _REENTRANT -c -g -o ./MyClass.o -I. -I../include
./MyClass.cxx
ar -sru ../lib/libMyClasses.a *.o

When I compile my application against MyClasses it does not find the class
members defined in MyClass.cxx. If I compile against MyClass.o then
everything works ok.

If anyone can tell me what I'm doing wrong, I'll stand them a beer (or 2)
the next time they're in Chile.

TIA

    __ _    Debian GNU User
   / /(_)_ __  _   ___  __   Simon Martin
  / / | | '_ \| | | \ \/ /   Project Manager
 / /__| | | | | |_| |>  <    Isys
 \____/_|_| |_|\__,_/_/\_\   mailto: smartin@isys.cl


Reply to: