Re: Does betterC work different on windows and linux?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

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.


Re: Does betterC work different on windows and linux?

2019-11-14 Thread kinke via Digitalmars-d-learn
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 ...`.


Re: Does betterC work different on windows and linux?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

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.


Re: Does betterC work different on windows and linux?

2019-11-14 Thread kinke via Digitalmars-d-learn
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`.


Does betterC work different on windows and linux?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
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.