#StackBounty: #c #gcc #clang #mingw #llvm How do I compile code using Clang with the MinGW C/C++ Library? (Particular issue with float.h)

Bounty: 100

I have a simple program which I can successfully compile with clang, using MinGW’s C/C++ Library:

#include <stdio.h>
int main(int argc, char **argv) { printf("Hello world!n"); return 0; }

I am able to compile this with mingw-gcc successfully:

 $ gcc test.c -o test
 $ ./test
 Hello world!

I am also able to compile it successfully using clang+mingw:

 $ clang test.c -o test -target
 $ ./test
 Hello world!

However, if I make a small change to my program (include float.h), it continues to compile with gcc but no longer compiles with clang:

#include <stdio.h>
#include <float.h>
int main(int argc, char **argv) { printf("Hello world!n"); return 0; }
 $ gcc test.c -o test
 $ ./test
 Hello world!

 $ clang test.c -o test -target x86_64-pc-windows-gnu
 In file included from test.c:2:
 In file included from C:llvmbuiltlibclang8.0.0includefloat.h:45:
 C:mingw64-8.1.0x86_64-w64-mingw32includefloat.h:28:15: fatal error: 'float.h' file not found
 #include_next <float.h>
               ^~~~~~~~~
 1 error generated.

Is there some configuration issue with clang or some missing command line argument? Googling around a bit, it appears that the order of paths when including float.h is important, but this is all supposed to be handled internally by the clang driver.


Get this bounty!!!

#StackBounty: #opencv #mingw #gstreamer #gstreamer-1.0 can't build OpenCV + GStreamer correctly (MinGW, Windows)

Bounty: 50

I’m trying to run test pipeline:

 cv::VideoCapture cap = cv::VideoCapture(" autovideosrc ! videoconvert ! appsink0 ", cv::CAP_GSTREAMER);

But it doesn’t start and return next debug info (see below). I compiled opencv using mingw32 7.3.0. Version of Gstreamer is also 32bit. What can be wrong?
win7, mingw 7.3.0, opencv 4.1.0, gstreamer 1.16.0

    0:00:00.040498363  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:gstreamer1.0x86libgstreamer-1.0libgstdecklink.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.412: Failed to load plugin 'E:gstreamer1.0x86libgstreamer-1.0libgstdecklink.dll': 'E:gstreamer1.0x86libgstreamer-1.0libgstdecklink.dll': 
The specified procedure was not found.
        0:00:00.061620856  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:gstreamer1.0x86libgstreamer-1.0libgstopenh264.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.432: Failed to load plugin 'E:gstreamer1.0x86libgstreamer-1.0libgstopenh264.dll': 'E:gstreamer1.0x86libgstreamer-1.0libgstopenh264.dll': 
The specified procedure was not found.
        0:00:00.072668621  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:gstreamer1.0x86libgstreamer-1.0libgstsoundtouch.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.442: Failed to load plugin 'E:gstreamer1.0x86libgstreamer-1.0libgstsoundtouch.dll': 'E:gstreamer1.0x86libgstreamer-1.0libgstsoundtouch.dll': 
The specified procedure was not found.
        0:00:00.088487674  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:gstreamer1.0x86libgstreamer-1.0libgstsrt.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.465: Failed to load plugin 'E:gstreamer1.0x86libgstreamer-1.0libgstsrt.dll': 'E:gstreamer1.0x86libgstreamer-1.0libgstsrt.dll': 
The specified procedure was not found.
        0:00:00.089972159  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:gstreamer1.0x86libgstreamer-1.0libgsttaglib.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.465: Failed to load plugin 'E:gstreamer1.0x86libgstreamer-1.0libgsttaglib.dll': 'E:gstreamer1.0x86libgstreamer-1.0libgsttaglib.dll': 
The specified procedure was not found.
        0:00:00.097988553  6904   1F44A7C0 WARN      GST_PLUGIN_LOADING gstplugin.c:793:_priv_gst_plugin_load_file_for_registry: module_open failed: 'E:gstreamer1.0x86libgstreamer-1.0libgstwebrtcdsp.dll': Не найдена указанная процедура.

        (untitled2.exe:6904): GStreamer-WARNING **: 02:29:33.475: Failed to load plugin 'E:gstreamer1.0x86libgstreamer-1.0libgstwebrtcdsp.dll': 'E:gstreamer1.0x86libgstreamer-1.0libgstwebrtcdsp.dll': 
The specified procedure was not found.
        0:00:00.107822720  6904   1F44A7C0 WARN                 filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:UsersShmeisserDocumentsbuild-untitled2-Desktop_Qt_5_9_4_MinGW_32bit-Debug autovideosrc ! videoconvert ! appsink0"
        0:00:00.107911655  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
        0:00:00.108341459  6904   1F44A7C0 WARN                 filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:UsersShmeisserDocumentsbuild-untitled2-Desktop_Qt_5_9_4_MinGW_32bit-Debug autovideosrc ! videoconvert ! appsink0"
        0:00:00.108391029  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
        0:00:00.108489004  6904   1F44A7C0 WARN                 filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:UsersShmeisserDocumentsbuild-untitled2-Desktop_Qt_5_9_4_MinGW_32bit-Debug autovideosrc ! videoconvert ! appsink0"
        0:00:00.108535367  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
        0:00:00.108575898  6904   1F44A7C0 WARN                 basesrc gstbasesrc.c:3824:gst_base_src_activate_push:<source> Failed to start in push mode
        0:00:00.108603015  6904   1F44A7C0 WARN                GST_PADS gstpad.c:1142:gst_pad_set_active:<source:src> Failed to activate pad


Get this bounty!!!