You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two crates that use cbindgen to generate bindings for c++.
When I try to build the C++ project with both crates on windows I get the following errors:
06:24:17 analogue_dropouts.lib(alloc-7bfd0a6d1a588dbd.alloc.a1e7c519547c97d-cgu.0.rcgu.o) : error LNK2005: __rdl_oom already defined in language_identification.lib(alloc-f7d2d3884e227169.alloc.e369825d162945b2-cgu.0.rcgu.o)
06:24:17 analogue_dropouts.lib(std-8ac42145e0282c2a.std.184ed18d6ec46d5f-cgu.0.rcgu.o) : error LNK2005: __rdl_alloc already defined in language_identification.lib(std-0953e6946d141dd5.std.1acf644841c643e8-cgu.0.rcgu.o)
06:24:17 analogue_dropouts.lib(std-8ac42145e0282c2a.std.184ed18d6ec46d5f-cgu.0.rcgu.o) : error LNK2005: __rdl_dealloc already defined in language_identification.lib(std-0953e6946d141dd5.std.1acf644841c643e8-cgu.0.rcgu.o)
It looks like some parts of alloc and std are present in both (which makes sense) causing a conflict.
How can I get around this?
My cbindgen.toml looks like the following:
include_guard = "ANALOGUE_DROPOUTS_HPP"
autogen_warning = "/* This file is autogenerated by cbindgen. Don't modify this file manually. */"
namespace = "ffi"
pragma_once = true
[parse]
expand = ["analogue_dropouts"]
[export]
prefix = "analogue_dropouts_"
The text was updated successfully, but these errors were encountered:
This is not an issue on linux but I assume that is because on windows to link to the dll you also need the .lib file whereas on linux that is not the case.
This is not a cbindgen issue, cbindgen only generates the headers... However it seems like you're trying to statically link multiple crates which is not really something that works, see rust-lang/rust#33221 and so on.
A way to make it work could be something like this which compiles everything into a single staticlib.
I have two crates that use cbindgen to generate bindings for c++.
When I try to build the C++ project with both crates on windows I get the following errors:
It looks like some parts of alloc and std are present in both (which makes sense) causing a conflict.
How can I get around this?
My cbindgen.toml looks like the following:
The text was updated successfully, but these errors were encountered: