Overview
Features
Download
Documentation
Community
Add-Ons & Services

Crosscompiling from Arch Linux to Windows

Please post support and help requests here.

Crosscompiling from Arch Linux to Windows

Postby StupidStudios » 19 Jun 2014, 18:32

Hi,
I've been struggling to get POCO working for two days, and I've only succeeded halfway. I need to be able to compile to Linux, Windows 32 bits and preferably also Windows 64 bits, and so far I've failed to compile POCO for Windows in any way.

What I've tried:
- Compile using Cygwin GCC on Windows - linking errors, can't compile at all
- Compile using Visual Studio 2010 - compiles largely but not OpenSSL-dependent modules, keep getting linking errors
- Compile on Linux using the default configuration - a swift and complete succes, but only for the Linux version
- Compile on Linux using autoconfig set --config=MinGW-CrossEnv with CROSSENV set to i686-w64-mingw32 (because I'm building on a 64-bits machine) - error because of an unknown parameter, "-mno-cygwin"
- Compile on Linux .... the same as before, but with -mno-cygwin removed - I get a lot of errors saying "undefined reference to '_imp_......', I pasted it here:

http://sebsauvage.net/paste/?e57b59911d38ab04#J+uv65aQB8LA0bB0lT00qac55SZXReYsGRfrJm8oL+U=
(zerobin because pastebin has a filesize limit of 500kb)

Could you point me in the right direction here? I'm running out of ideas.
StupidStudios
 
Posts: 3
Joined: 19 Jun 2014, 17:51

Re: Crosscompiling from Arch Linux to Windows

Postby alex » 19 Jun 2014, 22:29

AFAIK, you can not compile on Linux for Windows. Your Visual Studio build fails because you did not install OpenSSL; when everything else else fails, RTFM:

Getting Started With The POCO C++ Libraries wrote:If your system does not have OpenSSL, please get it from http://www.openssl.org/ or another source. You do not have to build OpenSSL yourself — a binary distribution is fine.

The easiest way to install OpenSSL on Windows is to use a binary (prebuild) release, for example the one from Shining Light Productions that comes with a Windows installer (http://www.slproweb.com/products/Win32OpenSSL.html).
alex
 
Posts: 1142
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Crosscompiling from Arch Linux to Windows

Postby StupidStudios » 20 Jun 2014, 01:02

I DID indeed install OpenSSL, in C:\OpenSSL, and added both C:\OpenSSL and C:\OpenSSL\lib\VC to my PATH. I did read the manual.
The instructions aren't very specific though. I installed both a 64-bits and a 32-bits version and tested the build using both (by renaming one to C:\OpenSSL). I didn't know what to do next when that didn't work. For one I had to choose between the different versions of the libs manually and I didn't know which ones I was supposed to use (ending on md, mt, mdd, mtd, tried a few of them in different configurations) and the compiler also couldn't find ssleay32.dll even though it was on my hard drive and in my path. At first it also couldn't find libeay32.dll.
StupidStudios
 
Posts: 3
Joined: 19 Jun 2014, 17:51

Re: Crosscompiling from Arch Linux to Windows

Postby alex » 20 Jun 2014, 02:35

Something does not add up - you can't build but have a problem finding OpenSSL DLLs. Compiler has no need of OpenSSL DLLs; your executable does, at runtime.

But let's take a step back to linking (assuming that you are actually able to compile but can't link). System path will not help linker to find a lib, VS linker setting ("Additional Library Directories", under Linker) will. system path is needed to find DLLs at runtime and Windows processes are notorious to disregard system path changes unless you restart them after change.

It seems to me that your problem has to do mainly with C++, Visual Studio, Windows and OpenSSL, not POCO. It would, however, be helpful to know which version of POCO you are using. The command line script (buildwin.cmd) could be the easier route. There is also a newer and still experimental PowerShell script in the github repo.
alex
 
Posts: 1142
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Crosscompiling from Arch Linux to Windows

Postby StupidStudios » 20 Jun 2014, 21:18

You are right, I'm sorry. I was under the impression that linking was part of the compile process.

I did have C:\OpenSSL and C:\OpenSSL\lib\VC in my Visual Studio "Additional Library Directories".

I'm using the most up-to-date version of POCO, complete edition. The buildwin.cmd script didn't work for me; on a side note that is the script I used all the time, but it didn't work in the sense that the linking never worked out.
StupidStudios
 
Posts: 3
Joined: 19 Jun 2014, 17:51

Re: Crosscompiling from Arch Linux to Windows

Postby alex » 22 Jun 2014, 04:29

That should work. Based on the information you have provided, it's really hard to help you; you'll have to figure out what is not matching on your system. All I can say is that I have built POCO on Windows more times than I care to remember; when proper settings are in place, the build works fine.
alex
 
Posts: 1142
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest