Sorry if this question is asked for different places (but the main question should be different with other).
Actually this is a module problem, I already opened the issue here https://github.com/SSPkrolik/nimongo/issues/42
but looking for error message, the multiple definition of... was caught my attention.
After reading a bit of nimongo/mongo.nim, it defined init as method and it was overloaded.
My GCC version is 4.9.2 on Debian Jessie, I tried with different version of Nim using choosenim (thanks @dom :) ), it's same.
The error message is:
/home/rahma/nim/nimcache/nimongo_auth.o: In function `nimongo_authInit000':
nimongo_auth.c:(.text+0x97): multiple definition of `nimongo_authInit000'
/home/rahma/nim/nimcache/nimongo_auth.o:nimongo_auth.c:(.text+0x97): first defined here
/home/rahma/nim/nimcache/nimongo_auth.o: In function `nimongo_authDatInit000':
nimongo_auth.c:(.text+0xd0): multiple definition of `nimongo_authDatInit000'
/home/rahma/nim/nimcache/nimongo_auth.o:nimongo_auth.c:(.text+0xd0): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/home/rahma/nim/nimcache/nimongo_mongo.o: In function `newMongo_KMrCR5eKpKUfDf4DP9a5i1Q':
nimongo_mongo.c:(.text+0x435): undefined reference to `init_C5TJYGhjrn3WAZC436gFrQ'
/home/rahma/nim/nimcache/nimongo_mongo.o: In function `newMongoWithURI_l1RGvNbDzWJyW54OYFA1rQ':
nimongo_mongo.c:(.text+0x536): undefined reference to `init_wc5Ol0q7KfDiv1xe661FtA'
/home/rahma/nim/nimcache/nimongo_mongo.o: In function `newAsyncMongo_nMYNEvG9apPbjHuKZBtseLQ':
nimongo_mongo.c:(.text+0xce9): undefined reference to `init_C5TJYGhjrn3WAZC436gFrQ'
/home/rahma/nim/nimcache/nimongo_mongo.o: In function `newAsyncMongoWithURI_ysEbTZ9c6ZNldeQOVtKHV9aw':
nimongo_mongo.c:(.text+0xf0c): undefined reference to `init_wc5Ol0q7KfDiv1xe661FtA'
/home/rahma/nim/nimcache/nimongo_clientbase.o: In function `init_IG9a9ajkUBDcc65sXE6JOxTQ':
nimongo_clientbase.c:(.text+0x728): undefined reference to `init_C5TJYGhjrn3WAZC436gFrQ'
collect2: error: ld returned 1 exit status
My question, is this bug method or it failed because I used older GCC? (on Windows, I used mingw-w64 and GCC 7.2.0, it compiled and worked fine)
Thank you in advance
Edit: I just realized there's authInit part in that message, I actually have another problem too with authentication from nimongo, I guess it's correlated. I'll look more for more info.
That makes sense. I'll try it first.
Thank you.
EDIT: I tried with newer version GCC in Linux Mint and it compiled fine, (it's version 5 iirc). From the error message it should be obvious and might be I missed some silly steps :( .
Any advice would be appreciated.
This is really silly, I named my file with nimongo_auth.nim while nimongo has inner module named auth.nim. Hence I got multiple definition.
Many thanks for help.