Re: What is this undefined reference with -betterC about?

2021-06-16 Thread jfondren via Digitalmars-d-learn
On Wednesday, 16 June 2021 at 16:27:13 UTC, Dennis wrote: On Wednesday, 16 June 2021 at 14:38:10 UTC, jfondren wrote: What do I change to 1. a script like this that uses hostname 2. the hostname module so that both can be built with -betterC when and only when the script is using -betterC?

Re: What is this undefined reference with -betterC about?

2021-06-16 Thread Dennis via Digitalmars-d-learn
On Wednesday, 16 June 2021 at 16:27:13 UTC, Dennis wrote: It has to be a linker error, dmd cannot know at the time of compiling project A how project B is going to be compiled and vice versa. Well I suppose you could use a specific dub configuration, maybe giving 'hostname' a targetType

Re: What is this undefined reference with -betterC about?

2021-06-16 Thread Dennis via Digitalmars-d-learn
On Wednesday, 16 June 2021 at 14:38:10 UTC, jfondren wrote: What do I change to 1. a script like this that uses hostname 2. the hostname module so that both can be built with -betterC when and only when the script is using -betterC? That's currently the situation: you can only build when both

Re: What is this undefined reference with -betterC about?

2021-06-16 Thread jfondren via Digitalmars-d-learn
On Wednesday, 16 June 2021 at 14:21:40 UTC, jfondren wrote: Why isn't this linking? OK, with verbose commands I see that libhostname.a is built without -betterC So that's why this fails to link. What do I change to 1. a script like this that uses hostname 2. the hostname module so that

What is this undefined reference with -betterC about?

2021-06-16 Thread jfondren via Digitalmars-d-learn
Here's a complete script that you can run right now, using a dub module that I just updated: ```d #!/usr/bin/env dub /+ dub.sdl: dependency "hostname" version="~>0.1.1" buildOptions "betterC" +/ extern(C) void main() { import hostname : hostnamez; import core.stdc.stdio :