-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to compile external files with same name as module. #3072
Comments
It's resulting from the C file having the same name as the Nim file "test." This is probably an error. FYI: the "test.nim" file is compiled down to "test.c". The compiler is probably mixing up that file with your own "test.c" |
Oh! You are right, It's ok now, Thank you. |
Could you reopen it? Maybe make the title something like "Unable to compile external files with same name as module." You found a good issue. I don't think it's addressed anywhere. |
Would a simple fix be to compile |
+1 -- just hit this, and seems important for scalability: if you have a large tree of modules from various sources, its alot of coupling to force all modules to share the same namespace regardless of path. Also, this is probably important for nim-lang/nimble#131 |
@shaunc any ideas for a solution? |
@Varriount -- name munging? Perhaps simplest would be just to have a counter for each module and prefix or suffix that counter to the module name, then rewrite references to it. This is the approach that babel uses to transpile es6 imports to es5 in javascript. |
The compiler uses |
@Araq -- the thrust of nim-lang/nimble#131 (as I would like to see it anyway) is to avoid any unnecessary coupling between package version decisions. (There is necessary coupling, sometimes -- enforceable with something like npm/peerDependencies.) So if package Is there a mechanism to manage this ( |
Well I left the issue open for a reason. |
Thanks so much for nim! :) ... I'm learning nim because I need to write a custom index library for in-memory distributed analytics. Not anything I should do in js or python and this seems way faster than c++ development. "Scalability" in terms of hoards of developers working simultaneously on 1000s of projects is a problem I wish on you. :) |
Works in Nim 0.19.9 |
Awesome! :) |
Hi, I learn it write some code.
C invocation example
I don't know why build it error, I use nim 0.11.2 at osx 10.10 (rmbp13).
Echo error:
But this code can be compiled successfully.
The text was updated successfully, but these errors were encountered: