C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-18-2005, 02:36 PM   #1
Registered User
 
Join Date: Jul 2005
Posts: 11
getting to grips with allegro and ms vc++ (newbie)

ok well it seems that i post here once every month or so as a complete newbie coz i just got interested in c++ again, again, so here goes.

found out about the allegro library and it seems to be pretty cool, and i also have just aquired ms visual studio 6 and i am trying to get my first thing compiled but i cant seem to get it to work

i made a new empty win32 c++ application

i added a source file called main.cpp

Code:
#include <allegro.h>

int main (int argc, char *argv[])
    {
    allegro_init();
    install_keyboard();
    set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
    readkey();
    return 0;
}

END_OF_MAIN();
i tried to compile it by going build>buildallegrotest.exe and also the other options i think i tried them all and it just said i had an "error" in the output box. so i added allegro.h to it. but it made no difference.

how do you go about compiling something like that? i am a TOTAL newbie so please be nice to me
jimjamjahaa is offline   Reply With Quote
Old 11-18-2005, 02:40 PM   #2
Devil's Advocate
 
SlyMaelstrom's Avatar
 
Join Date: May 2004
Location: Out of scope
Posts: 3,778
Is allegro.h in your compiler's include directory with the rest of your standard libraries?

If it isn't then put it into the same directory as the your .cpp and change your include to
Code:
#include "allegro.h"
Also, may I ask what END_OF_MAIN() is supposed to be?
__________________
Terms of Service
By quoting or replying directly to this post, you consent to the fact that all of the information in the post above is completely accurate and highly intelligent and no comments will be made towards its validity, thoughtlessness, and/or grammatical structure.

Violators will be prosecuted to the fullest extent of the law.
SlyMaelstrom is offline   Reply With Quote
Old 11-18-2005, 02:42 PM   #3
Registered User
 
Join Date: Jan 2005
Posts: 847
Go to project->settings and click on the link tab. Then add allegro.lib (I think thats it's name) to the list of objects.
Quantum1024 is offline   Reply With Quote
Old 11-18-2005, 04:30 PM   #4
Registered User
 
Join Date: Jul 2005
Posts: 11
END_OF_MAIN is an allegro function that you have to call after the end of the main (surprisingly) at least according to a tutorial im following. thanks for the tips, ill post with the results

edit

Quote:
--------------------Configuration: allegrotest - Win32 Debug--------------------
Compiling...
main.cpp
c:\program files\microsoft visual studio\vc98\include\allegro\platform\aldjgpp.h(20) : fatal error C1083: Cannot open include file: 'pc.h': No such file or directory
Error executing cl.exe.

allegrotest.exe - 1 error(s), 0 warning(s)
i got no idea what "pc.h" is, and it didnt come with the allegro source. did i accidentally mess up something? is ph.h a standard header file that should be there?

*is confused*

Last edited by jimjamjahaa; 11-18-2005 at 04:37 PM.
jimjamjahaa is offline   Reply With Quote
Old 11-18-2005, 07:49 PM   #5
Devil's Advocate
 
SlyMaelstrom's Avatar
 
Join Date: May 2004
Location: Out of scope
Posts: 3,778
Is it being included in aldjgpp.h?

... well perhaps that's obvious.

Check the internet perhaps, maybe you can find a copy of it.
__________________
Terms of Service
By quoting or replying directly to this post, you consent to the fact that all of the information in the post above is completely accurate and highly intelligent and no comments will be made towards its validity, thoughtlessness, and/or grammatical structure.

Violators will be prosecuted to the fullest extent of the law.
SlyMaelstrom is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 07:22 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22