|Forums: I can't use add ons on Visual Studio 2019: Reply|
This section is only available to registered Allegro.cc members.
I am new to Allegro 5 and Visual Studio... I'm trying tu run a simple code:
And it returns an error:
LNK2019 Unrecognized external symbol __imp__al_init_image_addon reffered in function _main
I already install Allegro5 from NuGet packages and enable add ons on project properties... but it still doesn't work...
Please if anyone has a solution, tell me, because I am breaking my head thinking it xD
If I delete the line al_init_image_addon(); it works perfectly and also U can create and destroy displays, for example... but the add ons simply doesn't work.
If you include the header you need to link the library
In Allegro 5, each addon is its own library.
Adding Allegro5 with NuGet doesn't automatically link any addon libraries. You still have to link them yourself.
If you use added Allegro with NuGet it's easy:
if not then:
1. Open Project Properties
Now it should be properly linked.
I have already done that. But still doesen't work... I really don't understand the problem...
It should have worked
An idea: Did you do it for the configuration you are using?
Sometimes I accidentally modify properties for the release configuration when I'm working on the debug configuration.
mmm, how?? I have Visual Studio 2019 Community, I install Allegro 5.2.8 and checked all the add ons on the properties... only that. Do I need to do something else??
Somehow it's not linking. for the time being, you can add the library file name to the additional dependencies.
Try that and see if it works
I'll check when I get home, but can't think of what it could be.
1. create empty project
Here's my code:
As I asked before, when you selected the addons, did you select them for all configurations?
In this image, I only set the addon for the release configuration.
That's the only thing I can think you're doing.
Anyone else have ideas?
I concur, should be working fine so long as you have the add-ons selected for the current build (debug/release). Tested this morning with VS2019, Nuget. I can't think of any reason it wouldn't work unless you're compiling for a build without having the add-ons selected for it...