Linker Error with MSBuild

projucer

#1

Hey all,

I need to compile a plugin project through MSBuild because this is part of our workflow.
I built a build.bat file which I open in Developer Command Prompt for VS2017

First I build the Projucer

SET PROJUCER_PROJECT_PATH="%PROJ_DIR%\Name.jucer"

SET VS2017_PROJECT_PATH="..\Builds\VisualStudio2017\Name.sln"

MSBuild /m "..\Submodules\JUCE\extras\Projucer\Builds\VisualStudio2017\Projucer.sln" /p:Configuration=Release /p:Platform=X64  /t:Build

SET PROJUCER_PATH=..\Submodules\JUCE\extras\Projucer\Builds\VisualStudio2017\x64\Release\App\Projucer.exe

MSBuild /m %VS2017_PROJECT_PATH% /p:Configuration=Release /p:Platform=X64  /t:Clean,Build

MSBuild /m %VS2017_PROJECT_PATH% /p:Configuration=ReleaseWin32 /p:Platform=Win32  /t:Clean,Build

The script works fine however I get the following warnings and errors when I try to run it:

Warning:

"Y:\Filename\Builds\VisualStudio2017\Filename.sln" (Clean;Build target) (1) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_VST.vcxproj.metaproj" (default target) (5:2) ->
   "Y:\Filenamepattern\Builds\VisualStudio2017\Filename_SharedCode.vcxproj" (default target) (6:10) ->
   (DoLibOutputFilesMatch target) ->
     C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(1386,5): warning MSB8012: TargetPath(Y:\Filename\Builds\VisualStudio2017\x64\Release\Shared Code\.lib) does not match the Library's OutputFile property value (Y:\Filename\Builds\VisualStudio2017
   \x64\Release\Shared Code\Filename_SharedCode.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(Targ
   etName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile). [Y:\Filename\Builds\VisualStudio2017\Filename_SharedCode.
   vcxproj]

Errors:

"Y:\Filename\Builds\VisualStudio2017\Filename.sln" (Clean;Build target) (1) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_AAX.vcxproj.metaproj" (default target) (3:2) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_AAX.vcxproj" (default target) (8:2) ->
   (Link target) ->
     LINK : fatal error LNK1181: cannot open input file '.lib' [Y:\Filename\Builds\VisualStudio2017\Filename_AAX.vcxproj]


   "Y:\Filename\Builds\VisualStudio2017\Filename.sln" (Clean;Build target) (1) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_VST3.vcxproj.metaproj" (default target) (4:2) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_VST3.vcxproj" (default target) (9:2) ->
     LINK : fatal error LNK1181: cannot open input file '.lib' [Y:\Filename\Builds\VisualStudio2017\Filename_VST3.vcxproj]


   "Y:\Filename\Builds\VisualStudio2017\Filename.sln" (Clean;Build target) (1) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_VST.vcxproj.metaproj" (default target) (5:2) ->
   "Y:\Filename\Builds\VisualStudio2017\Filename_VST.vcxproj" (default target) (10:2) ->
     LINK : fatal error LNK1181: cannot open input file '.lib' [Y:\Filename\Builds\VisualStudio2017\Filename_VST.vcxproj]

In VS2017 it builds fine. And on Mac we have the same script which also builds properly.

Any ideas?
Thanks
Roland


#2

Do you have the VST and AAX SDKs installed on your windows machine?


#3

I just updated to the newest VST3sdk and I still get the same error.
Also I’m now trying to just build VST3 as a first step.


#4

Check your Linker input prefs… It’s looking for an empty .lib file

LINK : fatal error LNK1181: cannot open input file ‘.lib’

Rail


#5

@Rail_Jon_Rogut
thanks a lot! Could you elaborate on that (total windows noob here).
Is that a juice setting ? Could find it.
If it’s in VS2017, won’t it be overwritten upon the next juce save.

Thanks!


#6

Hey @rollo,

If you use the Projucer you can set additional libraries to link in “External Libraries To Link” under your Visual Studio exporter. As an example, linking to a foobar.lib:

And the library search paths settings will be available under each configuration for that exporter:


#7

Thanks all, I’ll try again, when I’m at my workstation again.
I’m still not clear though, as to why I need to set External Libraries or a .lib file when it’s just a regular build from the Projucer. Apparently linking works correctly when I build in VS2017


#8

If I understood @Rail_Jon_Rogut’s answer right, there is a lib with no name added. Don’t know, how that happens, but normally you would expect

 LINK : fatal error LNK1181: cannot open input file ‘anything.lib’

The .lib is probably added by the Projucer. so for some reason a “” got expanded to “.lib” and was added as required library, which most likely doesn’t exist


#9

OK and any ideas how to get rid of that? Or just create a dummy empty .lib file?



#10

In VS, for the project… for the current configuration… you need to check the Linker->Input->Additional Dependencies to see what they are.

Post the entry for that field here.

Rail


#11


Thats the screenshot.

Thanks again for you help