Hi there,
Currently I'm using Nim to create multiple static libraries which will be used in a bigger project based in C/C++. Right now, every static library has it's own "NimMain" function and linking multiple libs in the same project causes a symbol conflict. I know the recommended way is to import all nim libs into a project and export it as a lib but that's not always convenient. (Different projects use different libs).
It'd be great if Nim has an option flag to rename the "NimMain" function to something along the lines of "libname_NimMain" so that every library has it's own "NimMain" function and they all can be linked without issues.
pass --noMain option when compiling.
You can see the complete option by invoking nim --fullhelp (or nim --advanced )
even with the new 1.6.2 and the new compile switch that it brought (--nimMainPrefix:MyLib), i had to use:
--passl:-Wl,--allow-multiple-definition
I have a related issue open: https://github.com/nim-lang/Nim/issues/11406#issuecomment-955931469
Instead of static libs, my purpose is to generate multiple Nim compiled .so files (--app:lib) and link them in a C++ codebase, and I am unable to do that so far.