digitalmars.D.learn - How do I solve this kind of conflict?
- Marc (11/15) Jan 21 2018 I was using a Sqlite3 library then I included another library
- Adam D. Ruppe (8/10) Jan 21 2018 Just rename one of the functions. It is really bad form to have
I was using a Sqlite3 library then I included another library that started the conflict. From what I could tell, it seems it's another Sqlite3 engine that the included library uses. The link error is:.dub\build\application-debug-windows-x86-dmd_2076-E7D07B7BDA58325E30A3C637FC 43AFE\foo.obj(ytdl) Offset BA31FH Record Type 00C3 Error 1: Previous Definition Different : _callback Error: linker exited with status 1My guess is it's symbols visibility issue? and how can I solve this? But libraries has this defined:extern(C) int callback(void*, int, char** , char**){I've trid mark the one without private as such but it didn't change anything. NOTE: Albeit I'm using dub, both those libraries were included directly (except the dependences of one of them).
Jan 21 2018
On Sunday, 21 January 2018 at 16:22:33 UTC, Marc wrote:But libraries has this defined:Just rename one of the functions. It is really bad form to have extern(C) functions have a common word like this exactly because they share a namespace and make conflicts likely. I'd name one like `callback_lib_name` and the other `callback_other_lib`. You might even be able to do `alias callback = callback_lib_name;` after the definition to keep all the D code compiling with no other changes.extern(C) int callback(void*, int, char** , char**){
Jan 21 2018