www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Weird compilation error only as static library

reply =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
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.
Sep 26 2018
parent reply Andrea Fontana <nospam example.com> writes:
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
Sep 28 2018
parent =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
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.
Sep 28 2018