SrsBusiness / mp4v2

Automatically exported from code.google.com/p/mp4v2
Other
0 stars 0 forks source link

Compile errors with mingw32. #132

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Checkout the source from svn repository.
2. run autoreconf -fiv
   There is actually an m4 error at this point:
      /bin/m4:configure.ac:23: non-numeric argument 490
      autom4te-2.68: /bin/m4 failed with exit status: 1
      aclocal-1.11: /mingw/bin/autom4te-2.68 failed with exit status: 1
      autoreconf-2.68: aclocal failed with exit status: 1

   This was pretty easy to resolve by editing line 23 of configure.ac:
   It appears m4 was treaing the string 490 as a string and not a number
   so the m4_format([%s-r%d],... statement was changed to m4_format([%s-r%s],...

   After the above change aureconf -fiv proceeds.

3. run ./configure --disable-debug
4. run make
   After a a bit of successful compiling the following error with respect to
   time_t variables within the log.cpp class crops up:

       error: cannot convert 'time_t* {aka long int*}' to '__time64_t* {aka long long int*}'

   This was pretty easy to fix by inserting a
   #define _USE_32BIT_TIME_T within the #ifdef __MINGW32__ ... #endif statment
   inside of platform_win32.h.

5. after running make a second time things proceed a bit further, but then error
   out after the following error regarding a static variable:

       error: definition of static data member 'mp4v2::impl::Log::_cb_func' of dllimport'd class

What is the expected output? What do you see instead?
  Hopefully the description above takes care of this question.

What version of the product are you using? On what operating system?
    Compiling trunk 490 (straight out of svn) on Windows7 with
    mingw:  gcc version 4.6.2, autoreconf/autoconf 2.68, automake v1.11.1

Please provide any additional information below.

In researching the use of __declspec(dllexport) and __declspec(dllimport) I
started to think that maybe the #defining of MP4V2_EXPORT within platform.h was
not executing correctly or getting defined right.  So at that point I tried
hardcoding a #define MP4V2_EXPORTS within the top of platform.h.

That helped compiling along a little further but finally resulted in another
compile error:

libplatform/io/FileSystem_win32.cpp: In function 'void __tcf_2()':

libplatform/io/FileSystem_win32.cpp:142:8: error: definition of static data 
member 'mp4v2::platform::io::FileSystem::PATH_SEPARATOR' of dllimport'd class

libplatform/io/FileSystem_win32.cpp: In function 'void __tcf_1()':

libplatform/io/FileSystem_win32.cpp:141:8: error: definition of static data 
member 'mp4v2::platform::io::FileSystem::DIR_SEPARATOR' of dllimport'd class

At this point I figured I was probably out of my element :)

Any help (if any) would be greatly appreciated.  

I am trying to use mingw (vs the Microsoft toolchain) to compile this library 
for use in compiling a custom ffmpeg.  

To be helpful (hopefully) I have attached logs of running autoreconf, 
configure, and the several attempts at running make.

Thanks!

Original issue reported on code.google.com by galu...@gmail.com on 26 Apr 2012 at 2:53

Attachments:

GoogleCodeExporter commented 8 years ago
I think the configure.ac fix and the time_t fix both look good, I've included 
those in r496.  

Regarding MP4V2_EXPORTS, is there some way to define that project wide?  Give 
that a try.  If that doesn't work, I can follow up with the guy who included 
that code to see if he has a fix.

Original comment by kid...@gmail.com on 21 May 2012 at 4:46