[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Adding new dependencies for pygame



hi,

try including all your .h files in that one .h file.

Not all versions of ffmpeg guard against multiple inclusion... and you're including some files multiple times.
So either make sure you're only including once, or put your own guards around them (as detailed above).

that should fix it... I hope.


cu.




On Thu, May 21, 2009 at 10:43 AM, Tyler Laing <trinioler@xxxxxxxxx> wrote:
Sorry, just figured it out:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -D_REENTRANT -I/usr/X11R6/include -I/usr/include/SDL -I/usr/local/include -I/usr/include/python2.5 -c src/ff_movie.c -o build/temp.linux-x86_64-2.5/src/ff_movie.o



On Wed, May 20, 2009 at 5:35 PM, Tyler Laing <trinioler@xxxxxxxxx> wrote:
What do you mean by "gcc line of something that fails"?

Something like this:

In file included from /usr/local/include/libavutil/avutil.h:56,
                 from /usr/local/include/libavcodec/avcodec.h:30,
                 from /usr/local/include/libavformat/avformat.h:45,
                 from src/ff_movie.h:5,
                 from src/ff_movie.c:18:
/usr/local/include/libavutil/common.h:134: error: redefinition of ‘av_log2’
/usr/include/ffmpeg/common.h:98: error: previous definition of ‘av_log2’ was here


Thats the first error that comes up.

-Tyler


On Wed, May 20, 2009 at 5:18 PM, René Dudfield <renesd@xxxxxxxxx> wrote:
hi,

that likely depends on your include paths.  Generally /usr/local/include/ comes first.

You might need to put in your own head guards if ffmpeg isn't putting them in themselves.

Like so:

#ifndef MY_BLA
#define MY_BLA
#include "bla.h"
#endif

Hopefully then things only get included once.

What is the gcc line of something that fails?


cu,





On Thu, May 21, 2009 at 10:07 AM, Tyler Laing <trinioler@xxxxxxxxx> wrote:
Thanks Lenard, that worked. Now, just fixing bugs that are stopping compilation.

One problem I ran into and solved was that I was using the wrong version of the header files. However, in solving that, it seems to be trying to include both the versions, which end up conflicting and generating a huge list of conflict reports. Is there anyway to tell setup not to use the header files in /usr/include, and instead use the headers in /usr/local/include in the dependency?

-Tyler


On Wed, May 20, 2009 at 1:28 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
Your shouldn't need anything special for the includes if the headers are in /usr/include or /usr/local/include. The dependency is primarily for passing extra libraries to the linker: -lavcodec -lavdevice -lavformat -lavutil -lswscale. For config_unix.py try adding:

Dependency('FFMPEG', 'avformat.h', 'libavformat', ['avcodec', 'avdevice', 'avformat', 'avutil', 'swscale']),

though you may have to shuffle the library order to get it to link. The 'avformat.h' and 'libavformat' are merely files the config_unit.py searches for to determine if ffmpeg is available.

In Setup.in add:

FFMPEG = -lavcodec -lavdevice -lavformat -lavutil -lswscale

after the "PORTTIME =" entry. Again put the libraries in the order required to link. But for the most part this line will be ignored and replaced by config_unix.py.

After the gfxdraw entry add

<moviemodname> src/<movemodname>.c $(SDL) $(FFMPEG) $(DEBUG)

It should be commented as experimental for now. Hopefully by the end of summer any such qualifiers can be removed.

Lenard


Tyler Laing wrote:
Thanks Lenard. But what do I put specifically for the dependencies? Do I do a different dependency object for each of the header files I need?

-Tyler

On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom <len-l@xxxxxxxxx <mailto:len-l@xxxxxxxxx>> wrote:

   Nothing needs to be done to config.py. But for config_unix.py a
   new Dependency needs to be added to the DEPS list in main(). Also
   an "FFMPEG =" line should be added to Setup.in, giving some Unix
   defaults, and add a new build line in the optional modules section
   for the new movie module. As for providing paths, if ffmpeg was
   installed as a package then the compiler should find it.

   Lenard


   Tyler Laing wrote:

       Okay, so I have some code that looks like it will work, so now
       is when I need to start testing it. But to get it to compile
       and install with pygame, I've been trying to figure out how to
       add the necessary stuff to config.py and config_unix.py.

       Does anyone have some information on how to do this?

       For reference, right now I'm including these:
       #include <ffmpeg/avstring.h>
       #include <ffmpeg/rtsp.h>
       #include <ffmpeg/swscale.h>
       #include <ffmpeg/opt.h>
       #include <libavdevice/avdevice.h>

       #include <SDL.h>
       #include <SDL_thread.h>
       #include <ffmpeg/avformat.h>

       in my code.

       I've already tried to find the relevant info, but no luck
       there. Thanks for any and all help!

       -Tyler

       --        Visit my blog at http://oddco.ca/zeroth/zblog





--
Visit my blog at http://oddco.ca/zeroth/zblog


--
Lenard Lindstrom
<len-l@xxxxxxxxx>




--
Visit my blog at http://oddco.ca/zeroth/zblog




--
Visit my blog at http://oddco.ca/zeroth/zblog



--
Visit my blog at http://oddco.ca/zeroth/zblog