Cmake path too long

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

30 Replies - 2977 Views - Last Post: 12 November 2012 - 09:38 AM Rate Topic: -----

#16 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1327
  • View blog
  • Posts: 4,554
  • Joined: 19-February 09

Re: Cmake path too long

Posted 24 September 2012 - 08:47 PM

There seems to be a CMake GUI as a possibility.

CMake not finding "MinGW Makefiles"
Was This Post Helpful? 0
  • +
  • -

#17 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 24 September 2012 - 08:57 PM

Thanks for the suggestion #define, However using the GUI version produces the same error :(

Posted Image

This post has been edited by Ticon: 24 September 2012 - 10:23 PM

Was This Post Helpful? 0
  • +
  • -

#18 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1327
  • View blog
  • Posts: 4,554
  • Joined: 19-February 09

Re: Cmake path too long

Posted 25 September 2012 - 05:37 PM

Looking at the cmake make program not found error. You can check MinGW for make.exe.

Cmake: CMAKE_MAKE_PROGRAM not found


Did you install Cmake OK?

This post has been edited by #define: 25 September 2012 - 05:39 PM

Was This Post Helpful? 0
  • +
  • -

#19 snoopy11  Icon User is online

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,234
  • Joined: 20-March 10

Re: Cmake path too long

Posted 25 September 2012 - 06:30 PM

Right I have been watching this one for a while,

and really things have gone really badly here...,

all your path variables should have been updated automatically if you had installed the programs correctly sometimes its dangerous to change things like enviroments variables if you dont know what you are doing..

lets look at a typical path enviroment variable on my sysytem....

C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\CodeBlocks\MinGW\bin;c:\dislin\win;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\GtkSharp\2.12\bin

I have highlighted where CMake on my system is I would hate to change that myself...

10. Install "cmake-2.8.3-win32-x86.exe" to "C:\cmake" and be sure to select the option to "Add CMAKE to the system path for the current user". This is not the default

Did you tick the box ? if not reinstall cmake....

Quote

Now I have another problem however, I run the command it tells in step 12


Did you change the directory to build folder ?

type "cd C:\codeblocks\mingw\allegro\build" without quotes and press enter

this will get you in the correct folder

Did you do step 7 ??

7. Make a new Environment Variable, a System Variable, named MINGDIR, and give it the value: C:\codeblocks\mingw

This entails going into system properties -> enviroment variables

Posted Image
and adding MINGDIR manually to system variables... have you done that ?

By the way after reading all of this its not a great way to install allegro it's certainly not the way I did it...

Unfortunately I dont really like Allegro so never use it anyway try the above if not I might write my own guide..

Snoopy.

This post has been edited by snoopy11: 25 September 2012 - 06:36 PM

Was This Post Helpful? 2
  • +
  • -

#20 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 26 September 2012 - 04:07 PM

Cmake seems to be installed just fine #define, and Thank you for the in depth post snoopy, I carefully read over the things you said and I double checked them, all is in order.

But you could definitely write your own guide because most of them seem not to work or seem to be half-assed / outdated.

Thanks alot for the help guys, I'm gonna get this damn thing to work eventually :(
Was This Post Helpful? 0
  • +
  • -

#21 snoopy11  Icon User is online

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,234
  • Joined: 20-March 10

Re: Cmake path too long

Posted 26 September 2012 - 07:42 PM

Right well,

I built Allegro the other night so here is my guide with links

download CMake 2.8.9 from here


CMake

download Allegro 5.1.3.7z from here

Allegro

download codeblocks-10.05mingw-setup.exe from here

Code::Blocks

Additional LIbraries for building Allegro

These are not strictly needed as Allegro will build without them but I will include them for fullness.

LibPNG - download binaries zip

libPNG

libFLAC for Ogg Vorbis sound.

FLAC

glut for OpenGL support

GLUT

The quick way to build Allegro without additional dependancies


Run codeblocks install

Run CMake Install (GUI edition)

select add CMake to PATH for all users
click next click finish

extract Allegro to C:\Allegro
add folder C:\Allegro\build
run CMake gui

browse source to C:\Allegro
browse build to C:\Allegro\build

press configure

it will come up with generators
make sure MinGW makefiles is selected

make sure default native compilers is selected

press finish

it will find some stuff and not find other stuff dont worry

press generate when it has completed configure

In C:\Allegro\build

you should now have a Makefile

open a command prompt

type cd C:\Allegro\build

type mingw32-make

this will build the libraries this will take some time

all the libraries in Allegro will be in C:\Allegro\build\lib folder

a new include folder is in C:\Allegro\build\include\allegro5\platform

copy the file that is there alplatf.h to C:\Allegro\include\allegro5\platform

copy the whole include folder to mingw codeblocks installation include folder

copy the C:\Allegro\build\lib folder to

codeblocks lib folder the dll's either need to be in system32 folder or everytime you require a new project put them in your project folder.

#include <stdio.h>
#include <allegro5/allegro.h>

const float FPS = 60;
const int SCREEN_W = 640;
const int SCREEN_H = 480;
const int BOUNCER_SIZE = 32;

int main(int argc, char **argv)
{
   ALLEGRO_DISPLAY *display = NULL;
   ALLEGRO_EVENT_QUEUE *event_queue = NULL;
   ALLEGRO_TIMER *timer = NULL;
   ALLEGRO_BITMAP *bouncer = NULL;
   float bouncer_x = SCREEN_W / 2.0 - BOUNCER_SIZE / 2.0;
   float bouncer_y = SCREEN_H / 2.0 - BOUNCER_SIZE / 2.0;
   float bouncer_dx = -4.0, bouncer_dy = 4.0;
   bool redraw = true;

   if(!al_init()) {
      fprintf(stderr, "failed to initialize allegro!\n");
      return -1;
   }

   timer = al_create_timer(1.0 / FPS);
   if(!timer) {
      fprintf(stderr, "failed to create timer!\n");
      return -1;
   }

   display = al_create_display(SCREEN_W, SCREEN_H);
   if(!display) {
      fprintf(stderr, "failed to create display!\n");
      al_destroy_timer(timer);
      return -1;
   }

   bouncer = al_create_bitmap(BOUNCER_SIZE, BOUNCER_SIZE);
   if(!bouncer) {
      fprintf(stderr, "failed to create bouncer bitmap!\n");
      al_destroy_display(display);
      al_destroy_timer(timer);
      return -1;
   }

   al_set_target_bitmap(bouncer);

   al_clear_to_color(al_map_rgb(255, 0, 255));

   al_set_target_bitmap(al_get_backbuffer(display));

   event_queue = al_create_event_queue();
   if(!event_queue) {
      fprintf(stderr, "failed to create event_queue!\n");
      al_destroy_bitmap(bouncer);
      al_destroy_display(display);
      al_destroy_timer(timer);
      return -1;
   }

   al_register_event_source(event_queue, al_get_display_event_source(display));

   al_register_event_source(event_queue, al_get_timer_event_source(timer));

   al_clear_to_color(al_map_rgb(0,0,0));

   al_flip_display();

   al_start_timer(timer);

   while(1)
   {
      ALLEGRO_EVENT ev;
      al_wait_for_event(event_queue, &ev);

      if(ev.type == ALLEGRO_EVENT_TIMER) {
         if(bouncer_x < 0 || bouncer_x > SCREEN_W - BOUNCER_SIZE) {
            bouncer_dx = -bouncer_dx;
         }

         if(bouncer_y < 0 || bouncer_y > SCREEN_H - BOUNCER_SIZE) {
            bouncer_dy = -bouncer_dy;
         }

         bouncer_x += bouncer_dx;
         bouncer_y += bouncer_dy;

         redraw = true;
      }
      else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) {
         break;
      }

      if(redraw && al_is_event_queue_empty(event_queue)) {
         redraw = false;

         al_clear_to_color(al_map_rgb(0,0,0));

         al_draw_bitmap(bouncer, bouncer_x, bouncer_y, 0);

         al_flip_display();
      }
   }

   al_destroy_bitmap(bouncer);
   al_destroy_timer(timer);
   al_destroy_display(display);
   al_destroy_event_queue(event_queue);

   return 0;
}





This example code is not mine but it will display a bouncing pink box.

That is all he wrote, goodnight

Snoopy.
Was This Post Helpful? 0
  • +
  • -

#22 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 26 September 2012 - 08:53 PM

Hey thanks this has worked almost perfectly! The only thing I don't get is

a new include folder is in C:\Allegro\build\include\allegro5\platform

copy the file that is there alplatf.h to C:\Allegro\include\allegro5\platform

Am I reading this wrong or does it say copy a file to the same location?
Was This Post Helpful? 0
  • +
  • -

#23 snoopy11  Icon User is online

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,234
  • Joined: 20-March 10

Re: Cmake path too long

Posted 26 September 2012 - 09:09 PM

No you are reading it wrong,

it says copy from C:\Allegro\build\include\allegro5\platform
to C:\Allegro\include\allegro5\platform

see the difference then copy to your codeblocks mingw include folder the entire allegro5 folder


Snoopy.
Was This Post Helpful? 0
  • +
  • -

#24 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 26 September 2012 - 09:18 PM

Oh sorry I feel pretty stupid for not noticing that. I truly appreciate all your help. Things seems to be right now and I think im on the final roadblock.

I have placed allegro5 into C:\CodeBlocks\MinGW and copied alpatf to C:\Allegro\include\allegro5\platform

So I open up a new source file in codeblocks just to test it out, I add 2 lines, which are

#include <stdio.h>
#include <allegro5/allegro.h>



and two things happen. One I get a huge list of errors

Spoiler


and 2 alconfig.h opens under a new tab in codeblocks
Spoiler

Was This Post Helpful? 0
  • +
  • -

#25 snoopy11  Icon User is online

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,234
  • Joined: 20-March 10

Re: Cmake path too long

Posted 26 September 2012 - 09:28 PM

Right,

you havent copied alplatf.h properly to your mingw installation its basically saying
it cant find altplatf.h

All these errors you are getting are directly related to altplatf.h

Snoopy.

Edit
you say you

Quote

I have placed allegro5 into C:\CodeBlocks\MinGW and copied alpatf to C:\Allegro\include\allegro5\platform


It should be the other way round you copy alplatf.h to C:\Allegro\include\allegro5\platform then you copy allegro5 from C:\Allegro\include to
C:\Program Files (x86)\CodeBlocks\MinGW\include

I think this is where you went wrong perhaps you are tired ?

Snoopy.

This post has been edited by snoopy11: 26 September 2012 - 09:33 PM

Was This Post Helpful? 0
  • +
  • -

#26 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 26 September 2012 - 09:41 PM

Indeed I am tired, getting up at 5 am is no fun

now it doesn't cry when I include those lines. but the program he wrote doesn't compile giving the error

obj\Debug\main.o||In function `main':|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|20|undefined reference to `al_install_system'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|25|undefined reference to `al_create_timer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|31|undefined reference to `al_create_display'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|34|undefined reference to `al_destroy_timer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|38|undefined reference to `al_create_bitmap'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|41|undefined reference to `al_destroy_display'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|42|undefined reference to `al_destroy_timer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|46|undefined reference to `al_set_target_bitmap'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|48|undefined reference to `al_map_rgb'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|48|undefined reference to `al_clear_to_color'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|50|undefined reference to `al_get_backbuffer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|50|undefined reference to `al_set_target_bitmap'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|52|undefined reference to `al_create_event_queue'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|55|undefined reference to `al_destroy_bitmap'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|56|undefined reference to `al_destroy_display'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|57|undefined reference to `al_destroy_timer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|61|undefined reference to `al_get_display_event_source'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|61|undefined reference to `al_register_event_source'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|63|undefined reference to `al_get_timer_event_source'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|63|undefined reference to `al_register_event_source'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|65|undefined reference to `al_map_rgb'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|65|undefined reference to `al_clear_to_color'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|67|undefined reference to `al_flip_display'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|69|undefined reference to `al_start_timer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|74|undefined reference to `al_wait_for_event'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|105|undefined reference to `al_destroy_bitmap'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|106|undefined reference to `al_destroy_timer'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|107|undefined reference to `al_destroy_display'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|108|undefined reference to `al_destroy_event_queue'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|94|undefined reference to `al_is_event_queue_empty'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|97|undefined reference to `al_map_rgb'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|97|undefined reference to `al_clear_to_color'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|99|undefined reference to `al_draw_bitmap'|
C:\Users\Ticon\Documents\C++\allegro practise\main.cpp|101|undefined reference to `al_flip_display'|
||=== Build finished: 34 errors, 0 warnings ===|



I'm gonna take a stab in the dark and did something wrong again
Was This Post Helpful? 0
  • +
  • -

#27 snoopy11  Icon User is online

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,234
  • Joined: 20-March 10

Re: Cmake path too long

Posted 26 September 2012 - 09:51 PM

No its not a big problem relax,

You are going to have to link to your libraries now....

do this

Project -> Build options

Linker settings tab

Press add

type this in the edit box exactly

liballegro.dll.a

you might want to check that all the allegro libs are in the mingw lib folder first...

press ok

select rebuild

that should be it...

Snoopy.
Was This Post Helpful? 0
  • +
  • -

#28 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 26 September 2012 - 09:59 PM

Almost there now :)

ld.exe||cannot find -lallegro.dll|

[/code]


I believe the allegro libs are in place though

I was wrong they werent. fixed now except for

"The program can't start because allegro-5.1.dll is missing from your computer. Try reinstalling the program to fix this problem."

This post has been edited by Ticon: 26 September 2012 - 10:01 PM

Was This Post Helpful? 0
  • +
  • -

#29 Ticon  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 320
  • Joined: 20-August 09

Re: Cmake path too long

Posted 26 September 2012 - 10:05 PM

Once again nevermind. I got it running. Tomorrow when I'm not tired im going to write you a speech about how much I appreciate you.
Was This Post Helpful? 0
  • +
  • -

#30 snoopy11  Icon User is online

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,234
  • Joined: 20-March 10

Re: Cmake path too long

Posted 26 September 2012 - 10:09 PM

View PostTicon, on 27 September 2012 - 05:05 AM, said:

Once again nevermind. I got it running. Tomorrow when I'm not tired im going to write you a speech about how much I appreciate you.


Thanks I will look out for it :) I take it you have the bouncing pink girlie box now, goodnight I am going to get an hours sleep b4 I have to go to work its 6am here, things are tough when you are just learning don't worry it gets easier.

Snoopy.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3