Is it possible to set up GStreamer for use in MinGW, similar to how it's done in Linux? - windows

Apologies for the tardy title, I'm not quite sure how to phrase this question. At its most basic, I'm attempting to compile a program with GStreamer. When running the configure script for said program I get the following error:
0:20.39 configure: checking for gstreamer-1.0 >= 1.0
0:20.39 gstreamer-app-1.0
0:20.39 gstreamer-plugins-base-1.0
0:20.39 configure: error: gstreamer and gstreamer-plugins-base development pack
ages are needed to build gstreamer backend. Install them or disable gstreamer su
pport with --disable-gstreamer
The build environment I'm compiling in:
Windows 7 (64-Bit)
MINGW & MSYS
Visual C/C++ 2010 SP1 (command line)
Now if this error occurred on a Linux distro, - say Ubuntu - it could be remedied by running the following commands:
apt-get install libgstreamer-plugins-base1.0-dev
apt-get install libgstreamer1.0-dev
What is the equivalent for Windows? I've found two type of versions that can be used: The gstreamer bin from the developer website, which has the following structure:
bin
include
lib
share
And a dynamic library of gstreamer for mingw with the following structure:
bin
lib
How am I supposed to let mingw/msys know that the gstreamer library is installed? Do I place the folders above in the relevant MSYS directories? Then, how does the configure know that it's installed and ready to be used?
I hope what I'm asking makes sense, please let me know if anything is confused. Cheers!

Using the first solution (official binaries from GStreamer), you need to tell the configure script where everything is located.
The simplest way is to set the environment variable PKG_CONFIG_PATH to where the .pc files are located. Generally it's in
$install_directory/lib/pkgconfig/
Replace $install_directory with the actual location, ex if it's installed in /c/GStreamer :
PKG_CONFIG_PATH=/c/GStreamer/lib/pkgconfig ./configure
That should make configure figure out everything

Related

Installing GTK3 on Haskell Platform 7.10.2a for Windows

Has anyone succeeded in installing gtk2hs on Windows? I am using Haskell Platform 7.10.2a on Windows 10, both 64-bit, and tried running "cabal install gtk3", but it failed on the gio package with error message:
gcc.exe: error: unrecognized option '-pthread'
(Edit extra note: next line of error message below)
compiling dist\build\System\GIO\File\FileAttribute_hsc_make.c failed (exit code 1)
It appears that the gcc in the mingw subfolder in the Haskell Platform package is a little outdated. Is there any way to update this subfolder? The only clue I found on the Internet is the link below, which does not seem to offer any solution:
https://ghc.haskell.org/trac/ghc/ticket/10726
(Edit: version of gcc seems unrelated. '-pthread' switch appears to be invalid for gcc when run under Windows, it's only valid in Linux, see this link, but I have no idea why GHC/GTK3 is using -pthread and no idea how to change this to -mthread http://mingw-users.1079350.n2.nabble.com/pthread-vs-mthreads-td7114500.html)
Before running cabal, I installed GTK+ 3.18.0.1 on Windows using MSYS2.
I have installed gtk2hs on Linux easily with no issues at all.
Update: Also got GTK3 (bundle from below) running a Windows 10 64 bit device.
The additional step I had to accomplish was to include the libintl.def and
libintl.dll.a from an older bundle into the lib folder. I obtained those two files from a GTK2.x bundle, i.e. https://download.gnome.org/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip.mirrorlist, otherwise cabal was complaining about the missing C library intl. To sum up:
1) Obtain a GTK3 x64 bundle from the link http://www.tarnyko.net/dl/gtk.htm.
2) Obtain the missing files libintl.def and libintl.dll.a from an older
bundle, i.e. GTK2 (link from above) and include them in the lib folder.
3) Install glib first, run cabal install glib. Ensure that you have administrator privileges and GTK3/bin is on your PATH variable. Additionally,
you can set LIB and INCLUDE pointing to the GTK/lib and GTK/include folder respectively (might not be necessary).
4) Run cabal install gtk3 finally. You may use the flag --global.
(Tested on Windows 10, 64-Bit, Haskell Platform 8.x)
Installation steps for Windows 7, 64-Bit: (Original Post)
I figured it out how to install GTK3 on Windows7 (64 bit) when running
Haskell Platform 7.10.3. Therefor, I had to accomplish following steps:
Download the gtk3 64-bit bundle from http://www.tarnyko.net/dl/gtk.htm (personally I have used the 3.6 version of it)
Download the gtk3 binding https://hackage.haskell.org/package/gtk3 (0.14.5)
Install the dependencies separately. This encompasses the libraries gio, glib and pango (not cairo in my case). (cabal install package-name)
Adjust the gtk3.cabal file. I have removed following lines (all are within 5 lines):
if os(darwin)
cpp-options: -D__attribute__(A)=
-DWIN32 (just that one flag)
extra-libraries: kernel32
Adjust the gtk.h file (comes with the gtk3 bundle, include\gtk-3.0\gtk) I have defined following macros BEFORE the include operation of #include :
define GDK_VERSION_3_0 (G_ENCODE_VERSION (3, 0))
define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_0
define GDK_VERSION_MAX_ALLOWED GDK_VERSION_3_6
define GDK_DISABLE_DEPRECATION_WARNINGS
Add the path of the MinGW and gtk3 folders bin, include, lib to the PATH variable.
Run cabal install gtk3.cabal
Following tricks also helped me (command line parameters):
--gcc-options="C=LANG"
--with-gcc="path to gcc.exe"
--global
To be honest, this was more luck than knowledge. Took me several hours
to find a workaround. I had the same troubles with the gtk2 bindings for haskell. (Installing gtk2hs failure)

Gstreamer on windows

I'd like to build application using Gstreamer 1.0 and GTK+-3.0 on Windows 8 (64bit).
I have sucessfully install and build GTK+-3.0, 32 bit version using Dev-C++ and Mingw 32-bit (there is no 64 bit version of GTK+). Everything works perferkt. It also installed pkg-config, I addeded it in %PATH% and it works.
I have installed gstreamer-1.0-devel-x86-1.4.4.msi and gstreamer-1.0-x86-1.4.4.msi from here
1) First problem: it installed itself into I:\gstreamer\ without asking me. I am very unhappy about it, I'd like have it on C:. But its not the biggest problem.
2) pkg-config do not know about gstreamer. I have found in I:\gstreamer\1.0\x86\lib\pkgconfig\ *.pc files, so I looked into gstreamer-1.0.pc and added to my projekt this options:
C compiler:
-I"I:/gstreamer/1.0/x86/include/gstreamer-1.0/"
Linker:
-L"I:/gstreamer/1.0/x86/lib" -lgstreamer-1.0
3) Now the program was compiled, but when I run it, it was not able to find gstreamer-1.0-0.dll. So i tried copy I:\gstreamer\1.0\x86\bin\gstreamer-1.0-0.dll into to the same directory as is my compiled file. Then it was not able to find libwinptread-1.dll. So I copied it also.
Then te program run, but it faild with some error like "cannot find entry point to windows thread ..." (I do not remember it exactly). So I copied ALL dll files from I:\gstreamer\1.0\x86\bin\ and then finally the program run.
But now it is not able to create elements:
source = gst_element_factory_make ("videotestsrc", "source");
//source is null
So, my question is, how to install gstreamer, that my program will find all dll files and will be able to create elements?
installing -- choose "custom install", there you can change the installation path.
for vs you can use *.props (gstreamer\1.0\x86\share\vs\2010\libs)
you need set Environment variable - GST_PLUGIN_SYSTEM_PATH_1_0 to plug-ins. For more details see http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html

Ubuntu mingw-w64 package referencing non-existent binaries in Windows cross-compile config?

So, after installing the mingw-w64 and g++-mingw-w64 packages, I'm trying to cross-compile a QT application, running the suggested command:
qmake -spec unsupported/win32-g++-cross
However, when that runs, I get errors along the lines of:
i686-pc-mingw32-g++: Command not found
And indeed the qmake.conf file in that directory refers to binaries with that prefix i686-pc-mingw32-g++ does not exist on the system; the mingw applications installed have a i686-w64-mingw32- prefix (i686-w64-mingw32-g++ exists). Clearly, from the name of the manifest, that specification is "unsupported", but I would think it would at least refer to binaries by their proper name that were installed with the same package? Or is there something else I'm doing wrong in general to compile a QT package on Linux, for running on a Windows box after?

use MinGW to create exe file in windows from GNU source package

the basic idea was, I wanted to generate the call graph in text format for several c files. After googling around for long time, i found cflow, which can deliver everything I want, but it is only runable in Linux or else. Then I began to search how to compile the cflow source files on the web to a exe file. I found MinGW which should be able to do the cross-platform compilation.
After installing the MinGW and the MSYS and running the usual commands "./configure; make; make install", I simply got an error that "mkdir" was not found. Actually. Actually I was wondering whether this is the correct way to compile the whole package.
Does anyone has an idea how I can build the cflow.exe correctly in Windows? If there is a tutorial or something like this, I will be very thankful.
Song
Solution
Please try this Github repository "MinGW + MSYS build of GNU cflow 1.4" (For Windows).
https://github.com/noahp/cflow-mingw
It contains already compiled "cflow.exe",and an instruction about how to build cflow using mingw and msys.
Test
System Environment:Win 8.1 (x64)
1.I tested the "cflow.exe" downloaded from the github repository , and amazingly it worked!
2.I followed the mingw compiling instruction,and it successfully compiled "cflow 1.5".
Command:
bash configure
make
I was able to do that today. I'm using cygwin, after installing gcc, binutils, make and after downloading the gnu cflow.tar.gz, it was as easy as ./configure ; make ; make install.

How can I setup linux to compile FORTRAN code into windows binaries?

I'm working on a FORTRAN project and I would like to build all of the binaries that I want to maintain on a linux machine that is dedicated for automated builds. I have successfully used mingw to build 32-bit and 64-bit binaries from C source for windows machines on the linux machine with the following packages on Ubuntu.
apt-get install mingw32
apt-get install mingw-w64
Then I run the following commands to actually compile:
gcc -b amd64-mingw32msvc -V 4.4.4 -o <...other options>
However, the mingw packages that I've obtained via apt-get do not include FORTRAN compilers.
Anybody got any ideas on what I can do?
if you got mingw32 and the Gnu C cross compiler is working for you ... when why not just get the Gnu Fortran cross compiler, too?
http://www.nber.org/sys-admin/mingw32-fortran-fedora.html
EXAMPLE apt-get install mingw32-gcc-fortran
I know this is an old thread but a few things seem to have changed and people might still be interested in the topic.
Problem: I want to use my linux machine to compile some code and create a .exe that I can send to people using Windows.
Solution: Essentially here: http ://mxe.cc/
What I did:
Check to see if your system has all the software you need here
run
git clone -b stable https://github.com/mxe/mxe.git
It will download a few small things and create the directory "mxe" (probably in your home folder)
cd into that mxe directory and run "make". HOWEVER: this would take hours and take up a few GB on your hard drive so instead run something like
make mpfr eigen opencsg cgal qt
For more ideas on how to shorten that all see this or the mxe tutorial or somewhere else ;)
The easiest way to compile stuff then seems to be something like:
~/mxe/usr/bin/i686-pc-mingw32-gfortran -c main.f95
~/mxe/usr/bin/i686-pc-mingw32-gfortran main.o -o outfile.exe
Of course you can chose something other than fortran, just consult the mxe/usr/bin to see what its called.
You can always download and install a prebuilt compiler from the MinGW(-w64) project itself:
Windows 64-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/
Windows 32-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/
Just unpack somewhere and add the cross*/bin directory to PATH.
I include (obj)c(++) and fortran.
On Ubuntu 18.04 I use
apt install gfortran-mingw-w64
Then use the compiler x86_64-w64-mingw32-gfortran in place of gfortran. If you're using cmake, you can configure the compiler from the build directory like so:
FC=x86_64-w64-mingw32-gfortran cmake ..

Resources