creating/linking library

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

 



I have a cpp file in which the function Open() is declared:

Open(int x)
{
do some stuff with x;
}

I want to compile this as a so.  So I have this:

lnx626.o:  lnx626.cpp
    g++ -fPIC -c -O -Wall lnx626.cpp
    g++ -shared -Wl,-soname,lib626.so -o lib626.so lnx626.o


I then have my program test which has
Open(1);

in main();

I want to dynamically link the so file and have this:
test626: 626test.o
    g++ -O -lpthread  -Wall -o test626 626test.o -L./ -l626

why do I still get an undefined reference to Open(int)?

TIA

-- 
Best regards,
David Stroupe
Keyed-Up Software 


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux