Hi,
I'm trying to get allegro working with codeblocks.
I've installed CodeBlocks. Do I need to set up the paths next ?
]]>Go to Settings->Compiler and Debugger->Toolchain Executable.
You'll want it looking like this (though you may have to change the installation directory):
http://www.allegro.cc/files/attachment/594188
Then when you want to compile, go to Project->Build Options->Linker settings, then add the allegro library.
edit: If you're running under Vista, you need to do a few more things. See here.
]]>Here's what it looks like atm
http://www.allegro.cc/files/attachment/594189
edit :
which directory should unzip allegro to ?
My codeblocks directory is C:/CodeBlocks
]]>Where do you have gcc installed? This is where the Compiler Installation Directory should be set to. At the moment, yours is pointing to your Code::Blocks directory.
If this is where you've installed gcc, it's better to keep them seperate.
edit:
which directory should unzip allegro to
It really doesn't matter, when you compile Allegro, it will put the .h and .a files in the right place. You can make things even easier for yourself once Code::Blocks is up and running by installing the Allegro DevPak, which will do everything for you.
]]>thanks,
I installed a version of CodeBlocks which comes with mingw32.
I used the command ggc -v from C:\CodeBlocks\bin and I got the version
so it must be in their somewhere.
Sounds like you think it's better to keep them seperate.
]]>Sounds like you think it's better to keep them seperate.
Mostly because I use the nightly builds, so when I install a new one, I just delete the entire Code::Blocks directory and unzip the new files.
By the way, the version that comes with gcc is an older version (it's almost two years old now). The latest nightly build is stable and has a lot more features than the 1.0RC2 version (and despite the fact that they call the RC2 release the stable release, the nightly builds are usually actually more stable).
edit: the nightly builds are here.
]]>thanks,
I followed the instructions.
My codeblocks directory looks like :-
http://www.allegro.cc/files/attachment/594190
Now I'm wondering if I have to change my PATH.
Also if I have to complile allegro.
Now I'm wondering if I have to change my PATH.
You don't need any entries in the path to run Code::Blocks, or even for MinGW if you are using Code::Blocks. It's still a good idea to set the MINGDIR environment variable and add your MinGW\bin directory to the path though should you ever wish to compile from the command line.
Also if I have to complile allegro.
You can manually compile it if you want to. Otherwise, you can get the precomiled binaries and just copy the files to the correct places, or even easier, just use the DevPak (the latest version is only 4.2.1 however).
]]>thanks Lenny,
not sure what to do to install the devpak though
]]>Got to Plugins->Dev-C++ DevPak updater/installer. Change the update server to devpaks.org and look in the Allegro category.
]]>Thanks very much for all the help.
One more thing I need to know is where liballeg.a is. That's what I need to use isn't it ?
edit : sussed it out myself but I get this as the build output :-
"colour_converter - Release" uses an invalid compiler. Skipping...
Nothing to be done.
Anyone know what's wrong ?
]]>I've only ever got that error when the Compiler Installation Directory is set incorrectly.
]]>I don't recall installing mingw32. I downloaded a zip file mingwm10_441.zip
which the page said I'd need if I didn't have mingw32. Am in the dark.
That dll is needed for the Code::Blocks IDE to run.
If you want Code::Blocks to use MinGW as the compiler (Code::Blocks can be used with many compilers), then yes, you do have to have MinGW installed on your system.
]]>Hi,
Don't know if there's a simple answer to this. Here's the compiler output -
Compiling: main.c Linking console executable: bin\Release\colour_converter.exe Execution of 'mingw32-g++.exe -o bin\Release\colour_converter.exe obj\Release\main.o -s' in 'C:\codeblocks\1stproject\colour_converter' failed. Nothing to be done.
]]>
Yeah. It's because the exe is already created and that.... there is nothing more to do !
Check that /bin/release directory, your exe should be there !
]]>It doesn't seem to be.
]]>Yeah, my bad. I missed the end of the line.
BTW, what is that '-s' you seem to have when linking ?
]]>I don't know. The makefile's made automatically i think.
]]>The '-s' means strip out debugging info from the output.
To the OP: Get a command prompt and type "set > env.txt" and post env.txt here.
]]>Sorry but in which directory ?
]]>It doesn't matter which directory you type SET in. It's a cmd.exe builtin.
]]>http://www.allegro.cc/files/attachment/594197
I typed it but I think nothing happened or if it did I can't find env.txt .
]]>"dir env.txt"?
You should have a "C:\Documents and Settings\william labbett\env.txt" you can grab with the Attachments thing.
Oh hey, you know what I did? Uninstall everything, install Dev-Cpp (with MinGW), then install the latest version of Code::Blocks from the nightly build dealie, and it automatically found the MinGW installed from Dev-Cpp. Downloaded OpenLayer, following the easy procedure in my Installing OpenLayer video. Lickity smack bam! everything was ready to go.
]]>Mark - maybe I'll try that later.
env.txt is attached.
edit :- sorry, I obviously failed to.
]]>Where? I don't see the paperclip thing
[EDIT] I'm out of time
]]>I find it advantageous since I still have old programs I did in Dev-C++, so it's not a waste of space.
]]>Mark - Yeah, at least Dev-C++ is simple, and I guess now it's frozen in time.
]]>Oh hey, you know what I did? Uninstall everything, install Dev-Cpp (with MinGW), then install the latest version of Code::Blocks from the nightly build dealie, and it automatically found the MinGW installed from Dev-Cpp.
If you have MinGW set up properly, Code::Blocks will detect it anyway. Plus, the version of gcc that comes with Dev-C++ is outdated.
I find it advantageous since I still have old programs I did in Dev-C++, so it's not a waste of space.
Code::Blocks can import Dev-C++ projects.
]]>Is it that MINGDIR is wrong ?
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\william labbett\Application Data
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=YET-Q7KGXS5BGGV
ComSpec=C:\WINDOWS\system32\cmd.exe
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\william labbett
LOGONSERVER=\\YET-Q7KGXS5BGGV
MINGDIR=C:\Dev-Cpp
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WbemC:\Dev-Cpp\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 1, AuthenticAMD
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0801
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\WILLIA~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\WILLIA~1\LOCALS~1\Temp
USERDOMAIN=YET-Q7KGXS5BGGV
USERNAME=william labbett
USERPROFILE=C:\Documents and Settings\william labbett
windir=C:\WINDOWS
]]>
Is it that MINGDIR is wrong ?
If you have MinGW installed somewhere other than C:\Dev-Cpp, then probably.
]]>I changed the MINGDIR variable to what I think it should be and tried compiling helloworld and got
Linking console executable: bin\Release\colour_converter.exe Execution of 'mingw32-g++.exe -o bin\Release\colour_converter.exe obj\Release\main.o -s' in 'C:\codeblocks\1stproject\colour_converter' failed. Nothing to be done.
...once again, so that wasn't the problem.
i know this muzt be really irratating but I do appreciate your
help, so if you think you can help me, please do.
I don't want to go and join a bhuddist monastry
to try to get rid of my desires (at least not yet).
Try manually executing "mingw32-g++.exe -o bin\Release\colour_converter.exe obj\Release\main.o -s" from the command line in the "C:\codeblocks\1stproject\colour_converter" directory and see if you get any error messages.
]]>I get :-
minw32-g++.exe is not recognised as an internal or external command, operable program or batch file.
]]>Three options:
1) Go to Settings->Compiler and Debugger->Toolchain Executable and change the C++ compiler option to g++.exe.
2) Go to the MinGW\bin directory and rename g++.exe to mingw32-g++.exe.
3) Install the latest version of MinGW.
]]>Thanks.
First up I should say that my project is in C (not C++).
I tried your second option and couldn't find g++.exe in the mingw32\bin directory.
]]>I tried your second option and couldn't find g++.exe in the mingw32\bin directory.
It should be in the mingw\bin directory, not the mingw\mingw32\bin directory.
]]>Thanks.
Appears I don't have a mingw directory. All I have is a mingw32 directory.
I used MinGW32-5.1.3 .
Maybe that was the wrong choice ?
Does your mingw32 directory contain another directory called mingw32?
]]>Sorry I'm late.
The answer to your question is no.
In that case, the installer didn't install everything.
You can find a guide to manually installing the latest stable release here.
]]>Thanks. I'll get on it and let you know how I get on.
]]>Good luck.
]]>Still busy, but wondered if it was worth mentioning that although I downloaded all the files in the list my directory structure has one folder missing from the structure shown on that page.
http://www.allegro.cc/files/attachment/594202
The directory ringed in green is missing from my structure.
]]>I don't have that one either, so no worries.
]]>Well I've managed to compile hello world
Next I tried a simple allegro program but although I've installed the allegro devpak I get this compiler error :-
allegro.h no such file or directory.
So I'm stuck again.
]]>Have you tried using Windows file search to locate where allegro.h is?
]]>It's in
C:\Devpaks\include
Should I reinstall the devpak somewhere else ?
]]>Just copy all the Allegro files from the Devpaks directory to the MinGW directory, ensuring that they're in the same subdirectory.
]]>Since you replied things changed a bit. Here's how my directory looks now -
http://www.allegro.cc/files/attachment/594204
Can you refer to this image when explaining what to do ?
]]>Try this:
Go to Settings->Compiler and Debugger->Toolchain executables and add the following lines to Additional paths:
c:\codeblocks\devpaks\bin c:\codeblocks\devpaks\include
edit:
Or, find the allegro DecPak, and change the .DevPak extension to .tar.bz2 and then extract all the contents to your MinGW directory.
]]>Thanks.
I did what you said and now I can compile C programs but still it can't find
allegro.h .
I'm thinking of trying your second idea but am wondering if I'd do just as well to download the source and compile it. What do you think ?
]]>Well, you would get a later version that way since the DevPak is 4.2.1. You can always just download the prcompiled library.
]]>dumb question... but are u including it like this?
<allegro.h> or <allegro/allegro.h>
{"name":"dir.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/0\/10635cc48f6efabf0d126aa280f489fb.jpg","w":728,"h":449,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/0\/10635cc48f6efabf0d126aa280f489fb"}
]]><allegro.h>
]]>first off.. I don't suggest installing mingw32 in the codeblocks folder... Installing mingw in C:\MinGW folder is usually best and easiest especially if you update codeblocks later on...
From the www.MinGW.org download page.
The easiest way to install MinGW is through the mingw-installer found in the Current package set, Current->MinGW
Here is a link to the Source forge page.
http://sourceforge.net/project/showfiles.php?group_id=2435
after that just setup the environment variables MINGW and PATH and then from the command prompt you would do this...
C: // Drive where you installed allegro CD\Allegro // Or wherever you installed allegro fix mingw32 make all make installall
Then let it compile... It's tedious and it takes awhile to compile but this will work... Make should put everything in the right places for MinGW... If you don't have many things installed into codeblocks then I'd suggest uninstalling and re-installing after MinGW is setup because codeblocks should detect it and use it by default and it will get rid of any changes that might keep you from using it properly.
Hopefully after I finish the Allegro Installer people won't have any problems
[edit] During Automated install Select 'G++ compiler' and 'MinGW make'
]]>EDIT:
What are your linker commands?
Oh and I thought that on Linux everything will be harder. But as I see a horror story about installing and getting Code::Blocks working under Windows I'm glad I left them.
I'd suggest you to compile allegro from sources. I had to do that even on Windows in order to get AllegroGL done. Since then I'm quite accustomed to compile things by hand. Unfortunately the Windows environment is not so friendly to this out of box.
I agree with what you stated in the previous thread - we could use a little refresh in the help system.
How about we have a single place where people can go and download precompiled libraries for any platform. Precompiled installer packages of opensource ide's etc. All this and source code(s). A one stop shop. None of this "go to site x and click on svn loader repository looptie doo
...
God I hate that!
I second that. I remember when I was trying to compile OpenLayer for the first time. I thought I'll go on killing spree - at first I had to download svn manager and then overcome bazillion of problems. Maybe we should write a wiki page. With detailed how-to. It could contain a links to other pages - especially the Code::Blocks tutorials someone posted in the other thread were usefull.
]]>Continuuing the other half of this discussion from here : Other Setting Up thread
- William -
You said you've separated your folders for mingw and code blocks but you've still got your %PATH% and your %MINGDIR% pointing to your code blocks directories.
You also said that you can't find gcc.exe or mingw32-gcc.exe , they should both be in the bin subfolder of your mingw directory. If they're not there , then mingw wasn't installed correctly. Getting MinGW installed manually is not such a big deal , just follow the directions here :
Code::Blocks wiki MinGW installation guide
Let us know how it goes.
Perhaps you'll be pleased to hear that I've made some progress.
I'm trying to run a simple allegro program. It compiles without problems but it
can't be run because alleg42.dll can't be found.
I installed the allegro in a folder called devpaks which I put in the MinGW directory.
]]>Did you forget "make install"?
That should have copied over the allegro dll's to your %WINDOWS%\system32 directory , which should be on your %PATH%.
I didn't know I had to do that. I was using the devpak utility.
Which directory should I make install from ?
]]>If you want to use Code::Blocks , you should compile Allegro yourself or download a precompiled version for mingw.
Go to the allegro files web page and
Compile it yourself
Download the zip file for allegro 4.2.2 source code and extract it to your mingw directory.
Go to the command line and "cd" to the newly created allegro directory.
For each combination of parameters that you would like , enter
make [parameter1] [parameter2] make install [parameter1] [parameter2]
where [parameter1] is either "DEBUGMODE=1" , nothing , or "PROFILEMODE=1" , and [parameter2] is either "STATICLINK=1" , or nothing. (No brackets or quotes)
You can also use "make all" and "make install all" but I've never tried that , and I don't know if it makes any of the static versions.
Pre-compiled version
Head down to the binary section of the allegro files web page and download and/or extract your favorite files. If you download the non-executeable binaries , you'll probably need to copy the dll's over to your %WINDOWS%\system32 folder yourself.
If the allegro is up and ready, all you need is to copy those dll files into your system32 folder, or have alleg42.dll by your executable.
]]>it is no longer a wise idea to be putting DLL's in the system32 folder.
put them with the application that uses them.
]]>Thanks for all the help, especially LennyLen and Edgar.
I've finally got it working and I've learnt a lesson or two aswell.
I'm really grateful for your patience and goodwilling-ness.
BTW I just put the file in the system32 folder because I didn't fancy copying it to every folder I make an allegro program in.
]]>So you choice the lazy path, instead of the right path. Good luck with life.
]]>There's nothing lazy about it , he develops allegro programs , there's no sense in him making a copy of the same dll to every folder he ever puts an allegro program in. For the end user , yeah maybe since that way they'll always have an appropriate version of the dll , but otherwise , there's really no big deal with it.
]]>Because real men put a copy of Microsoft Runtime libraries in EVERY bin/debug and bin/relase directory
]]>