Skip to content
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

[Win64] LINK : fatal error LNK1181: cannot open input file 'legacy_stdio_definitions.lib #1085

Closed
p0nce opened this issue Sep 17, 2015 · 5 comments

Comments

@p0nce
Copy link
Contributor

p0nce commented Sep 17, 2015

Compile the following project with DUB: https://github.com/p0nce/dplug/tree/master/examples/distort

OS: Win64
Compiler: Version: LDC 0.16.0-alpha3

How to reproduce:
$ dub build --build=debug --arch=x86_64 --compiler=ldc2 --force --combined
(I use --combined to avoid #1084 )

VS linker: I use the Microsoft Visual Studio 12.0 linker.

Output:

Performing "debug" build using ldc2 for x86_64.
distort ~master: building configuration "library"...
dplug.gui.graphics.obj : warning LNK4006: Th280_D5dplug3gui8graphics11GUIGraphic
s6openUIMFPvE5dplug6plugin3daw3DAWZv already defined in distort.obj; second defi
nition ignored
dplug.gui.graphics.obj : warning LNK4006: Th280_D5dplug3gui8graphics11GUIGraphic
s7closeUIMFZv already defined in distort.obj; second definition ignored
dplug.gui.graphics.obj : warning LNK4006: Th280_D5dplug3gui8graphics11GUIGraphic
s10getGUISizeMFPiPiZv already defined in distort.obj; second definition ignored
LINK : fatal error LNK1181: cannot open input file 'legacy_stdio_definitions.lib
'
Error: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe faile
d with status: 1181
ldc2 failed with exit code 1181.
error: Command 'dub build --build=debug --arch=x86_64 --compiler=ldc2 --force  -
-combined' returned 2
@kinke
Copy link
Member

kinke commented Sep 17, 2015

Please edit your ldc2.conf file and remove the "-Llegacy_stdio_definitions.lib" default switch when using VS < 2015. It's required (and only available) for VS 2015. If we wanted to do that automatically, we'd have to detect the MS linker version during LDC runtime and add that switch accordingly - I suppose that's not gonna happen soon. ;)

@p0nce
Copy link
Contributor Author

p0nce commented Sep 17, 2015

Ok. Worked.

@p0nce p0nce closed this as completed Sep 17, 2015
@wilzbach
Copy link
Contributor

Hmm I ran into the same issue when setting up a appveyor CI for to test mir against ldc.
However I can't find the legacy switch in the release package for windows - any ideas how I could teach ldc to avoid that?

@rainers
Copy link
Contributor

rainers commented Apr 16, 2016

In more recent versions the library is no longer passed on the command line through the configuration file, but compiled into the library as a "default library". You can pass /NODEFAULTLIB:legacy_stdio_definitions to the linker to disable it being searched.

@wilzbach
Copy link
Contributor

In more recent versions the library is no longer passed on the command line through the configuration file, but compiled into the library as a "default library"

Thanks a lot @rainers - I just got it to work with Visual Studio 2015 (v14) :)
Sorry for the annoyance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants