Today I wanted to start a bit of practice with allegro again , and I wanted to try it in Microsoft Visual C++ rather than in codeblocks. I went to youtube found a tutorial from CodingMadeEsay and followed the steps, but when I build the solution/ trying to run the program I get two errors.
1. A window pops up saying the following message "Unable to start program 'C:\Users\SOAD\documents\visual studio 2010\projects\Allegro retry\Debug\Allegro retry.exe'. The system cannot find the file specified"
2. The compiler output which tells me the succeeded, failed, up to date etc stuff says "1>------ Build started: Project: Allegro retry, Configuration: Debug Win32 ------
1> Main.cpp
1>c:\program files\microsoft visual studio 10.0\vc\include\allegro.h(26): fatal error C1083: Cannot open include file: 'allegro5/base.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
"
I have tried putting this file in system32 the project and even pasting it inside of the program.
For now I will use codeblock, but I wanted to use MVC because it aids me by telling me what must I type if I don't remember.
Thanks in advance!.
9 replies to this topic
#1
Posted 20 June 2011 - 03:26 PM
|
|
|
#2
Posted 20 June 2011 - 03:47 PM
In Under Options > Projects and Solutions > VC++ Directories or similar should allow you to add a folder location for includes, you can create a new entry with the location to your Allegro's include folder (be sure not to select allegro5 by accident.)
You can then add/link to the Allegro library (alleg.lib) to use the features from the header, which should be in Project Properties > Configuration Properties > Linker.
This will compile the library statically, meaning the Allegro library will be compiled in to your executable.
Feel free to ask if you are having trouble.
Alexander.
You can then add/link to the Allegro library (alleg.lib) to use the features from the header, which should be in Project Properties > Configuration Properties > Linker.
This will compile the library statically, meaning the Allegro library will be compiled in to your executable.
Feel free to ask if you are having trouble.
Alexander.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 20 June 2011 - 04:20 PM
Alexander said:
In Under Options > Projects and Solutions > VC++ Directories or similar should allow you to add a folder location for includes, you can create a new entry with the location to your Allegro's include folder (be sure not to select allegro5 by accident.)
You can then add/link to the Allegro library (alleg.lib) to use the features from the header, which should be in Project Properties > Configuration Properties > Linker.
This will compile the library statically, meaning the Allegro library will be compiled in to your executable.
Feel free to ask if you are having trouble.
Alexander.
You can then add/link to the Allegro library (alleg.lib) to use the features from the header, which should be in Project Properties > Configuration Properties > Linker.
This will compile the library statically, meaning the Allegro library will be compiled in to your executable.
Feel free to ask if you are having trouble.
Alexander.
Still it's no good plus it says that the directories are a sheet that is now added by default :(. This is a nightmare !.
#4
Posted 20 June 2011 - 06:23 PM
Can you show us the code of which you are using, and the copy the error output?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 21 June 2011 - 09:11 AM
Alexander said:
Can you show us the code of which you are using, and the copy the error output?
#include <allegro.h>
int main() {
allegro_init ();
install_keyboard ();
install_mouse ();
set_color_depth (32);
set_gfx_mode (GFX_AUTODETECT_WINDOWED , 640 , 480 , 0 , 0 );
readkey ();
return 0;
}
END_OF_MAIN ()
error-
1>------ Build started: Project: Allegro retry, Configuration: Debug Win32 ------
1> Main.cpp
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5): error MSB6006: "CL.exe" exited with code 2.
1>c:\program files\microsoft visual studio 10.0\vc\include\allegro.h(25): fatal error C1083: Cannot open include file: 'allegro/base.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#6
Posted 21 June 2011 - 09:14 AM
The include folder must contain the folder allegro, not the base files within that folder.
It should look like c:\program files\microsoft visual studio 10.0\vc\include\allegro\allegro.h or however your allegro version looks (such as allegro5 folder.)
It should look like c:\program files\microsoft visual studio 10.0\vc\include\allegro\allegro.h or however your allegro version looks (such as allegro5 folder.)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#7
Posted 21 June 2011 - 09:24 AM
Alexander said:
The include folder must contain the folder allegro, not the base files within that folder.
It should look like c:\program files\microsoft visual studio 10.0\vc\include\allegro\allegro.h or however your allegro version looks (such as allegro5 folder.)
It should look like c:\program files\microsoft visual studio 10.0\vc\include\allegro\allegro.h or however your allegro version looks (such as allegro5 folder.)
I downloaded allegro 4.2.3 , but the old allegro5 is still there do you think that can cause future problems?
BTW now it says
1>------ Build started: Project: Allegro retry, Configuration: Debug Win32 ------
1> Main.cpp
1>c:\users\soad\documents\visual studio 2010\projects\allegro retry\allegro retry\main.cpp(1): fatal error C1083: Cannot open include file: 'allegro.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#8
Posted 21 June 2011 - 09:48 AM
Alexander said:
The include folder must contain the folder allegro, not the base files within that folder.
It should look like c:\program files\microsoft visual studio 10.0\vc\include\allegro\allegro.h or however your allegro version looks (such as allegro5 folder.)
It should look like c:\program files\microsoft visual studio 10.0\vc\include\allegro\allegro.h or however your allegro version looks (such as allegro5 folder.)
Nevermind Alexander i was able to do it. The thing was just going to properties > Configuration properties/VC++Directories and add the allegro folder to the include directories. Thanks allot!
#9
Posted 21 June 2011 - 09:28 PM
Glad you could get it working, your problem was just that you could find allegro.h, though allegro.h is hardcoded to search for allegro/xxxxx.h which is not how it was set up. It can be very relieving to finally have a library work though. :)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#10
Posted 22 June 2011 - 03:12 AM
Alexander said:
Glad you could get it working, your problem was just that you could find allegro.h, though allegro.h is hardcoded to search for allegro/xxxxx.h which is not how it was set up. It can be very relieving to finally have a library work though. :)
It is , thanks allot for helping me until the end Alexander. Now I just need to go watch tutorials learn a great deal of information.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









