Skip to content
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

openssl + std.conv = Linker error #107

Closed
trikko opened this issue Sep 14, 2023 · 6 comments · Fixed by #108
Closed

openssl + std.conv = Linker error #107

trikko opened this issue Sep 14, 2023 · 6 comments · Fixed by #108

Comments

@trikko
Copy link

trikko commented Sep 14, 2023

Reduced test:

import deimos.openssl.evp;

int bla()(string d)
{
   import std;
   SysTime.fromISOString(d);
   return 0;
}

void main()
{
   bla("");
}

Output:

/usr/bin/ld: /home/andrea/.dub/cache/error/~master/build/application-debug-Hq7anUdmLGjuab75LyZkvA/error.o: in function `_D3std4conv__T2toTkZ__TQjTAyaZQqFNaNfQlZk':
/usr/include/dmd/phobos/std/conv.d:209: undefined reference to `_D3std4conv__T6toImplTkTAyaZQoFNaNfQlZk'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
Error /usr/bin/dmd failed with exit code 1.
@trikko
Copy link
Author

trikko commented Sep 14, 2023

Reduced:

main.d

import test;

int main() {return 0;}

auto blabla(string d) {
   import std;
   SysTime.fromISOString(d);
}

test.di:

module test;

enum XXX = bla("1.1");

int bla()(string s)
{
   import std;
   s.splitter('.').front.to!uint;
   return 0;
}

dmd -i main.d

@CyberShadow
Copy link
Member

Well, it's a DMD bug. Please file this to https://issues.dlang.org/ too.

We can try a workaround here (e.g. avoid using Phobos).

@trikko
Copy link
Author

trikko commented Sep 14, 2023

Why only if test.di and not test.d?

@CyberShadow
Copy link
Member

Such is bug.

We use .di to avoid having to link the bindings, so it is "header-only". But this is not used often and therefore bugs happen.

@trikko
Copy link
Author

trikko commented Sep 14, 2023

https://issues.dlang.org/show_bug.cgi?id=24146

@CyberShadow
Copy link
Member

@trikko Can you test if #108 fixes building your real (non-reduced) project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants