0

I am new to linux compiling an opensource shared library.

after I downloaded, let say gTest from google, I unzipped the folder.

cd gtest.x.x.x

then

configure

then I did,

make all

a bunch of compilation, then linking is expected, am I right?

and then after the make all is over, I checked lib folder, to just find

libgtest.la and libgtest_main.la

  1. is my expectation on the spot, or I am missing something?
  2. after a good compilation, or successful one, the library is ought to be fund in the folder lib, isn't?
  3. what should I do now, and how to find out what I did wrong?

I should expect .so file, NOT .la

Edit, when I do make install I get the following output: 'make install' is dangerous and not supported.

aah134
  • 860
  • 12
  • 25
  • please specify full pathnames, since multiple /lib libraries might exist – hetepeperfan Dec 20 '13 at 13:59
  • Also `make install` as root installs the library and don't forget to run `ldconfig` also as root, if you are not root you can use the LD_LIBRARY_PATH variable to specify where your libraries are. Also `./configure --help` might give output with extra configuration options. – hetepeperfan Dec 20 '13 at 14:02
  • read GTest's readme for help. You may also consider cmake usage which AFAIR can be more userfriendly. Anyway from my experience with GTest, using .a libraries is better idea tha .so usage – Michał Walenciak Dec 20 '13 at 14:17
  • the make install get me a message, saying it is a bad practice to do so, the /lib is in gtest, gtest/lib – aah134 Dec 20 '13 at 14:39
  • I am starting to learn CMake, not fully experienced with it yet – aah134 Dec 20 '13 at 14:40

2 Answers2

1

*.la objects are libraries too that's why you can find them in the lib folder. But they aren't shared. *.so (so stands for Shared Object).

When you run the rule all (make all) or just make. You are ordering to the make command that runs all rules as are written in to the Makefile file.

In this file(there are others, like CMakeList, etc ...) is where developers write (among others things) how should the program/library compile and link. So, if the Makefile, by default compile gTest libraries as static (I think that is the case) you don't will find any *.so .

Try adding the --shared flag when building the libraries. Also you should read some info about gTest and find out if the authors put it that way because an specific reason.

Raydel Miranda
  • 13,825
  • 3
  • 38
  • 60
1

the library fiels that contains .sc files and so ar in a hidden folder inside lib folder.

after make all go the following path

libraryProject/lib/.lib

there is a hidden lib folder inside lib folder.

gtest/lib/.lin/libName.so

aah134
  • 860
  • 12
  • 25