digitalmars.D.learn - Does betterC work different on windows and linux?
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (2/2) Nov 14 2019 I was trying to make my stupid writeln2 function
- kinke (3/3) Nov 14 2019 I can't reproduce this with LDC 1.17.0, after changing `unittest`
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (6/9) Nov 14 2019 I could also run the code in that way. Probably I have some
- kinke (6/11) Nov 14 2019 The -betterC for that app doesn't imply that its dependencies are
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (3/7) Nov 14 2019 Thank you, I added some information to the repo to use
I was trying to make my stupid writeln2 function (https://github.com/aferust/stringnogc/blob/master/source/stringnogc.d) compatible with betterC. writeln2() calls obParse() function which may contain some code incompatible with betterC. However; while the code in the unittest can be compiled and linked with betterC (extern (C) main...) on Ubuntu (LDC 1.17.0), it causes linking errors on windows (LDC 1.17.0): unresolved external symbol _D15TypeInfo_Struct6__vtblZ... I know that TypeInfo and ModuleInfo features are unavailable with betterC. I want to know why my obParse() function compiles and links on ubuntu but not on windows, and which part of my code requires runtime.
Nov 14 2019
I can't reproduce this with LDC 1.17.0, after changing `unittest` to `extern (C) int main()` and returning 0 at the end; compiled & linked with `ldc2 -betterC stringnogc.d`.
Nov 14 2019
On Thursday, 14 November 2019 at 16:12:19 UTC, kinke wrote:I can't reproduce this with LDC 1.17.0, after changing `unittest` to `extern (C) int main()` and returning 0 at the end; compiled & linked with `ldc2 -betterC stringnogc.d`.I could also run the code in that way. Probably I have some problems with dub configurations. I get linking errors when I try to import the library in a newly created dub project, although there is "dflags": ["-betterC"] in the dub.json of client app. Then we can be sure that it supports betterC.
Nov 14 2019
On Thursday, 14 November 2019 at 16:34:07 UTC, Ferhat Kurtulmuş wrote:I could also run the code in that way. Probably I have some problems with dub configurations. I get linking errors when I try to import the library in a newly created dub project, although there is "dflags": ["-betterC"] in the dub.json of client app. Then we can be sure that it supports betterC.The -betterC for that app doesn't imply that its dependencies are compiled with -betterC too. So either also specify that flag in your library's dub config, or build the app with `DFLAGS=-betterC dub ...`.
Nov 14 2019
On Thursday, 14 November 2019 at 16:47:59 UTC, kinke wrote:The -betterC for that app doesn't imply that its dependencies are compiled with -betterC too. So either also specify that flag in your library's dub config, or build the app with `DFLAGS=-betterC dub ...`.Thank you, I added some information to the repo to use subConfigurations for betterC.
Nov 14 2019