dlang-community / std_data_json

Phobos candidate JSON implementation.
25 stars 13 forks source link

fails to compile with inlining on posix systems #7

Closed Herringway closed 9 years ago

Herringway commented 9 years ago

Attempting to compile even the simplest code using this library fails due to linker errors if the inlining option is added to dmd on either Linux or FreeBSD. This affects the release and profile build options in dub by default. Example:

import stdx.data.json;

void main() {
        string str = `{"a": true, "b": "test"}`;
        JSONValue v = parseJSONValue(str);
}

fails with

.dub/build/application-release-posix.freebsd-x86_64-dmd_2067-A056613BD4BD627CC6BA6DF5C9D50B30/jsontest.o: In function `_D4stdx4data4json6parser209__T14parseJSONValueTS4stdx4data4json5lexer147__T14JSONLexerRangeTAyaVE4stdx4data4json5lexer10LexOptionsi0S83_D4stdx4data4json5lexer10__lambda41MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ14JSONLexerRangeZ14parseJSONValueFNfKS4stdx4data4json5lexer147__T14JSONLexerRangeTAyaVE4stdx4data4json5lexer10LexOptionsi0S83_D4stdx4data4json5lexer10__lambda41MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ14JSONLexerRangeZS4stdx4data4json5value9JSONValue':
source/app.d:(.text._D4stdx4data4json6parser209__T14parseJSONValueTS4stdx4data4json5lexer147__T14JSONLexerRangeTAyaVE4stdx4data4json5lexer10LexOptionsi0S83_D4stdx4data4json5lexer10__lambda41MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ14JSONLexerRangeZ14parseJSONValueFNfKS4stdx4data4json5lexer147__T14JSONLexerRangeTAyaVE4stdx4data4json5lexer10LexOptionsi0S83_D4stdx4data4json5lexer10__lambda41MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ14JSONLexerRangeZS4stdx4data4json5value9JSONValue+0xbe5): undefined reference to `_D4stdx4data4json5lexer113__T21unescapeStringLiteralS83_D4stdx4data4json5lexer10__lambda42MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ21unescapeStringLiteralFNaNbNfAyaKAyaZb'
source/app.d:(.text._D4stdx4data4json6parser209__T14parseJSONValueTS4stdx4data4json5lexer147__T14JSONLexerRangeTAyaVE4stdx4data4json5lexer10LexOptionsi0S83_D4stdx4data4json5lexer10__lambda41MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ14JSONLexerRangeZ14parseJSONValueFNfKS4stdx4data4json5lexer147__T14JSONLexerRangeTAyaVE4stdx4data4json5lexer10LexOptionsi0S83_D4stdx4data4json5lexer10__lambda41MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ14JSONLexerRangeZS4stdx4data4json5value9JSONValue+0x135d): undefined reference to `_D4stdx4data4json5lexer113__T21unescapeStringLiteralS83_D4stdx4data4json5lexer10__lambda42MFNaNbNfZS3std5array17__T8AppenderTAyaZ8AppenderZ21unescapeStringLiteralFNaNbNfAyaKAyaZb'
s-ludwig commented 9 years ago

DMD issue: https://issues.dlang.org/show_bug.cgi?id=14429

The current workaround is to build with --combined.

Herringway commented 9 years ago

Ah, I see. I suppose this can be closed, then.