This is the first time that I created a dynamic library in linux and although the program works, I do not get the correct information about the library when executing ldd.
I explain the details:
1) Source code:
bye_fn.c:
#include <stdio.h>
#include "hello.h"
void bye (const char* name)
{
printf ("\n\n%s, I see you soon !\n\n", name);
}
#include "hello.h"
#include <stdio.h>
int main (void)
{
hello ("Jos�");
printf ("Please to meet you. You will work with us. You start next week. Congratulations !\n");
bye ("Jos�");
return 0;
}
2) Steps followed to obtain the shared library and the executable program:
It's not moralistic. It breaks assumptions built into the linking system, may pollute caches, and very likely isn't portable. What will happen is implementation-dependent. The behavior you get after cd can be surprising, and some systems may refuse relative paths outright.
Let me put it this way: Putting . and .. in PATH also causes real issues in a shell. These paths are supposed to be absolute. When they're not, the cache the shell uses for tab completion may get confused, as now needs to dump it every time you cd and may not do so. A false positive or negative in tab completion is just annoying, in loading libraries it may actually break something.
Just because you can do something doesn't mean it will work the way you think it will, and just because you can do something doesn't make it a smart idea.