Code::Blocks Forums

User forums => Help => Topic started by: download123 on March 01, 2006, 05:16:48 pm

Title: Codeblocks and allegro
Post by: download123 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...

Title: Re: Codeblocks and allegro
Post by: sethjackson on March 01, 2006, 05:18:21 pm
Have you linked in the allegro libs?
Title: Re: Codeblocks and allegro
Post by: download123 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?
Title: Re: Codeblocks and allegro
Post by: Michael 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
Title: Re: Codeblocks and allegro
Post by: MortenMacFly 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.
Title: Re: Codeblocks and allegro
Post by: download123 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
Title: Re: Codeblocks and allegro
Post by: download123 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  :(
Title: Re: Codeblocks and allegro
Post by: Michael 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
Title: Re: Codeblocks and allegro
Post by: Ceniza 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 (http://prdownloads.sourceforge.net/alleg/all420.zip?download)
DirectX 7 SDK Minimal version for Allegro (http://alleg.sourceforge.net/files/dx70_min.zip)

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 (http://ceniza.cenizasoft.cjb.net/mingw3.htm).

If you have problems related to Allegro itself post them here (http://www.allegro.cc/).
Title: Re: Codeblocks and allegro
Post by: download123 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)
Title: Re: Codeblocks and allegro
Post by: Michael 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
Title: Re: Codeblocks and allegro
Post by: download123 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?
Title: Re: Codeblocks and allegro
Post by: Michael 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 (http://www.mingw.org/). 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
Title: Re: Codeblocks and allegro
Post by: download123 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"
Title: Re: Codeblocks and allegro
Post by: Michael 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
Title: Re: Codeblocks and allegro
Post by: Michael on March 02, 2006, 08:56:33 pm
and I can't load the last nightly because "Too many clients for /codeblocks/CB_20060301_rev2102_win32.7z"

May be you can wait a bit and re-try. Personally, I compile C::B myself. It is not so difficult and it is worth :).

Best wishes,
Michael
Title: Re: Codeblocks and allegro
Post by: Ceniza on March 03, 2006, 03:08:41 am
About the textout_ex function undeclared it's because that function was introduced somewhere in Allegro 4.1.x, and 4.2.0 inherited it. That would mean the package you got is surely Allegro 4.0.x or a very old 4.1.x.

The conflicting declaration of BITMAP is because of Windows headers. If you don't include a Windows header with 4.2.0 it shouldn't complain AFAIK, but if you really need to include a Windows header be sure to include them in this order:

Code: cpp
#include <allegro.h>
#include <winalleg.h>
#include <windows.h> // or the Windows header you need

And also add in Project -> Build options, Compiler, #defines:

Code: cpp
__GTHREAD_HIDE_WIN32API
Title: Re: Codeblocks and allegro
Post by: download123 on March 11, 2006, 04:23:02 pm

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

Best wishes,
Michael


where can i get gdb 6.3.2??
Title: Re: Codeblocks and allegro
Post by: yop on March 11, 2006, 04:28:13 pm
http://www.mingw.org/download.shtml
Title: Re: Codeblocks and allegro
Post by: Gardian on January 27, 2014, 01:10:53 am
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

I did this, and now i am getting, not an error saying that the commandsdon't exist or the .h files don't exist, but that that projects main.o file dosent exist, how do i fix this?