NuGet Package Manager Allegro 5 linker error
Matias Persson

Hi, recently I installed MSVC2017 on a frech install of Windows 10, and I do like I've always done.
Create a new project, then go to Tools -> NuGet Package Manager -> Install-Package Allegro -Version 5.2.5.1

By this stage, I'm normally set to just program using Allegro 5, and whenever I need addons such as images addon or primitives, I'd go to project settings and go to the Allegro 5 tab and turn them on.

But with just a simple hello world file and no allegro 5 code in the new program yet, I cannot even compile without getting this weird linker error:

#SelectExpand
11>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(719,5): error MSB6006: "link.exe" exited with code 1104. 21>LINK : fatal error LNK1104: cannot open file 'allegro.lib'

So I figure that I'll go to project settings -> linker -> and put 'allegro.lib' in input additional dependencies settings. No luck.
Anyone knows what is wrong here ?????? Any help is appreciated :)

Edgar Reynaldo

You say you installed msvc 2017 but I see 2019 in your log. The Nuget packages probably need to be recompiled for the latest version.

Matias Persson

Stupid me, I noticed. I was just hoping for a reply so I could close this thead. (Couldn't find any edit title button and I could not reply to my own reply...)

Edgar Reynaldo

No matter it helps that you have made us aware of the new version 😉

Also you can't close threads but they will lock on their own after a week. And you can only send to top you cannot reply to your own post. But you can edit them all you want.

SiegeLord

You can install and select the v141 toolchain, and that'll work in 2019 with the current packages. v142 packages are coming soon.

Matias Persson

Oh so I uninstalled 2019 for nothing then :P Well good to know, I'll keep that in mind next time my computer breaks down and I have to format the harddrive (after backing up of course)

Edgar Reynaldo

OT; never once have I had to reformat my hard drive or reinstall an operating system due to bugs driver failures etc...

Edit:
Actually I broke openSUSE doing an upgrade once.

CmdrGreenwood

Hi. Same problem here, can't compile under VS2019.
@SiegeLord: How can I select the v141 toolchain? Can't find a setting in VS.

Edgar Reynaldo

A quick google reveals the answer - just apply it to VS2019 and v141 and you're good to go : https://stackoverflow.com/questions/45672243/how-do-i-retarget-a-vs2017-solution-in-vs2015

CmdrGreenwood

I tried. In my VS2019 (Project - Properties - General - Toolset) no VS2017 option ist available, only 2019. So I installed the VS2017 buildtools. Now I can select VS2017 in my project, but when doing so, I get 49 different error messages about missing sourced and "al_init()" ist underlined red. ???

Edgar Reynaldo

Well, SiegeLord said v142 would be out soon. You can make another thread in the meantime and we can try to solve it.

This is a wild guess but reinstalling the Nuget package might help.

SiegeLord

Just uploaded the v142-compatible package. Look for the version 5.2.5.2. FWIW, v141 worked okay for me in MSVC 2019, I just had to also select an older Windows SDK version (8.1). Either way, that shouldn't be necessary now.

CmdrGreenwood

You did it! Thanks! Everything is working now... :D

Thread #617804. Printed from Allegro.cc