Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- Building php modules with cygwin/mingw


jtara - 10:54 pm on Feb 22, 2008 (gmt 0)


So let me rephrase my question; If a library is known to be made for cross-platform, how I can (figure out the necessary steps to) make it build windows binaries using cygwin (and have the .h and .lib files generated with them)?

Although, technically, you probably can, I wouldn't recommend it.

This would be termed "cross-compiling".

Generally, cross-platform packages are intended to be built in the native environment of the target.

That is, a cross-platform package that is designed to be built for either Windows or Linux is intended to be built with make/Gnu C for Linux or Visual C++ for Windows. It will come with both a make file and a Visual C++ project file.

You want to build a Linux package with Visual C++ (not sure if this is even possible) or a Windows package with make/Gnu C, you're on your own!

Cross-compiling under Gnu C is commonly done only for firmware - for example for the ARM processor. Gnu C won't do that out-of-the-box, though. You need to obtain or build a version of Gnu C that runs on your development platform but targets the execution platform. (Not all combinations are available in binaries.)

Now, Linux and Windows (typically) share the same hardware architecture. But not the same library and object formats. At minimum, you'd need an alternate linker and library builder.

I wouldn't try it. If you need to build a Windows app or library, use Visual C++. Or use a Windows Gnu C (not real common).


Thread source:: http://www.webmasterworld.com/linux/3582127.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com