Building dynamic library: undefined references (Linux) #4775

Closed
nigredo-tori opened this Issue Sep 15, 2016 · 1 comment

Projects

None yet

2 participants

@nigredo-tori
Contributor
nigredo-tori commented Sep 15, 2016 edited

Here's the gist with a simple project: https://gist.github.com/nigredo-tori/9f774894c38f7a6a607270a6a456ea20 (run test.sh to reproduce the issue)
I build a Nim file as a dynamic library, and use it from the C file. However, the linker fails:

./libfoo.so: undefined reference to `cmdCount'
./libfoo.so: undefined reference to `cmdLine'
collect2: error: ld returned 1 exit status

This seems to be triggered by importing the logging module. Emitting code that defines the corresponding C variables allows to work around the issue.

@vegansk
Contributor
vegansk commented Dec 22, 2016

The problem is in os module that exposes paramStr and paramCount functions when it shouldn't

@Araq Araq closed this in d35a8fa Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment