Code Blocks Problems

IM not sure if this is where this should go but, Im encountering a weird problem when trying to build a program on codeblocks.
I recently tried to put allegro in the libraries and am now trying to learn how to use allegro.
I tried to build the program and came across this error.
-------------- Build: Debug in Learning ---------------

Compiling: Testfile.cpp
s: -c: line 0: unexpected EOF while looking for matching `"'
s: -c: line 1: syntax error: unexpected end of file
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings

Last edited on
closed account (Dy7SLyTq)
could you post your code?
#include <allegro\allegro.>
#include <allegro\allegro_native_dialog.h>

int main(void)
{
ALLEGRO_DISPLAY *display = NULL;

if(!al_init())
{
al_show_native_message_box(NULL, NULL, NULL
"FAILED TO INITIALIZE ALLEGRO!",NULL NULL);
return -1;
}

display = cl_create_display(640, 480);

if(!display)
{
al_show_native_message_box(NULL, NULL
"FAILED TO INITIALIZE DISPLAY!")
return -1;
}
al_destroy_display(display);

return 0;
}

closed account (Dy7SLyTq)
a) use code tags
b) line one idk if its the cause of your error, but you forgot the .h
c) line 11 you forgot a , between the last two NULL's and same 19-20 between the NULL and the string
d) line 20 you forgot a semicolon
I fixed the problems you mentioned. That I wasnt it. I think it may be something with the way I added allegro to code blocks. Can some one point me to a good tutorial for that.
closed account (NUj6URfi)
Code cleanup:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <allegro\allegro.h>
#include <allegro\allegro_native_dialog.h>

 int main(void) {
 ALLEGRO_DISPLAY *display = NULL;

 if(!al_init()) {
 al_show_native_message_box(NULL, NULL, NULL,"FAILED TO INITIALIZE ALLEGRO!",NULL, NULL);
 return -1;
 }

 display = cl_create_display(640, 480);

 if(!display) {
 al_show_native_message_box(NULL, NULL,"FAILED TO INITIALIZE DISPLAY!");
 return -1;
 }
 al_destroy_display(display);

 return 0;
 }
Last edited on
Line 9 still lacks a comma between two NULLs. What is the error message now?
Backslashes on include lines and you run this on linux ?
I'm useing a mac.
Like I said, If this is the wrong place for this I apologize.
Last edited on
Topic archived. No new replies allowed.