D is a great language, but I've had a bad experience getting started

Renato renato at athaydes.com
Thu Dec 14 13:27:29 UTC 2023


On Thursday, 14 December 2023 at 13:12:06 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> On 15/12/2023 2:02 AM, Renato wrote:
>> How do you tell dub to "build and link in a single step"?
>
> This should do it:
>
> ``--combined --build-mode=allAtOnce``

I run this:

```
dub build --combined --build-mode=allAtOnce
```

Still got an error:

```
cc 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o -o /Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject -g -m64 -Xlinker -no_compact_unwind -ld_classic -L/Library/D/dmd/lib -lphobos2 -lpthread -lm
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: pointer not aligned at address 0x1000741C9 ('anon' + 
457 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x1000741E6 ('anon' + 
486 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x1000742C9 ('anon' + 
713 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x100074311 ('anon' + 
785 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x100074367 ('anon' + 
871 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x1000743A2 ('anon' + 
930 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x1000743BE ('anon' + 
958 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: warning: pointer not aligned at address 0x1000743FA ('anon' + 
1018 from 
/Users/renato/.dub/cache/myproject/~master/build/application-debug-tVTrfpmFVmiMN6SGvTQC-w/myproject.o)
ld: unaligned pointer(s) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
Error: linker exited with status 1
Error /Library/D/dmd/bin/dmd failed with exit code 1.
```


cc version:

```
cc --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin23.1.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```

Not sure that the options are correct: "-Xlinker 
-no_compact_unwind -ld_classic -L/Library/D/dmd/lib -lphobos2 
-lpthread -lm".

My build options are currently:

```
     "dflags-dmd": [ "-v"],
     "lflags": ["-ld_classic"]
```

I tried some variations but nothing worked.



More information about the Digitalmars-d-learn mailing list