Build failure on Gentoo Linux

Bug #1213725 reported by James Le Cuirot
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pipelight
Fix Released
Low
Michael Müller
Gentoo Linux
New
Undecided
Unassigned

Bug Description

I get the following errors when trying to build with a mingw32 toolchain (gcc 4.7.3) on Gentoo Linux.

mingw32-g++ -Wall -DXP_WIN=1 -std=c++0x -march=corei7 -O2 -pipe pluginloader.c communication.o handlemanager.o npclass.o npnfunctions.o apihook.o -lversion -lgdi32 -lole32 -o pluginloader.exe
pluginloader.c: In function 'bool InitDLL(std::string, std::string)':
pluginloader.c:263:37: error: 'SetDllDirectory' was not declared in this scope
pluginloader.c: In function 'int main(int, char**)':
pluginloader.c:393:36: error: '_fdopen' was not declared in this scope

I checked the headers and found that SetDllDirectory was not defined because no Windows version was set. Adding -D_WIN32_WINNT=0x0502 to the flags fixes this. This version is the minimum required for this function and corresponds to Windows Server 2003 with SP1 or Windows XP with SP2.

_fdopen was not defined due to -std=c++0x, which enables __STRICT_ANSI__. After searching, I discovered that using -std=gnu++0x (or -std=gnu++11 as it should be now) works around this by enabling the new standards while also including this non-standard function.

Why didn't this affect you? I can hazard a guess. I initially tried to build this as an x64 executable using a x86_64-w64-mingw32 toolchain. I didn't encounter these problems but I did encounter a different one, which I fixed, before realising I was on the wrong track. I see that you are using a 32-bit "w64" toolchain. It was the "w64" bit that threw me but maybe there is still some difference between a 32-bit "w32" toolchain and a 32-bit "w64" toolchain.

I did get it to more or less work in the end. The test page worked and blinkbox.com looked like it was about to play something but eventually bombed with an error. I have only tried Silverlight 5.1 so far though, maybe 4 will work. I have created a Gentoo ebuild for Pipelight, which I will submit to Gentoo bugzilla soon.

James Le Cuirot (chewi)
description: updated
Revision history for this message
Sebastian Lackner (slackner) wrote :

Hi,

thanks for the information concerning the build flags. Probably there is really some kind of difference between the "w32" and "w64" toolchain - we will adjust the build flags in our next update (if they don't break other stuff).

The remaining problem with the errors might be related to a missing user agent switcher which is required to get some streaming services to work: https://answers.launchpad.net/pipelight/+faq/2351.
Error N8109 often also has to do with the same problem.

Please try it if it works by installing one the user agent switchers described there.

When you decide to try 4/5.0 the following page probably might help (although you cannot use the silverlight dependency installer of the wine-compholio package directly on Gentoo):
https://answers.launchpad.net/pipelight/+faq/2358

Sebastian

Revision history for this message
James Le Cuirot (chewi) wrote :

Yeah, I already checked my user agent switchers. I actually got Blinkbox to work just now by installing 5.0 but masking as 5.1. Impressive work, guys! (-: As you say, the Silverlight setup is a little fiddly if you're not on Ubuntu so I'll see if I can come up with something easier.

Revision history for this message
Sebastian Lackner (slackner) wrote :

Nice :-)

You can either create your own solution to download Silverlight or probably reuse the existing ones by Erich E. Hoover. Unfortunately these are not yet included in the repository, so you've extract them from:

https://launchpad.net/~ehoover/+archive/compholio/+files/wine-browser-installer_0.8.2~precise_amd64.deb
https://launchpad.net/~ehoover/+archive/compholio/+files/wine-silverlight5.1-installer_0.8.2~precise_all.deb

Would be nice to keep us up to date with your progress :-)

Sebastian

Revision history for this message
Michael Müller (mqchael) wrote :

If you want to create an automatic Silverlight install script which should be called from Pipelight, keep in mind that the script may be started multiple times concurrently (when several browsers are started at the same time, for example when the user didn't close the browser during the installation). We asked Erich E. Hoover to implement a locking mechanism to prevent any problems.

The script can be configured in the pipelight config and will be called with one of these parameters:

wine-silverlight5.1-installer
wine-silverlight5.0-installer
wine-silverlight4-installer

while the environment variables WINE and WINEPREFIX are set as defined in the config file.
The only problem is that we check if the corresponding file exists:

 /usr/share/wine-browser-installer/wine-silverlight5.1-installer.install-script
 /usr/share/wine-browser-installer/wine-silverlight5.0-installer.install-script
 /usr/share/wine-browser-installer/wine-silverlight4-installer.install-script

so you may either create these files or you need to patch this from the source code (basicplugin.c inside checkSilverlightInstallation() ). We may make this check optional in the next release, so that is easier for you guys to port it to other distros.

Revision history for this message
Michael Müller (mqchael) wrote :

If you create a package for Gentoo or some installing instructions, we can also include them on the Pipelight website as we did for Arch Linux.

Changed in pipelight:
assignee: nobody → Michael Müller (mqchael)
Changed in pipelight:
importance: Undecided → Low
Revision history for this message
Michael Müller (mqchael) wrote :

Fixed build flags in current git revision. We still stay with gnu++0x instead of gnu++11 as the second one would require at least gcc 4.7 and may cause problems on distros using an older gcc version.

Changed in pipelight:
status: New → Fix Committed
Changed in pipelight:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.