Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Video files in Allgro?

Credits go to Ariesnl, Arthur Kalliokoski, Derezo, Evert, gnolam, HoHo, Jonny Cook, Kitty Cat, Michael Faerber, Michael Jensen, Randal Stackpoole, ReyBrujo, Thomas Fjellstrom, Tobias Dammers, Victor Williams Stafusa da Silva, and Zaphos for helping out!
This thread is locked; no one can reply to it. rss feed Print
Video files in Allgro?
Martano
Member #6,536
October 2005
avatar

I downloaded "all420.zip" and unzipped it in my allegro folder, overwriting all. But still get the same errors.

Victor Williams Stafusa da Silva
Member #4,212
January 2004
avatar

Andréas Martano said:

I downloaded "all420.zip" and unzipped it in my allegro folder, overwriting all. But still get the same errors.

Did you runned "fix", "make" and "make install"?

[The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010]

Evert
Member #794
November 2000
avatar

Just grab a binary package from the files section of Allegro.cc

Thomas Fjellstrom
Member #476
June 2000
avatar

Also, don't just overwrite, delete the original folder, then uncompress the new. Otherwise things will screw up.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Martano
Member #6,536
October 2005
avatar

I always get an error when trying to run make.

But the binaries in the download page are from 4.0.3

....too late already overwrote them. :-/

--------------------------------------------------

Found them! Found the binaries for 4.2 .
Thanks. I am downloading them.

Evert
Member #794
November 2000
avatar

Quote:

I always get an error when trying to run make.

What's the error message and how do you run make?

Quote:

....too late already overwrote them.

Not a problem. Just delete the directory tree and unpack a clean package.

Martano
Member #6,536
October 2005
avatar

Quote:

What's the error message and how do you run make?

I open a shell, go to the makefile folder and type: makefile
Then it says: Don't recognize the file.
I tried to type: run makefile
Then it says: Don't recognize 'run'.

After I tried to change the name of the makefile to "makefile.exe". And used the shell again. With the APEG makefile it complains about a fatal error. With the Allegro makefile it doesn't complain, but do nothing (at least I saw no change).

----------------------------------------------

I copied Allegro 4.2 to the right folders and I am getting these errors now:

[Linker error] undefined reference to `oggpackB_readinit'

What is the mean of "Linker error" is it about the includes, linker (-lalleg), or what?

Michael Faerber
Member #4,800
July 2004
avatar

Do not rename Makefile to Makefile.exe!!

Instead you have to run an existing make.exe or mingw32-make.exe in the directory where the Makefile is located.

Example:

Your mingw32-make.exe is in C:\MINGW\BIN. Your Makefile is in C:\ALLEGRO.

You have to open a command line window and type:

CD C:\ALLEGRO
C:\MINGW\BIN\mingw32-make.exe

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

Evert
Member #794
November 2000
avatar

Quote:

I open a shell, go to the makefile folder and type: makefile
Then it says: Don't recognize the file.
I tried to type: run makefile
Then it says: Don't recognize 'run'.

Ok, have you read the instructions in allegro/doc/build/ (pick the one for your compiler, probably MinGW or MSVC)?
How you should run make and install Allegro is explained there (the short answer is what Michael said, but you may want to read the instructions anyway).
You won't need this if you already installed a binary package, but it wouldbe good to read it at least once anyway.

Martano
Member #6,536
October 2005
avatar

Thanks for the explanation. :)

But now I am having only this error when compiling the example code:

C:\Dev-Cpp\Meus\ABCD\Makefile.win [Build Error] [Testes.exe] Error 1

If I delete the:

libapeg.a
libogg.a
libtheora.a
libvorbis.a
libvorbisenc.a

from the linker, the error disappears. But I get "linker errors".

-----------------------------------------

Now I copied the APEG binaries to the same folder of the test project.
And I am getting this kind of errors:

[Linker error] undefined reference to `oggpackB_read'

I am not even using the command: oggpackB_read

Kitty Cat
Member #2,815
October 2002
avatar

You should probably show us the actual error. Saying that removing the libs from the linker removes the errors but gives you errors doesn't make much sense.

PS. you normally use -lname to specify a library (libname.a) on the command line.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Victor Williams Stafusa da Silva
Member #4,212
January 2004
avatar

Sorry to saying that in this form, but its looks like that you fuked up your compiler completely deleting, renaming and replacing files when you shouldn't do that. And fuked allegro too.

I recommed to delete your compiler and your allegro and reinstall they from the start...

[The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010]

Martano
Member #6,536
October 2005
avatar

I tried to put a "-" before the "libapeg.a", but got an error saying that couldn't find: -libapeg.a

----

The problem is:

If I have:

libapeg.a
libogg.a
libtheora.a
libvorbis.a
libvorbisenc.a
-lalleg

in the linkers, I get many errors of this type:

[Linker error] undefined reference to `oggpackB_readinit'
[Linker error] undefined reference to `oggpackB_read'
[Linker error] undefined reference to `oggpackB_read'
more undefined references to `oggpackB_read' follow

-

If I put only:

-lalleg

int the linker, I get only these errors:

C:\Dev-Cpp\Meus\ABCD\testes.o In function `Z13_mangled_mainiPPc':
[Linker error] undefined reference to `apeg_play_mpg'
[Linker error] undefined reference to `apeg_error'
C:\Dev-Cpp\Meus\ABCD\testes.o ld returned 1 exit status
C:\Dev-Cpp\Meus\ABCD\Makefile.win [Build Error] [Testes.exe] Error 1

-

The code is:

1#include <string.h>
2#include <stdio.h>
3 
4#include <allegro.h>
5#include "apeg.h"
6 
7 
8int main(int argc, char *argv[])
9{
10 int ret, depth;
11 
12 if(allegro_init() != 0)
13 {
14 fprintf(stderr, "Error initializing Allegro: %s\n", allegro_error);
15 return -1;
16 }
17 
18 // Check to make sure we have enough cmd-line args
19 if(argc < 2)
20 {
21 allegro_message("Usage: %s <filename.mpg>\n"
22 " <filename.mpg> can be either a file or an embedded datafile object.\n",
23 argv[0]);
24 
25 return 1;
26 }
27 
28 install_timer();
29 
30 install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL);
31 
32 // Set gfx mode
33 depth = desktop_color_depth();
34 if(!depth)
35 depth = 8;
36 
37 set_color_depth(depth);
38 if(set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0) != 0)
39 {
40 if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 640, 480, 0, 0) != 0)
41 {
42 allegro_message("Couldn't set mode 640x480x%i:\n%s\n", depth,
43 allegro_error);
44 return -1;
45 }
46 }
47 clear_to_color(screen, makecol(0, 0, 0));
48 
49 install_keyboard();
50 
51 ret = apeg_play_mpg(argv[1], screen, FALSE, NULL);
52 if(ret == APEG_ERROR)
53 {
54 set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
55 allegro_message("APEG Error: %s\n", apeg_error);
56 }
57 
58 return ret;
59}
60END_OF_MAIN()

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

I tried to put a "-" before the "libapeg.a", but got an error saying that couldn't find: -libapeg.a

Becuase that's not right. The lib<name>.a files should be in your compiler's lib directory, and you link with them using -l<name> (similar to how Allegro is liballeg.a and you link with -lalleg).

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

Thanks again.

But now I am getting only this error:

C:\Dev-Cpp\Meus\ABCD\Makefile.win [Build Error] [Testes.exe] Error 1

I will try to reinstall Dev and Allegro like Victor said.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

But now I am getting only this error:

C:\Dev-Cpp\Meus\ABCD\Makefile.win [Build Error] [Testes.exe] Error 1

That's not the error. That just says that there was an error. The actual error should be before that.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

But the compile tab says only that.

The Compile Log says:
__________________________________

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Meus\ABCD\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Meus\ABCD\Makefile.win" all
g++.exe -D__DEBUG__ testes.o -o "Testes.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/Meus/allegro/lib" -L"C:/Dev-Cpp/lib" -l<libapeg.a> -l<libogg.a> -l<libtheora.a> -l<libvorbis.a> -l<libvorbisenc.a> -lalleg -lgmon -pg -g3

O sistema nÆo pode encontrar o arquivo especificado. (The system couldn't find the file)

make.exe: *** [Testes.exe] Error 1

Execution terminated
_________________________________________

Kitty Cat
Member #2,815
October 2002
avatar

It can't find the libs. Double check those -l switches, and see why they aren't the same as liballeg.a/-lalleg

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

The linkers that I am using are:

-l<libapeg.a>
-l<libogg.a>
-l<libtheora.a>
-l<libvorbis.a>
-l<libvorbisenc.a>
-lalleg

Kitty Cat
Member #2,815
October 2002
avatar

Reread my post. :)

Quote:

It can't find the libs. Double check those -l switches, and see why they aren't the same as liballeg.a/-lalleg

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

Quote:

Reread my post.

Quote:
It can't find the libs. Double check those -l switches, and see why they aren't the same as liballeg.a/-lalleg
--

Sorry... I didn't understand it. :-[

What do you want to say with "double check" and "why they aren't the same"?

Kitty Cat
Member #2,815
October 2002
avatar

Well, to use liballeg.a, you use -lalleg. So, to use libapeg.a, you use...?

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

-lapeg ?

Didn't work :-[ :

cannot find -lapeg

I will try to reinstall.

Michael Jensen
Member #2,870
October 2002
avatar

Quote:

But the compile tab

I didn't know the command line had a compile tab... anyway let us know what happens.

Martano
Member #6,536
October 2005
avatar

APEG.txt:

"Windows users: If you're going to link against the static version of
Allegro, you'll need to create another lib of APEG. First you should run
'cbuild clean' to rid your drive of the object files (so they will
rebuild) and the temp lib. Then set the environment variable STATICLINK
(or pass --enable-static), followed by 'cbuild' and 'cbuild install'.
This will create apeg_s for you to use when linking with alleg_s."

Do I need to do that? Because I have only the binaries, and not 'cbuild' and 'cbuild install'.

------------

I reinstalled XP, dev-cpp, allegro (copied the binaries to "C:\Dev-Cpp\include" and "C:\Dev-Cpp\lib", and the 3 ".dll" files to the folder of my project) and APEG (copied the ".h" files to "C:\Dev-Cpp\include", the ".a" files to "C:\Dev-Cpp\lib", and the ".dll" files to my project folder).

Then I changed the linkers of my project to:

-lapeg
-logg
-ltheora
-lvorbis
-lvorbisenc
-lalleg

But when I try to compile I receive many errors of this type:

[Linker error] undefined reference to `oggpackB_readinit'
[Linker error] undefined reference to `oggpackB_read'
[Linker error] undefined reference to `oggpackB_read'
more undefined references to `oggpackB_read' follow
[Linker error] undefined reference to `oggpackB_readinit'
[Linker error] undefined reference to `oggpackB_read'

The problem is, as you can see in the code showed in previous post, I am not using any "ogg". But when I try to delete the linkers related to APEG, I get only these errors:

C:\Dev-Cpp\Meus\ABCD\testes.o(.text+0x1a9) In function `Z13_mangled_mainiPPc':
[Linker error] undefined reference to `apeg_play_mpg'
[Linker error] undefined reference to `apeg_error'
C:\Dev-Cpp\Meus\ABCD\testes.o(.text+0x1a9) ld returned 1 exit status
C:\Dev-Cpp\Meus\ABCD\Makefile.win [Build Error] [Testes.exe] Error 1

These errors make sense, because I AM using `apeg_play_mpg' in the code.
When I add the linkers, the `apeg_play_mpg' errors are solved, but I gain the "ogg" errors.

I hope this explain all the problem.



Go to: