Jump to content

How do I install these C libraries on Windows?

Gat Pelsinger

I want to install GMP and MPFR libraries for calculating arbitrarily large numbers, but there is no instructions given for Windows at all. Its all Linux. For example. these are the instructions for installing GMP - https://gmplib.org/manual/Installing-GMP

 

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

Unlike Linux, User libraries don't have central location that all applications can pull from (This is why just about every application folder you look into has a whole swath of DLLs). DLLs (the equivalent of .so on Linux) have to reside next your executable or in some known path (set at compile time of your application). So the process of installing shared libraries is simply build them and place them next to your executable. 

Additionally, you need to instruct your build system how to link to the library. Essentially you're going to set an include directory for the headers so that you can write your code using those libraries, and finally you will set a link directory pointed to the windows version of a static library (.lib) that defines an import library which allows for your executable to link with the DLL at run time. The .libs are generated by the build process for the libraries. 

 

TL;DR;

Build library DLL and place next your executable

Build library .lib and set your link directory/dependencies to this location.

Add include directory to the libraries headers. 

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

@trag1c completely overwhelmed. What DLLs I need to put? How do I build libraries and stuff like that? I use VS Code btw.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Gat Pelsinger said:

@trag1c completely overwhelmed. What DLLs I need to put? How do I build libraries and stuff like that? I use VS Code btw.

Couldn't begin to tell you as it's library dependent and I've used neither of those and I have no idea what those libraries are. If they have windows binaries available then you need to follow what I wrote in my previous reply. if not you have to figure out to build them from source for windows in order to get the libs and dlls.

 

Edit: I would look up Application Binary Interaces (ABI) and linking so that you can understand how these things work in the context of a systems programming language like C, C++, or Rust.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×