J
joseluismarchetti
Hello everybody,
Although I am sure this is an important question for this group, I
am not sure this question belongs to this group and I will be
happy to move it to the correct one after you point it to me.
Direct question:
How can I know if a function is defined in more than one static
library that I am using to link ?
More information:
We have a huge project with about 40 libraries, some of them are
third part libraries.
One day, when I got a new third part library release, I luckly
started getting a link error because a function called FileExists
was being defined in two libraries.
I said luckly because if I invert the order that the libraries are
being linked, I could not see the error and in that case who knows
what funcion was being used.
( of course I know, but it might be the wrong one and the problem
might showup two months from now and it must not show up )
The problem I am trying to avoid is: having two functions in two
different libraries with the same name, in this case, the function
that will be linked depend on the position of the libraries in the
link command.
I know that this is the beaulty of libraries, that we can override
functions, but I would like to be aware that this situation is
happening.
Also I know that is common sense that the libraries should have a
prefix in their name function, like the foo.lib should have
function names as foo_function1 or something like that, but this
is a convention and that can fail when using third part libraries.
Also can be argued that I should know the function names in the
libraries, but in this project we are talking about of thousands
of functions, lots of them are bought without source code, so it
is not pratical to do so, but even if this was pratical I would
like to have a computer checking to me.
I looked into my link for any option that would do that and I
could not find ( for references I use the ADS arm toolkit )
The ideal solution would be having a utility that will check the
libraries for me, or something else with the same idea.
I work in this area for many years and never thought about this
problem, until it bit me and know I think this is a problem that
could bite anyone, but I am not finding answers until now.
Please let me know if you need more information and any comments
are welcome.
Thanks in advance
Jose Luis Marchetti
Although I am sure this is an important question for this group, I
am not sure this question belongs to this group and I will be
happy to move it to the correct one after you point it to me.
Direct question:
How can I know if a function is defined in more than one static
library that I am using to link ?
More information:
We have a huge project with about 40 libraries, some of them are
third part libraries.
One day, when I got a new third part library release, I luckly
started getting a link error because a function called FileExists
was being defined in two libraries.
I said luckly because if I invert the order that the libraries are
being linked, I could not see the error and in that case who knows
what funcion was being used.
( of course I know, but it might be the wrong one and the problem
might showup two months from now and it must not show up )
The problem I am trying to avoid is: having two functions in two
different libraries with the same name, in this case, the function
that will be linked depend on the position of the libraries in the
link command.
I know that this is the beaulty of libraries, that we can override
functions, but I would like to be aware that this situation is
happening.
Also I know that is common sense that the libraries should have a
prefix in their name function, like the foo.lib should have
function names as foo_function1 or something like that, but this
is a convention and that can fail when using third part libraries.
Also can be argued that I should know the function names in the
libraries, but in this project we are talking about of thousands
of functions, lots of them are bought without source code, so it
is not pratical to do so, but even if this was pratical I would
like to have a computer checking to me.
I looked into my link for any option that would do that and I
could not find ( for references I use the ADS arm toolkit )
The ideal solution would be having a utility that will check the
libraries for me, or something else with the same idea.
I work in this area for many years and never thought about this
problem, until it bit me and know I think this is a problem that
could bite anyone, but I am not finding answers until now.
Please let me know if you need more information and any comments
are welcome.
Thanks in advance
Jose Luis Marchetti