I use an empty Win32 app and saved the main program as main.c. I open up the Project Settings (I didn't see Project Properties)/Link and replace everything in the "Object/Library Modules" text box with the following: alleg.lib alleg_s.lib gdi32.lib winmm.lib ole32.lib dxguid.lib dinput.lib ddraw.lib dsound.lib
My Code exactly as I have it copied:
Expand|Select|Wrap|Line Numbers
- #define ALLEGRO_STATICLINK
- #include <stdlib.h>
- #include <allegro.h>
- //extern char allegro_id[];
- char allegro_id[] = "test string";
- int main()
- {
- allegro_init();
- printf("Allegro version = %s\n", allegro_id);
- printf("\nPress any key...\n");
- system("pause");
- allegro_exit();
- return 0;
- }
- END_OF_MAIN()
I get one warning "warning C4013: 'printf' undefined; assuming extern returning int"
If I add the "extern char" line, it doesn't seem to make a bit of difference...
I've checked my C++ reference guide and I think I've done everything right! I've copied from the first "#include" to the "END_OF_MAIN()" exactly like it is in the book... What am I doing wrong? I've been trying to make it work for almost a month and I know it's got to be something simple that I'm missing... Help me please!
Silver Leaf