After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777903 - x264 fails to build on Windows
x264 fails to build on Windows
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Windows
: Normal blocker
: 1.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-29 14:59 UTC by Nirbheek Chauhan
Modified: 2017-02-02 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Manually initialize the vtable (2.89 KB, patch)
2017-01-31 21:44 UTC, Nirbheek Chauhan
committed Details | Review

Description Nirbheek Chauhan 2017-01-29 14:59:34 UTC
[1/2] Compiling c object subprojects/gst-plugins-ugly/ext/x264/gstx264@sha/gstx264enc.c.obj
FAILED: cl @subprojects/gst-plugins-ugly/ext/x264/gstx264@sha/gstx264enc.c.obj.rsp
ext\x264\gstx264enc.c(140): error C2099: initializer is not a constant
ext\x264\gstx264enc.c(140): warning C4047: 'initializing': 'const int *' differs in levels of indirection from 'void (__cdecl *)(x264_t *)'
ext\x264\gstx264enc.c(140): warning C4047: 'initializing': 'const int *' differs in levels of indirection from 'int (__cdecl *)(x264_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'int (__cdecl *)(x264_t *,x264_nal_t **,int *,x264_picture_t *,x264_picture_t *)' differs in parameter lists from 'void (__cdecl *)(x264_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'int (__cdecl *)(x264_t *,x264_nal_t **,int *)' differs in parameter lists from 'int (__cdecl *)(x264_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'void (__cdecl *)(x264_t *)' differs in parameter lists from 'int (__cdecl *)(x264_t *,x264_nal_t **,int *,x264_picture_t *,x264_picture_t *)'
ext\x264\gstx264enc.c(140): warning C4133: 'initializing': incompatible types - from 'void (__cdecl *)(x264_t *)' to 'int (__cdecl *)(x264_t *,x264_nal_t **,int *,x264_picture_t *,x264_picture_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'int (__cdecl *)(x264_t *)' differs in parameter lists from 'int (__cdecl *)(x264_t *,x264_nal_t **,int *)'
ext\x264\gstx264enc.c(140): warning C4028: formal parameter 1 different from declaration
ext\x264\gstx264enc.c(140): warning C4047: 'initializing': 'void (__cdecl *)(x264_t *)' differs in levels of indirection from 'x264_t *(__cdecl *)(x264_param_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'int (__cdecl *)(x264_t *,x264_param_t *)' differs in parameter lists from 'int (__cdecl *)(x264_t *)'
ext\x264\gstx264enc.c(140): warning C4047: 'initializing': 'x264_t *(__cdecl *)(x264_param_t *)' differs in levels of indirection from 'void (__cdecl *)(x264_param_t *)'
ext\x264\gstx264enc.c(140): warning C4028: formal parameter 2 different from declaration
ext\x264\gstx264enc.c(140): warning C4047: 'initializing': 'const x264_level_t (*)[0]' differs in levels of indirection from 'void (__cdecl *)(x264_param_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'int (__cdecl *)(x264_param_t *,const char *,const char *)' differs in parameter lists from 'void (__cdecl *)(x264_param_t *)'
ext\x264\gstx264enc.c(140): warning C4113: 'int (__cdecl *)(x264_param_t *,const char *,const char *)' differs in parameter lists from 'int (__cdecl *)(x264_param_t *,const char *)'
ninja: build stopped: cannot make progress due to previous errors.
Comment 1 Sebastian Dröge (slomo) 2017-01-30 11:40:39 UTC
These all seem weird, but seem to be 2 groups:

1) "initializer is not a constant" must be the NULL or the constants in the beginning, but why would that not be constant?
2) all others look like everything moved by 2 elements up in the array. The types differ in exactly that way.

My guess is that somehow MSVC can't handle putting the constants in there and fails to properly parse everything because of that.
Comment 2 Nirbheek Chauhan 2017-01-31 17:01:15 UTC
Just for the record, I get the same error with MinGW/GCC with Meson on Windows too:

FAILED: i686-w64-mingw32-gcc @subprojects/gst-plugins-ugly/ext/x264/gstx264@sha/gstx264enc.c.obj.rsp
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:141:3: error: initializer element is not constant
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:141:3: error: (near initialization for 'default_vtable.module')
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:142:3: error: initializer element is not constant
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:142:3: error: (near initialization for 'default_vtable.x264_bit_depth')
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:142:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:142:3: warning: (near initialization for 'default_vtable.x264_chroma_format') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:142:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:142:3: warning: (near initialization for 'default_vtable.x264_encoder_close') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:143:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:143:3: warning: (near initialization for 'default_vtable.x264_encoder_delayed_frames') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:143:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:143:3: warning: (near initialization for 'default_vtable.x264_encoder_encode') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:143:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:143:3: warning: (near initialization for 'default_vtable.x264_encoder_headers') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:144:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:144:3: warning: (near initialization for 'default_vtable.x264_encoder_intra_refresh') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:144:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:144:3: warning: (near initialization for 'default_vtable.x264_encoder_maximum_delayed_frames') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:145:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:145:3: warning: (near initialization for 'default_vtable.x264_encoder_open_148') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:145:3: error: initializer element is not constant
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:145:3: error: (near initialization for 'default_vtable.x264_encoder_reconfig')
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:145:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:145:3: warning: (near initialization for 'default_vtable.x264_levels') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:146:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:146:3: warning: (near initialization for 'default_vtable.x264_param_apply_fastfirstpass') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:146:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:146:3: warning: (near initialization for 'default_vtable.x264_param_apply_profile') [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:146:3: warning: initialization from incompatible pointer type [enabled by default]
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:146:3: warning: (near initialization for 'default_vtable.x264_param_default') [enabled by default]
Comment 3 Nirbheek Chauhan 2017-01-31 21:44:30 UTC
Created attachment 344669 [details] [review]
Manually initialize the vtable
Comment 4 Nirbheek Chauhan 2017-01-31 22:20:54 UTC
Will test on Linux and push.
Comment 5 Sebastian Dröge (slomo) 2017-02-01 10:38:34 UTC
commit 184351ae485d5befc3311a122c717ec534225c52
Author: Nirbheek Chauhan <nirbheek@centricular.com>
Date:   Wed Feb 1 03:08:10 2017 +0530

    x264: Initialize function vtable in plugin_init()
    
    These values are defined in the x264.h header and are not const on
    Windows due to the way DLLs work. See:
    https://msdn.microsoft.com/en-us/library/619w14ds.aspx
    https://msdn.microsoft.com/en-us/library/zw3za17w.aspx
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777903