-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core.stdc definition conflicts with ldc2 #286
Comments
I found the reason for this. Adding One of the windows headers defines alias FILE = _iobuf;
struct _iobuf
{
void* _Placeholder;
} But by adding struct _iobuf; The definition of Which is different from what dmd defines for CRuntime_Microsoft: |
Without the .dpp file it's impossible for me to look at this. |
I will try to create a minimal working example. Although do above workaround works for other functions, but when I have to actually pass a |
Here are a couple of files that reproduce the issue. dub run --build=release --quiet --yes dpp -- --preprocess-only ./test.dpp --keep-pre-cpp-files dub run --build=release --quiet --yes dpp -- --preprocess-only ./test.dpp --keep-pre-cpp-files --ignore-system-paths test_dpp_ignore_system_paths.zip dub run --build=release --quiet --yes dpp -- --preprocess-only ./test.dpp --keep-pre-cpp-files --no-sys-headers (non-sys-headers don't seem to have any effects.) dub run --build=release --quiet --yes dpp -- --preprocess-only ./test.dpp --keep-pre-cpp-files --prebuilt-header stdio.h=core.stdc.stdio --prebuilt-header stdlib.h=core.stdc.stdlib --prebuilt-header stdint.h=core.stdc.stdint test_dpp_specify_core-stdc.zip dub run --build=release --quiet --yes dpp -- --preprocess-only ./test.dpp --keep-pre-cpp-files --prebuilt-header stdio.h=core.stdc.stdio --prebuilt-header stdlib.h=core.stdc.stdlib --prebuilt-header stdint.h=core.stdc.stdint --ignore-path stdio.h --ignore-path stdlib.h --ignore-path stdint.h test_dpp_specify_and_ignore_core-stdc.zip (Dpp doesn't seem to actually ignore these headers.) dub run --build=release --quiet --yes dpp -- --preprocess-only ./test.dpp --keep-pre-cpp-files --prebuilt-header stdio.h=core.stdc.stdio --prebuilt-header stdlib.h=core.stdc.stdlib --prebuilt-header stdint.h=core.stdc.stdint --ignore-path stdio.h --ignore-path stdlib.h --ignore-path stdint.h --ignore-system-paths test_dpp_specify_core-std_ignore_sytem_paths.zip (this one could be made to work if |
One short term solution to this is to In the long term, there should be a way to specify prebuilt headers for the standard libraries (C and C++). For example, D has |
When I use ldc2 to build a C library, I get these kinds of errors if my d file uses
std.stdio
dmd works fine without any issues!
This is because I have
writeln("hello");
in the main function ofentry.d
which importsfile
.I noticed that dpp generates these conflicting definitions.
The issue is the same on Ubuntu or Windows.
The text was updated successfully, but these errors were encountered: