|
Error with primitives |
SaSSolino
Member #16,806
February 2018
|
Hi everyone, I'm new to Allegro and had some issues with primitives: I tried to use al_init_primitives_addon and al_draw_line, but they both give me errors: __imp__al_init_primitives_addon unresolved in _main function __imp__al_draw_line unresolved in _main function 2 unresolved external links I have #include <allegro5\allegro_primitives.h> in my code. Why is this happening? Thanks! |
Eric Johnson
Member #14,841
January 2013
|
Did you call al_init_primitives_addon() and link the proper libraries?
|
SaSSolino
Member #16,806
February 2018
|
I did call al_init_primitives_addon(), and I think I linked the proper libraries. To be safe, which ones do I need? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
It says undefined reference to _imp_ because you're linking to the wrong libraries. If you want to link statically, you need to define ALLEGRO_STATICLINK before including allegro. Link to the correct libraries and the error will go away. To clarify and further answer the question, it depends on how allegro was built. If you have the monolith, link to that, otherwise, you need to link to every addon you use as well as the main allegro library. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
SaSSolino
Member #16,806
February 2018
|
Thanks for the reply, but defining ALLEGRO_STATICLINK did not seem to solve the problem. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I only said to do that if you're linking statically. You still need to link to the appropriate libraries. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|