I would like to include two different dlb files... the problem is that some functions are defined in each of them.
Is there a way to include both .dlb files and ingnore the multiple definition of the same function ?
It is fine for the same symbols to be defined within a library, as the Linker will take the first one it comes to. however, problems occur when the redefinition is within a single object.
Say you have functions a(), b() and c(). Object1.doj defines a() and b(), object.doj 2 defines b() and c(). If your application only makes use of a() or c(), the Linker will use the appropriate object for the link, and can also do the same if you use 'a() and b()' or 'b() and c()'.
If your application makes use of b() only, then the Linker will use the first object it comes to that defines that symbol and will disregard any other definition (though it will report in the Linker Log file that it has found more than one definition, and which one it has selected).
The problem comes when you use all three. The linker brings Object1.doj in to resolve a() and b(), then brings Object2.doj in to resolve c(), but it now has two instances of b() and cannot make a decisions which definition is 'correct'.
You will need to refactor your library so that such duplications will never happen. For example, you could restrict each source file to define a single function.
I would also recommend enabling Linker Elimination, and the option to 'Individually map functions and data items'.
Thank you Craig.
Unfortunately, the dlb files are from Dolby, so they are secret. I cannot go inside them and remove some functions...
I tried your suggestions :
Linker Elimination and Individually map functions and data items... it did not work.
Are they libraries from the Dolby software modules we provide?
Can you provide details of the error message(s), so we can see the specific symbols that are causing the problem.
Unfortunately the Linker cannot take any other steps - if it is provided with two conflicting symbols it would not be safe for it to arbitrarily decide which is the 'correct' definition.
Librairies are from Analog Devices indeed.
They are libadi_ac3_decoder_214xx.dlb and libadi_ddp_decoder_214xx.dlb.
The symbols have strange names, such as gAABYXXXXXXXXXXXXXXXXXXX, gAACHXXXXXXXXXXXX...
[Error li1050] 'gAAAYXXXX': Multiply defined symbol in processor 'p0'.
Initial definition: '.\src\libs\dec_lib\dec\ac3\libadi_ac3_decoder_214xx.dlb[ac3d_core_tables_common.doj]'
Attempted redefinition: '.\src\libs\dec_lib\dec\ddp\libadi_ddp_decoder_214xx.dlb[abkd_utl.doj]'
I have moved this question to the Software Modules and SDKs community, as they will need to advise further.
The symbol names above are encrypted symbol names generated by the Archiver, typically used in order to obfuscate the inner workings of a library by hiding meaningful function names.
Can I ask why you are using both ac3_decoder and ddp_decoder libraries in your project ?. ddp_decoder should be sufficient to decode AC-3 streams as well.
Retrieving data ...