Thread overview
Problems with x64 build with VC2012
Jan 24, 2014
Szymon Gatner
Feb 10, 2014
Rainer Schuetze
Mar 11, 2017
ixid
Mar 12, 2017
Rainer Schuetze
January 24, 2014
Hi,

I am trying to build default main() provided with VisualD console app template.

I am using Visual Studio 2012 Update 4 and I am not able to build in x64 mode with error:

------ Build started: Project: ConsoleApp6, Configuration: Debug x64 ------
Building Debug\ConsoleApp6.exe...
OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 9: Unknown Option : OUT
OPTLINK : Error 12: Number Overflow : 
Building Debug\ConsoleApp6.exe failed!
Details saved as "file://c:\users\bravo\documents\visual studio 2012\Projects\ConsoleApp6\ConsoleApp6\Debug\ConsoleApp6.buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
February 10, 2014

On 24.01.2014 14:00, Szymon Gatner wrote:
> Hi,
>
> I am trying to build default main() provided with VisualD console app
> template.
>
> I am using Visual Studio 2012 Update 4 and I am not able to build in x64
> mode with error:
>
> ------ Build started: Project: ConsoleApp6, Configuration: Debug x64 ------
> Building Debug\ConsoleApp6.exe...
> OPTLINK (R) for Win32  Release 8.00.13
> Copyright (C) Digital Mars 1989-2010  All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> OPTLINK : Warning 9: Unknown Option : OUT
> OPTLINK : Error 12: Number Overflow : 
> Building Debug\ConsoleApp6.exe failed!
> Details saved as "file://c:\users\bravo\documents\visual studio
> 2012\Projects\ConsoleApp6\ConsoleApp6\Debug\ConsoleApp6.buildlog.html"
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

This sounds similar to what Arjan reported just today: somehow optlink is preferred over the MS linker (unfortunately they are both called link.exe). Please check linker path on the "Projects and Solutions->Visual D settings->DMD directories->x64" options page. It should have an absolute path to avoid optlink being found first via the PATH environment variable.

If this doesn't reveal anything, please post the buildlog or the *.build.cmd file in the output directory.
March 11, 2017
On Monday, 10 February 2014 at 19:05:05 UTC, Rainer Schuetze wrote:
> This sounds similar to what Arjan reported just today: somehow optlink is preferred over the MS linker (unfortunately they are both called link.exe). Please check linker path on the "Projects and Solutions->Visual D settings->DMD directories->x64" options page. It should have an absolute path to avoid optlink being found first via the PATH environment variable.
>
> If this doesn't reveal anything, please post the buildlog or the *.build.cmd file in the output directory.

I'm having this problem as well, I've set "Projects and Solutions->Visual D settings->DMD
> directories->x64" to the explicit path of the link.exe ("C:\D\dmd2\windows\bin\link.exe") with override sc.ini ticked. I'm still getting the error listed. Is there a solution or fix?
March 12, 2017

On 11.03.2017 14:12, ixid wrote:
> On Monday, 10 February 2014 at 19:05:05 UTC, Rainer Schuetze wrote:
>> This sounds similar to what Arjan reported just today: somehow optlink
>> is preferred over the MS linker (unfortunately they are both called
>> link.exe). Please check linker path on the "Projects and
>> Solutions->Visual D settings->DMD directories->x64" options page. It
>> should have an absolute path to avoid optlink being found first via
>> the PATH environment variable.
>>
>> If this doesn't reveal anything, please post the buildlog or the
>> *.build.cmd file in the output directory.
>
> I'm having this problem as well, I've set "Projects and
> Solutions->Visual D settings->DMD
>> directories->x64" to the explicit path of the link.exe
>> ("C:\D\dmd2\windows\bin\link.exe") with override sc.ini ticked. I'm
>> still getting the error listed. Is there a solution or fix?

If you want to build for x64, you must use the MS linker. A usual override for VS2012 would be

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.exe