Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:12:24+00:00 2026-05-23T04:12:24+00:00

What flags do I need to add to g++ in order to compile code

  • 0

What flags do I need to add to g++ in order to compile code using allegro 5? I tried

g++ allegro5test.cpp -o allegro5test `allegro-config --libs`

but that is not working. I’m using ubuntu 11.04. I installed allegro 5 using the instructions at http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/Linux/Debian

I tried:

g++ allegro5test.cpp -o allegro5test `allegro-config --cflags --libs`

And it also gives a bunch of undefined errors, like: undefined reference to `al_install_system’

allegro-config --cflags --libs outputs:

-I/usr/local/include
-L/usr/local/lib -lalleg
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:12:25+00:00Added an answer on May 23, 2026 at 4:12 am

    So you successfully installed allegro5 on your system from the SVN. One thing you should know is that this build doesn’t come with allegro-config. If you have it on your system it means you have previously installed allegro4.

    allegro5 brings many changes, including different initialization procedures, library and function names.

    Here’s a hello world application for new version:

    #include <stdio.h>
    #include <allegro5/allegro.h>
    
    int main(int argc, char **argv)
    {
       ALLEGRO_DISPLAY *display = NULL;
    
       if(!al_init()) {
          fprintf(stderr, "failed to initialize allegro!\n");
          return -1;
       }
    
       display = al_create_display(640, 480);
       if(!display) {
          fprintf(stderr, "failed to create display!\n");
          return -1;
       }
    
       al_clear_to_color(al_map_rgb(0,0,0));
       al_flip_display();
       al_rest(10.0);
       al_destroy_display(display);
       return 0;
    }
    

    Notice how the command to compile this application refers to another include directory and library names, which are different from the previous version of allegro:

    g++ hello.cpp -o hello -I/usr/include/allegro5 -L/usr/lib -lallegro
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help on compiler flags in c++. I'm using a library that
I need to add to compiler flags using bjam. So either I need a
we know that there are flags which we can add to our intent using
I would like to add some code to my Application.cfc onRequestEnd function that, if
i am trying to compile example source code which is using the OpenGL, SDL
Given the following flags, [Flags] public enum Operations { add = 1, subtract =
i have this code: [Flags] public enum MyUriType { ForParse, ForDownload, Unknown } and
The Haskell wiki shows that you need to both set a compilation flag and
I need to store some Photo related information for my app. I understand that
I've got a flag-holding integer that has an existing set of possible flags: #define

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.