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?
Evert
Member #794
November 2000
avatar

Try permuting the order in which you link the libraries. In particular, put libogg.a before libapeg.a
EDIT: actually, try putting libapeg.a just before liballeg.a.

Martano
Member #6,536
October 2005
avatar

Now got more errors:

[Linker error] undefined reference to `vorbis_block_clear'
[Linker error] undefined reference to `vorbis_dsp_clear'
[Linker error] undefined reference to `ogg_stream_clear'
[Linker error] undefined reference to `ogg_sync_clear'
[Linker error] undefined reference to `theora_clear'
[Linker error] undefined reference to `theora_info_clear'

...

Michael Jensen
Member #2,870
October 2002
avatar

Quote:

I reinstalled XP

Why?

Quote:

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

No, because you have the binaries, you do not have to build the package.

Quote:

Then I changed the linkers of my project to:

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

that's good, just make sure that you change them to the order you need them in, as evert alluded to.

Quote:

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'

Right, so the apeg library is using the ogg library, so I belive you want to include the -logg/vorbis/theora before -lapeg.

Quote:

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

Right, like you said. That makes sense.

So, even if conditional logic prevents a call from ever happening (ex: when you load your video, it's not ogg/theora/vorbis format), for your code to link properly all of the external dependencies must be known to the linker. So your project is using apeg, which is using (conditionally) ogg/vorbis/theora, etc...

Martano
Member #6,536
October 2005
avatar

I changed the order, but only got more kinds of errors:

[Linker error] undefined reference to `vorbis_block_clear'
[Linker error] undefined reference to `vorbis_dsp_clear'
[Linker error] undefined reference to `ogg_stream_clear'
[Linker error] undefined reference to `ogg_sync_clear'
[Linker error] undefined reference to `theora_clear'
[Linker error] undefined reference to `theora_info_clear'

Now not only "ogg", but "theora" and "vorbis" are in conflict too.

Kitty Cat
Member #2,815
October 2002
avatar

This is the order APEG uses for the examples:
-ltheora -lvorbis -lvorbisenc -logg -lapeg -lallegTry 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

:'(

Still got the same errors (about vorbis, theora and ogg).

Michael Jensen
Member #2,870
October 2002
avatar

it sounds like something else is using theora. vorbis, and ogg, that is being referenced before they are....

Kitty Cat
Member #2,815
October 2002
avatar

Wonder if it has anything to do with the fact that APEG's precompiled, and conflicting with the existing Ogg libs.

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

Michael Jensen
Member #2,870
October 2002
avatar

Right, maybe if it was compiled against a different version, then no matter what order he puts them in, it won't recognize ogg/theora/vorbis, etc because they're the wrong version. Correct?

Martano
Member #6,536
October 2005
avatar

So.... I need compile APEG.

Trying again:
______________________________________________________

C:\Hangar6\apeg>c:\dev-cpp\bin\mingw32-make.exe
cc -W -Wall -Werror -02 cbuild.c -o cbuid
process_begin: CreateProcess((null), cc -W -Werror -02 cbuild.c -o cbuild, ...) failed.
make (e=2): The system couldn't find the file.
c:\dev-cpp\bin\mingw32-make.exe: *** [cbuild] Error 2

C:\Hangar\apeg>

______________________________________________________

Got the same error as before. :-/
I still don't know how to run "make".

Kitty Cat
Member #2,815
October 2002
avatar

There's a small bug in the Makefile. Edit it and change $(MINGW) to $(MINGDIR) on the first line.

Or you can compile and run cbuild manually:

gcc -O2 -W -Wall cbuild.c -o cbuild.exe
cbuild.exe

Quote:

I still don't know how to run "make".

That's what you're doing when you run mingw32-make.exe.

--
"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

I tried to correct the make file, but got the same error.
Then used the "gcc" command. It complained that didn't know the "-02" variable. So I tried without the "-02", and it created the "cbuild.exe" file. So I run the "cbuild.exe", but it showed many errors.
Please see attached file for a screen-shot with the errors.

ReyBrujo
Moderator
January 2001
avatar

It seems you need to download and compile the ogg vorbis library. Also, you need to set your MINGDIR variable to point where you have the gcc.exe file.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Kitty Cat
Member #2,815
October 2002
avatar

Okay, there's a few problems with the cbuild script (it should've stopped after complaining about MINGDIR), but the underlying problem is that MINGDIR isn't set. I don't quite remember h ow to set it in Windows... I think it's right-click My Computer->Properties->Advanced->Environment Variables. Set it to your base MinGW dir (C:\Dev-Cpp in this case, I think). As well, make sure C:\Dev-Cpp\bin is the first thing in your path.

Also, that's -O2, not -02 (capital letter o, not the number zero).

EDIT: I just uploaded APEG 1.1.1 (check my sig), which should fix the makefile and script issues. You'll still need to get the Theora, Vorbis, and Ogg libs and headers installed if you want support for them, though.

--
"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

My MINGDIR was set to "C:\Dev-Cpp". I changed it to "C:\Dev-Cpp\bin", but got the same errors.
So downloaded the new APEG 1.1.1 and tried to run make in it. But got the same errors again. Then tried to run the "gcc ...." command, but now it stopped saying:
_____________________________________________

Testing for Xv support... tmp.c:2: error: syntax error before "tmp"
tmp.c:2:168: invalid suffix "$" on integer constant
not found

Your MINGDIR environment variable is not set!
_____________________________________________

But the variable IS set. :-/

-----------------------------------------------------------
EDIT:
Oh! Got it!
The MINGDIR variable was at my "System Variables", I created the same variable, but now at "Variables for users". Now "make" worked!

I am still trying to correct the problem with the libraries.
-----------------------------------------------------------
EDIT:
Ok, how do I compile ogg, theora and vorbis?
There are many makefiles, but they are ".am" and ".in"
I tried to read the docs, but found texts only about the commands.

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

the APEG Makefile said:

ifneq ($(MINGW)$(DJGPP),)

Shouldn't it be "ifeq"?

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

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Shouldn't it be "ifeq"?

No. I want that section to run when MINGDIR or DJDIR does not equal nothing.

Quote:

Ok, how do I compile ogg, theora and vorbis?

Get a sh-compatible shell (such as the one that comes with MSys). Then you can run the configure script and then make.

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

Michael Jensen
Member #2,870
October 2002
avatar

you might be able to download binaries of those libaries, since I'm assuming that's all you need, and you can compile apeg agains them; also if you're not going to use that functionality, you can disable it before compiliing, and then you will not need them.

Quote:

the "-02" variable

As KC already said it's -O2; but also it means to use a specific type of optimization, there is an -O1 also. I belive -O2 is for speed...?

Quote:

I don't quite remember h ow to set it in Windows

Should be in the allegro instructions...

Quote:

Oh! Got it!

RIGHT ON! 8-)

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

you might be able to download binaries of those libaries, since I'm assuming that's all you need

Last time I looked, I wasn't able to find binaries. :-/ No official ones, anyway.

As for optimization switches:

  • -O0 - Turn off optimizations. Default

  • -O1 - Light optimizations for speed

  • -O2 - More optimizations

  • -O3 - Heavy optimization. Can potentially break code or cause a performance hit

</li>
You can only use one. If you specify more than one, the last one specified is used.

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

Michael Jensen
Member #2,870
October 2002
avatar

Hmm... I did't know that about -03 ... I wonder if that's what dev-cpp used by default in a certain 4.x version...

I had downloaded it and compiled a working game with it (that was my own, at the commandline I was passing in -O2); but it crashed left and right, and had all kinds of issues when compiled by dev-cpp's gcc, which also liked to pass in about a page and half of other wierd ass arugments...

moral: don't use dev-cpp! :o

Kitty Cat
Member #2,815
October 2002
avatar

Note that it's rare for -O3 to cause a crash. The more code trickery you use, the more likely it is to happen, but under normal cirumstances it's fine. Generated code speed is another issue, though. That depends greatly on the code and the processor.

--
"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:

Then you can run the configure script and then make.

I tried to type "configure", but it didn't recognize the command.

Kitty Cat
Member #2,815
October 2002
avatar

In a sh-shell, you need to use ./configure

--
"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

I am using the shell that comes with Windows XP.
Used the "cd" command until the "libogg-1.1.2" folder.
There tried:

./configure
/configure
configure

But I got the same answer:

'....' is not recognized as a internal or external command or an operational program.

Kitty Cat
Member #2,815
October 2002
avatar

I said:

Get a sh-compatible shell (such as the one that comes with MSys). Then you can run the configure script and then make.

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



Go to: