Author Topic: Codeblocks and allegro  (Read 24427 times)

download123

  • Guest
Codeblocks and allegro
« on: March 01, 2006, 05:16:48 pm »
I'Ve a problem  :shock:
I want to use allegro with Codeblocks,
With the dev-pack plugin I installed the allegro plugin,
but now I don't know how i can use allegro,
there is no option to start a new allegro projekt.
And if I starte an empty projekt and
try to use allegro
I get some errors

#include <allegro.h>

int main() {
    allegro_int();
    allegro_message("Hellow World!");
    return 0;
}
END_OF_MAIN();
error: allegro_int() undecleare...


sethjackson

  • Guest
Re: Codeblocks and allegro
« Reply #1 on: March 01, 2006, 05:18:21 pm »
Have you linked in the allegro libs?

download123

  • Guest
Re: Codeblocks and allegro
« Reply #2 on: March 01, 2006, 05:43:21 pm »
no  :?
... okay liballeg.a linkt.. it workes fine...

how can i save it as a projekt draf?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codeblocks and allegro
« Reply #3 on: March 01, 2006, 06:53:17 pm »
no  :?
... okay liballeg.a linkt.. it workes fine...

how can i save it as a projekt draf?

Do you mean as a template? If yes, just Project-->Save project as user-template.

Best wishes,
Michael

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: Codeblocks and allegro
« Reply #4 on: March 01, 2006, 07:52:09 pm »
I'Ve a problem  :shock: [...]
Within the project settings of your (!) allegro project: Did you setup the compiler/linker settings to include the path to the "include"/"lib" folder the allegro DevPack should provide? You should find both folders right in the directory where you installed the allegro DevPack into.
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

download123

  • Guest
Re: Codeblocks and allegro
« Reply #5 on: March 02, 2006, 03:58:02 pm »
how do you mean include ??

I tried so far :
Project -> build options -> directories

but it doesn't work  :(

only my first test worked :-(

Please help
« Last Edit: March 02, 2006, 05:05:53 pm by download123 »

download123

  • Guest
Re: Codeblocks and allegro
« Reply #6 on: March 02, 2006, 05:55:34 pm »
I'm sorry that I'm such a Noob but please help me ... I wont have to use an other program  :(

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codeblocks and allegro
« Reply #7 on: March 02, 2006, 06:05:35 pm »
I'm sorry that I'm such a Noob but please help me ... I wont have to use an other program  :(

Sorry, but I do not have fully understood which problems do you have. Anyway, to use Allegro or any other library, you should include the path to the include files and the path to the libraries in:

Project-->Build options-->Directories-->Compiler //for the include files
Project-->Build options-->Directories-->Link //for the libraries

Moreover, in Project-->Build options-->Linker, you should added the libraries you need.

Hope this help a bit.

Best wishes,
Michael

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Codeblocks and allegro
« Reply #8 on: March 02, 2006, 06:17:48 pm »
I would suggest you to follow the steps to compile allegro by yourself. It's quite simple and takes only a few minutes.

Download:
Allegro 4.2.0
DirectX 7 SDK Minimal version for Allegro

Quick steps:
Decompress Allegro somewhere.
Decompress DirectX 7 SDK Minimal into the MinGW folder (overwriting files).
Add an environment variable named MINGDIR pointing to your MinGW folder.
Open a console (cmd or command.com depending on your Windows version).
cd into the folder you decompressed Allegro.
cd allegro
fix mingw32
make
make install

Now all you need when creating a project that uses allegro is going to Project -> Build options. There click on the Linker tab. Now add alleg to the Link libraries.

You can also try with the steps provided here.

If you have problems related to Allegro itself post them here.

download123

  • Guest
Re: Codeblocks and allegro
« Reply #9 on: March 02, 2006, 07:09:04 pm »
.. I though that I've allready installed allegro with a dev-pack...

but if I try to compile a Code [that I've written in dev-c++]

there were a few errors

for exemple

conflicting declaration 'typdef struct tagBITMAP BITMAP'
'BITMAP' has a previous declaration as 'typdef struct tagBITMAP BITMAP'

this error message 6-7 times

after that 6-7 messages
'textout_ex' undeclare (first use in this funktion)

and a other questin
what is the MinGW folder (i've installed MinGW with codeblocks)

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codeblocks and allegro
« Reply #10 on: March 02, 2006, 07:20:44 pm »
When you post for problems, you should post which C::B/OS version are you using and also which version of MinGW/GCC.

From what you are saying, I suppose that you are using RC2 with MinGW boundled..

I would advice you to do the following:

Install MinGW 5.02 in C:\MinGW. Eventually, update binutils and win32api files. You can also install GCC 3.4.5
Install the latest nightly build. Not in the same directory as RC2. Chose another directory.

Follow Ceniza's instructions.

Best wishes,
Michael

download123

  • Guest
Re: Codeblocks and allegro
« Reply #11 on: March 02, 2006, 07:26:16 pm »
sorry...

I've C::B Version "1.0rc2"

And as OS Microsoft Windows XP SP 2...

I've installed the Code::Blocks IDE, with MINGW compiler so I don't know the MINGW version,

 must I install MinGW one more time?

If yes, where can I get it?
« Last Edit: March 02, 2006, 07:33:18 pm by download123 »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codeblocks and allegro
« Reply #12 on: March 02, 2006, 08:03:06 pm »
sorry...

No problems :D.

I've C::B Version "1.0rc2"

And as OS Microsoft Windows XP SP 2...

RC2 version is now a bit old and it is much better to use the nightly builds. You should give them a try :).

must I install MinGW one more time?

If yes, where can I get it?

IMHO having a separate installation of MinGW is better. MinGW it is easier to update and you can add Ceniza's GCC 4.1.0 final version (really cool :D).

Installing MinGW is easy and I would advice to install it in C:\MinGW. You can find it here. But use installer MinGW 5.0.2 and install the candidate (so that you get GCC 3.4.4). The website gives also info on how to update MinGW.

After installing it, download and install the latest nightly build.

Best wishes,
Michael

download123

  • Guest
Re: Codeblocks and allegro
« Reply #13 on: March 02, 2006, 08:26:55 pm »

IMHO having a separate installation of MinGW is better. MinGW it is easier to update and you can add Ceniza's GCC 4.1.0 final version (really cool :D).

What ist Ceniza's GCC ???

I've installed minGw now... im going to installe the direct x now

and I can't load the last nightly because "Too many clients for /codeblocks/CB_20060301_rev2102_win32.7z"
« Last Edit: March 02, 2006, 08:38:02 pm by download123 »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codeblocks and allegro
« Reply #14 on: March 02, 2006, 08:54:42 pm »
What ist Ceniza's GCC ???

Have a look at Ceniza's signature. Ceniza has provided a binary snapshot of GCC 4.1.0 for MinGW. Personally, I have two MinGW installation. One with GCC 4.1.0 and the other with GCC 3.4.5. So, I can switch in case of need :D.

Before, I forget, you should also download and install gdb 6.3.2, if you want to debug your applications.

Best wishes,
Michael