Thread overview
Weird compilation error only as static library
Sep 26, 2018
Márcio Martins
Sep 28, 2018
Andrea Fontana
Sep 28, 2018
Márcio Martins
September 26, 2018
Hi!

I am getting this error when compiling my code as a static library.
It works fine as an executable. I have no idea what's happening.
Has someone seen something like this before? What could be different?

This is the error:
/usr/include/dmd/druntime/import/core/stdc/stdint.d(159,26): Error: undefined identifier cpp_ulong
/usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(109,11): Error: undefined identifier c_long
../../../.dub/packages/libuv-1.20.3/libuv/deimos/libuv/uv.d(367,2): Error: mixin `deimos.libuv.uv.uv_stream_s.UV_STREAM_FIELDS!()` error instantiating

It's a small library with libuv as the only dependency. It works fine compiling it's own example, but fails when I compile it as a dub dependency.
September 28, 2018
On Wednesday, 26 September 2018 at 19:08:45 UTC, Márcio Martins wrote:
> Hi!
>
> I am getting this error when compiling my code as a static library.
> It works fine as an executable. I have no idea what's happening.
> Has someone seen something like this before? What could be different?
>
> This is the error:
> /usr/include/dmd/druntime/import/core/stdc/stdint.d(159,26): Error: undefined identifier cpp_ulong
> /usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(109,11): Error: undefined identifier c_long
> ../../../.dub/packages/libuv-1.20.3/libuv/deimos/libuv/uv.d(367,2): Error: mixin `deimos.libuv.uv.uv_stream_s.UV_STREAM_FIELDS!()` error instantiating
>
> It's a small library with libuv as the only dependency. It works fine compiling it's own example, but fails when I compile it as a dub dependency.

What are you importing on top of your code?

Andrea
September 28, 2018
On Friday, 28 September 2018 at 15:24:03 UTC, Andrea Fontana wrote:
> On Wednesday, 26 September 2018 at 19:08:45 UTC, Márcio Martins wrote:
>> Hi!
>>
>> I am getting this error when compiling my code as a static library.
>> It works fine as an executable. I have no idea what's happening.
>> Has someone seen something like this before? What could be different?
>>
>> This is the error:
>> /usr/include/dmd/druntime/import/core/stdc/stdint.d(159,26): Error: undefined identifier cpp_ulong
>> /usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(109,11): Error: undefined identifier c_long
>> ../../../.dub/packages/libuv-1.20.3/libuv/deimos/libuv/uv.d(367,2): Error: mixin `deimos.libuv.uv.uv_stream_s.UV_STREAM_FIELDS!()` error instantiating
>>
>> It's a small library with libuv as the only dependency. It works fine compiling it's own example, but fails when I compile it as a dub dependency.
>
> What are you importing on top of your code?
>
> Andrea

Basically my static library imports deimos.libuv, and my program imports my static library.
I think it must be some issue with deimos.libuv, but I can't figure out what, and it's also weird the static library compilation is different than the executable, other than linking. I think I will look for new libuv bindings or create my own.