in Education by
I am a complete beginner in allegro and i just installed allegro correctly and this is my code(my first code): #include #include #include #include #include int main() { ALLEGRO_DISPLAY *display; if (!al_init()) { al_show_native_message_box(display, NULL, NULL, "Could not initialize allegro 5", NULL, NULL); } display = al_create_display(800, 600); if (!display) { al_show_native_message_box(display, NULL, NULL, "Could not initialize allegro WINDOW ", NULL, NULL); } al_rest(5.0); al_destroy_display(display); return 0; } Now this is what the build log displays: 1>------ Build started: Project: Allegro_intro, Configuration: Debug Win32 ------ 1> main.cpp 1>c:\users\krish\desktop\projects\allegro_intro\allegro_intro\main.cpp(11): warning C4700: uninitialized local variable 'display' used 1>main.obj : error LNK2005: _main already defined in font.obj 1>C:\Users\krish\Desktop\Projects\Allegro_intro\Debug\Allegro_intro.exe : fatal error LNK1169: one or more multiply defined symbols found ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== And then there is a dialog box that says " UNABLE TO START PROGRAM... The system cannot find the file specified". Please tell me what to do about this JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
display is uninitialized when passed to the first call to al_show_native_message_box, which will result in random memory access. If you need to call al_show_native_message_box before al_init and al_create_display are called, pass NULL for the display parameter. Always initialize your variables. ;)

Related questions

0 votes
    When compiling boost filesystem (1_46_1) with Intel 12 Release 4, and Visual Studio 10, I get this error ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    A couple months ago I did a project in C++ with Visual Studio that I needed pthreads for, so I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Is there any way to synchronize scrollbars in VS2010? For instance, if you have two files that are nearly ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    To my amazement I just discovered that the C99 stdint.h is missing from MS Visual Studio 2003 upwards. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I am unable to run any commands against my remote repository at Visual Studio Team Services (VSTS) because ... like SourceTree. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am working on a game in allegro 5 in which I want to create rectangular objects dynamically on screen and make them clickable with mouse ... if ( x >= rect.x && x = rect.y && y...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I tried the following approach in my build script: git -c http.extraheader="AUTHORIZATION: bearer %SYSTEM_ACCESSTOKEN% ... Thoughts? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 1, 2022 in Education by JackTerrance
0 votes
    What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    As far as I know, in gcc you can write something like: #define DBGPRINT(fmt...) printf(fmt); Is ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    I have a JSON File with database environment configuration called env-config.json like this: { "LATEST":{ ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 10 years ago. Possible Duplicate: GNU C++ how to check ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 10 years ago. Possible Duplicate: GNU C++ how to check ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
...