Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
FateFree
Nov 14, 2003

I'm on a windows machine and I've been fighting with minGW to compile something for hours... I'm sure someone with linux can do it in a few minutes. I'm trying to compile this library at https://github.com/sipa/secp256k1 with the instructions:

* Run `./configure` and `make libjavasecp256k1.so`
* Copy libjavasecp256k1.so to your system library

Does anyone think they can compile this for me and host it somewhere? I would be extremely grateful.

Adbot
ADBOT LOVES YOU

FateFree
Nov 14, 2003

Nevermind, it seems they updated this library without updating the instructions so I don't think it would work anyway. Thanks though.

SYSV Fanfic
Sep 9, 2003

by Pragmatica
I'm interested to know if you can compile a library in linux to be used on windows. Everything I know about c/c++ screams no, but I know I don't know everything.

telcoM
Mar 21, 2009
Fallen Rib

keyvin posted:

I'm interested to know if you can compile a library in linux to be used on windows. Everything I know about c/c++ screams no, but I know I don't know everything.

Cross-compiling (i.e. compiling stuff for system type A on system type B) is a thing, so it's technically possible.
Since both Linux and Windows usually run on x86-type systems, it should in theory be easier than, for example, compiling ARM stuff for Raspberry Pi on a Linux x86 desktop.

In practice, there are quite a few details that need to be set up right, which would make it a fairly major pain in the rear end to set up just for one-time task.

First, the compiler must be configured to expect that the code will be run in Windows-style address space layout and called using Windows-style calling conventions. Since gcc in general supports a huge number of systems and processor types, this might be just a matter of picking the right command-line options for the compiler.

Second, if the library calls any Windows functions, you would need the Windows include files that describe the call interfaces. Microsoft being Microsoft, I would expect that getting these might require paying some $$ for a development kit and agreeing to some license, with possibly some non-obvious conditions buried into the fine print. FateFree might get off easy here, since the library he's asking about is a cryptographic algorithm, so chances are good that the library simply needs to receive some data from its caller, do quite a bit of integer math on it, and return the results - basically not involving the OS at all.

Third, after compiling the code it needs to be packaged into a valid Windows-style library format. Apparently GNU libtool knows how to do that, with some caveats: http://www.gnu.org/software/libtool/manual/libtool.html#Windows-DLLs

To sum up: while it might be easy for someone that already has the necessary cross-development tool-chain set up, it might not be so easy for any random Linux guy who hasn't done any cross-compiling before.

(Or it might be that in this specific case you only need to get some command-line options right; it's been about 15 years since I did some minor cross-compiling.)

  • Locked thread