# Execution problem with Libtool Versioning control

**URL:** <https://community.unix.com/t/execution-problem-with-libtool-versioning-control/326898>\
**Category:** Programming\
**Created:** [April 10, 2013, 3:09am UTC](https://community.unix.com/t/execution-problem-with-libtool-versioning-control/326898 "2013-04-10T03:09:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parameswaran](https://community.unix.com/letter_avatar/parameswaran/32/6_449c533f586939b6e5f246632a46421f.png) [@Parameswaran](https://community.unix.com/u/Parameswaran)\
**Post date:** [April 10, 2013, 3:09am UTC](https://community.unix.com/t/execution-problem-with-libtool-versioning-control/326898/1 "2013-04-10T03:09:15Z")

</div>

Hi,

Is anybody familiar with libtool could explain me the following issue.?

I've created a small factorial program(fact\_impl.c, fact\_appln.c & fact.h) in order to know about this libtool.

\>\>\> fact.h

#include\<stdio.h\>  
#include\<math.h\>

extern unsigned int fact\_num(unsigned int num);

\>\>\> fact\_impl.c

#include "fact.h"  
unsigned int fact\_num(unsigned int input)  
{  
if(input==1)  
{  
printf("------Facttial----------\n");  
return 1;  
}  
else  
return(input \* fact\_num(input-1));  
}

\>\>\> fact\_appln.c

#include "fact.h"  
int main()  
{  
unsigned int input;  
printf("\n------------------------------------------\n");  
printf("Enter the Number : ");  
scanf("%u", &input);  
printf("Factorial is : %u\n", fact\_num(input));  
printf("------------------------------------------\n");  
return 0;  
}

These are the steps which followed to create the executables:

$libtool --mode=compile gcc -g -O -c fact\_impl.c  
$libtool --mode=compile gcc -g -O -c fact\_appln.c  
\> \*.lo will be created.

libtool --mode=link gcc -version-info 1:0:0 -o libfact.la -rpath /home/paramesh/libtool fact\_impl.lo

\> \*.la will be created.

libtool --mode=link gcc -g -O -o fact fact\_impl.o fact\_appln.o libfact.la

\> exe will be created.

Now, my ques is I include some changes to the library and compile fact\_impl.c with lots of versions like, 2.0.0 & 3.0.0 & 4.0.0. Then how to make the application query to get a specific version (i.e) when I'm using the latest version 4.0.0, I'm in need to switch to 2.0.0, In tat case how to link the application to the version 2.0.0.?

Thanks in Advance.!!
