Problems building QtGStreamer release build on Windows

Andoni Morales ylatuya at gmail.com
Sat Dec 15 07:12:59 PST 2012


2012/12/14 Chris Boucher <chris at thebouchers.com>:
> Hi Andoni,
>
> Thanks!
>
> QtGStreamer is built using cmake, which I'm far from an expert in, so
> I'm not sure how best to use the GStreamer SDK property sheet with it.
> However, I modified the top level CMakeLists.txt as follows:
>
> --- CMakeLists.txt (revision 18879)
> +++ CMakeLists.txt (working copy)
> @@ -108,6 +108,10 @@
>      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra
> -Wformat-security -Wundef -Wpointer-arith -fno-common")
>  endif ()
>
> +if (MSVC)
> +    set(CMAKE_SHARED_LINKER_FLAGS "/OPT:NOREF")
> +endif()
> +
>  set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE
> STRING "Destination directory for libraries")
>  set(INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/QtGStreamer)
>
> and the release DLLs now contain complete import sections. /OPT:NOREF
> is the default in debug builds, which explains why it worked there.
>
> I have to say, I find the CRT fix a little odd and possibly
> impracticable since I have other libraries I need to link against
> (including Qt), but that's not relevant to this thread.

All this CRT thing, is a big mess from Windows since each VisualStudio
version provides its own CRT, different from the system one which is
the one used for drivers development and provided with the Windows
Driver Kit.

The CRT's provided with Visual Studio are not part of the system and
you need to redistribute them with your application. And that's a big
issue with the GPL license (see
http://www.gnu.org/licenses/gpl-faq.html#WindowsRuntimeAndGPL):
"[...] the GPL says that libraries can only qualify as System
Libraries as long as they're not distributed with the program
itself.[...]"

So in theory you can only link against msvcrt.dll, which is a system
library that you don't need to distribute with your application.

The big issue with mixing CRT's is that you can't open a Handle/FD
from one and close it with a different one or allocate objects  from
one CRT and free them with a different one. But that shouldn't happen
unless you are doing weird things. So if everything works you
shouldn't have to worry about mixing CRT's. Read this article from
Windows for more info:
http://msdn.microsoft.com/en-us/library/ms235460.aspx

Andoni

> Thanks again,
> Chris.
>
> On 14 December 2012 10:27, Andoni Morales <ylatuya at gmail.com> wrote:
>> Hi,
>>
>> On Visual Studio, make sure that you use the property sheets included
>> in the GStreamer SDK as explained in "Remove the dependency with the
>> Visual Studio runtime" here:
>>  include the property sheets:
>> http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows
>>
>> Apart from linking to the same CRT used by the DLL's built with
>> GStreamer, it will also set the the linker option
>> OptimizeReferences=False, which will fix your issue in the Release
>> build:
>> http://cgit.freedesktop.org/gstreamer-sdk/cerbero/tree/data/vs/msvc/common.props#n15
>>
>> I will update the bug report.
>>
>> 2012/12/14 Ola Røer Thorsen <ola at silentwings.no>:
>>> Hi Chris,
>>>
>>> I'm having the exact same problems as you, using visual studio 2010. I
>>> reported this on the bugtracker too, btw.
>>> https://bugzilla.gnome.org/show_bug.cgi?id=686272 but it seems we're the
>>> unlucky ones.
>>>
>>> If you figure it out, please let me know :-)
>>>
>>> Cheers,
>>> Ola
>>>
>>>
>>>
>>> 2012/12/13 Chris Boucher <chris at thebouchers.com>
>>>>
>>>> Hi Dinesh,
>>>>
>>>> Thanks for confirming that your import tables are correct.
>>>>
>>>> I'm going to try VS2010...
>>>>
>>>> Regards,
>>>> Chris.
>>>>
>>>> On 13 December 2012 16:07, Dinesh Kumar <dineshkpadmanaban at gmail.com>
>>>> wrote:
>>>> > Hi Chris,
>>>> >
>>>> > Thanks for correcting me.
>>>> >
>>>> > I have just now checked my QtGlib.dll. I have my import table correct.
>>>> >
>>>> > My last suggestion is
>>>> >
>>>> > Clean the existing build.
>>>> > - cmake -G "Visual Studio 8 2005" <other stuffs>
>>>> >   - cmake --build . --target install --config Release.
>>>> >
>>>> > Regards
>>>> > Dinesh P
>>>> >
>>>> >
>>>> >
>>>> > On Thu, Dec 13, 2012 at 8:50 PM, Chris Boucher <chris at thebouchers.com>
>>>> > wrote:
>>>> >>
>>>> >> Hi Dinesh,
>>>> >>
>>>> >> The QtGStreamer release build isn't producing the gstreamer dlls, but
>>>> >> it is linking to them.
>>>> >>
>>>> >> The QtGStreamer dlls are linked against the gstreamer ones, which
>>>> >> results in QtGStreamer dlls having an import section listing the
>>>> >> gstreamer dlls and functions required.
>>>> >>
>>>> >> If you run "dumpbin /imports QtGlib.dll" (for example) you should see
>>>> >> sections for libgobject-2.0-0.dll and libglib-2.0-0.dll.
>>>> >>
>>>> >> In my debug build these sections also list the functions required. In
>>>> >> my release build, the sections exist, but there are no functions
>>>> >> listed.
>>>> >>
>>>> >> Thanks,
>>>> >> Chris.
>>>> >>
>>>> >> On 13 December 2012 15:04, Dinesh Kumar <dineshkpadmanaban at gmail.com>
>>>> >> wrote:
>>>> >> > You  mean the relase build is producing dlls with empty import tables
>>>> >> > for
>>>> >> > gstreamer dlls or QtGstreamer dlls?
>>>> >> >
>>>> >> > I am still wondering, why the QtGstreamer release build is producing
>>>> >> > the
>>>> >> > gstreamer dlls?
>>>> >> >
>>>> >> > Regards
>>>> >> > Dinesh P
>>>> >> >
>>>> >> >
>>>> >> > On Thu, Dec 13, 2012 at 8:08 PM, Chris Boucher
>>>> >> > <chris at thebouchers.com>
>>>> >> > wrote:
>>>> >> >>
>>>> >> >> gstreamer dlls.
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > _______________________________________________
>>>> >> > gstreamer-devel mailing list
>>>> >> > gstreamer-devel at lists.freedesktop.org
>>>> >> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>> >> >
>>>> >> _______________________________________________
>>>> >> gstreamer-devel mailing list
>>>> >> gstreamer-devel at lists.freedesktop.org
>>>> >> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>> >
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > gstreamer-devel mailing list
>>>> > gstreamer-devel at lists.freedesktop.org
>>>> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>> >
>>>> _______________________________________________
>>>> gstreamer-devel mailing list
>>>> gstreamer-devel at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>
>>
>>
>> --
>> Andoni Morales Alastruey
>>
>> LongoMatch:The Digital Coach
>> http://www.longomatch.ylatuya.es
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



-- 
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es


More information about the gstreamer-devel mailing list