|
[Linker error] undefined reference to `_imp__screen' |
Nick Cash
Member #6,082
August 2005
|
Alright, I have a very simple program setup, as I am just working my way into real work with Allegro, but every time I try to draw basic primitives I get this: [Linker error] undefined reference to `_imp__screen' This results from:
I originally had clear_to_color() instead of putpixel(), and I go the same error. And help would be appreciated. Once I can get over this slump I think things will progress quickly. Its hard to play around a lot when you dont have any graphics! ~Odis |
HoHo
Member #4,534
April 2004
|
How do you link your programs? What parameters you give to the linker? __________ |
ReyBrujo
Moderator
January 2001
|
Remember to include Allegro. And link using -lalleg under MinGW or DJGPP, `allegro-config --libs` under Linux. If after that you are still getting those errors, tell us your Allegro version, compiler [version] and system. The examples work? If not, it is probably you need to compile the library again. -- |
Nick Cash
Member #6,082
August 2005
|
I compiled it as a static library. I'm working with Dev-C++, and my linking options are as follows: -lalleg_s I was thinking I probably needed to recompile the library. Also, allegro.h is included (sorry, forgot to include that within the snippets I posted). The DX I'm using is DX8 found off the Allegro download section. I'm working off the most recent stable version of allegro, 4.08 I I ran several of the examples (3D boxes, camera, etc) and they seemed to work correctly. ~Odis |
ReyBrujo
Moderator
January 2001
|
If you want to link with the static version of Allegro, you need to define ALLEGRO_STATICLINK before including the header. Latest stable is 4.0.3, latest WIP is 4.2.0 beta 4. -- |
Nick Cash
Member #6,082
August 2005
|
Wow, thats an easy fix. Thanks! Sorry about the version, thats what I get for not checking. It is 4.0.3. ~Odis |
|