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

multiple dynlib pragmas with function calls conflict with each other causing link time error #9222

Closed
cooldome opened this Issue Oct 6, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@cooldome
Copy link
Member

cooldome commented Oct 6, 2018

You need at least two modules to demonstrate the issue, so I'll just describe it.

proc findlib: string = 
  ...

proc imported_func(a,b: cint) {.importc, dynlib: findlib().}

Compiler is using a global temp string to hold the result of the findlib invocation. If you have several modules using different libraries with different findlib functions, you will get a link time error saying that that you have multiple definitions of the same global variable _T1

I will submit a PR. The fix is to use local variable.

cooldome added a commit to cooldome/Nim that referenced this issue Oct 6, 2018

@Araq Araq closed this in 036c52f Oct 9, 2018

krux02 added a commit to krux02/Nim that referenced this issue Oct 15, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Oct 31, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

fixes #9222 (#9224)
(cherry picked from commit 036c52f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment