Thread: Now's the time to try Allegro (newbie and pro alike)!

  1. #16
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Trying your example using v5.5 I now get 7 errors similar to this one:
    Unresolved external '_allegro_install' referenced from d:\bcc55\bin\test.obj.
    Include one concerning the WinMain function.
    I get these errors using your command line example.
    Incase it's a configuration problem here's the files contents.

    bcc55.cfg:
    -I"d:\bcc55\include"
    -L"d:\bcc55\lib;d:\bcc55\lib\PSDK"
    [/QUOTE]

    ilink32.cfg:
    -L"d:\bcc55\lib;d:\bcc55\lib\PSDK"

  2. #17
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    OK, sorry but that last command line thing was pretty worthless as I was just spouting what I could from memory. The following actually will work and is the solution I use.

    I create a batch file named compile.bat Create it in notepad or whatever, just so long as the extention is .bat

    Put this in the file:
    @ECHO OFF
    SET PATH=C:\BCC55;C:\BCC55\BIN;%PATH%
    ECHO Compiling %1 ...
    bcc32 -O2 -Os -q -W -I. -Ic:\bcc55\include -Lc:\bcc55\lib -c -o%1.obj %1.c
    ECHO.
    ECHO Linking %1 ....
    ECHO.
    ilink32 -Lc:\bcc55\lib -x -q -Gn -aa -Tpe c0w32 %1.obj,%1.exe,,c:\bcc55\lib\alleg.lib cw32 import32
    ECHO Finished!
    ECHO.
    IF "%2"=="run" %1.exe


    Make sure the PATH is set right. On lines 2, 4, and 8 replace C:\BCC55 directory with whatever directory you've installed Borland's compiler into.

    Now, you don't even need the .cfg files. Just put the batch file in the directory of your c source or in the path, and at the comand prompt type:

    compile test

    where test.c is your source code. (From here you can modify the batch file to compile more than one c source etc, but this should help show if things work or not. Try it with your 4.5 compiler too, and see if that works.)

    As a second parameter you can say run, to auto run the prog after it is compiled.

    Example:
    compile test run

    Anyway, that should definitely get you going I think. Let me know if you run into any more snags, or if you have trouble with your other Borland compiler.

    Hope that helps.

    -Justin
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  3. #18
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Using the batch file allowed the example to compil ok with v5.5, but not v4.5. With v4.5 I get the 26 errors still. I would like to get it working with v4.5 primary for DOS programming. Also, v4.5 doesn't have the -q switch.

  4. #19
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    OK then. I know what you mean, 4.5 is a darn nice system. Are you using the graphical environment with that or are you limited to the command prompt? (Might be easier just to add the lib in graphically..)

    I have 4.5 on another computer I don't have access to right now. I'll post again once I do.. However, since they are the same errors you had before with 5.5, I feel pretty confident we can get this working. . oh, by the way, do you get an object (test.obj) file ok and then the linking fails, or is it the initial compile that fails?

    -Justin
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  5. #20
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    I have both the command line and the IDE for v4.5. For the testing I'm using the command line.

    After looking over your batch file for incorrect paths, which I did have, and removing the -q switch I now get a different set of 26 errors. It lists the errors locations with problems with the base.h and system.h files. Appear to be because the way it was written. Shows them like this: e:\bc45\include\allegro/system.h
    I haven't had to much experience using headers files so I might be wrong. The mosts of the errors are: ") expected", "declaration missing ;", and, "value of type void is not allowed"

    Also, the linking stage and object file is OK. Although one isn't produced. The problem is in the compilng stage.


    Thanks for the help you've provide so far.
    Last edited by lambs4; 12-23-2001 at 09:08 PM.

Popular pages Recent additions subscribe to a feed