installing GSL library for C programming in windows - c

I want to install the GSL library (https://www.gnu.org/software/gsl/) in windows. I have downloaded the files but i do not know what to do apart from that in order to be able to use the functions of the library (apart from the #include <...> in my program.c file).
I am using visual studio code and i have installed mingw.
Thanks in advance
EDIT
I am adding more information about this issue. I am not the original poster, but I have the same problem.
I am trying to use the GSL and I work with Visual Studio Code on Windows 10.
I have already installed the basic packages to work with C/C++ in
Visual Studio Code. More precisely, if I am not wrong, VS Code is
using the compiler gcc.exe from mingw64 (last version). This was
installed using an 'extension' available at VS Code (https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).
I downloaded the last version of the GSL (2.7) and unzipped it.
I get stuck when I try to follow the installation instructions. When I
execute either .\configure or ./configure in the DOS command line,
I get an error of "unknown command" (even if I am placed in the same directory where the file is stored).
When I execute .\configure in PowerShell, I get a message asking me
which programme should be used to open this file.
And here is where I get lost. :/
I have discovered an alternate path, which is installing GSL from vcpkg (https://vcpkg.io/). This is suggested by VS Code, actually. This vcpkg seems to be a programme by Microsoft to make it easier to install third-party C/C++ packages in Windows.
The specifications to install vcpkg are (https://vcpkg.io/en/getting-started.html):
Windows 7 or newer
Git
Visual Studio 2015 Update 3 or newer
I can try this path, but first I would like to be sure there is no easier way (installing Visual Studio to not really use it seems a lot to me!).

Related

VS2017 Nuget pthread LNK1120 unresolved

I heard that Nuget builds project easier without any configuration.
So, I am trying to add pthreads in my project from Nuget
(Actually I am using windows 10 x64 Visual studio 2017, C language, and my friends use linux OS)
I just search pthreads in Nuget package, click "install" button
But, my project compiles well but fatal error LNK1120 called.
Is there any more configuration after install pthreads from nuget?
The reason why I ask this simple question in stackoverflow is that, there is no more steps in Microsoft official guides.
Is there any more configuration after install pthreads from nuget?
Using Nuget format to install pthread into C++ projects is quite simple and will not manually configure include Directories and additional Dependencies address any more.
But pthread nuget package in VS has a drawback that it does not fully inherit pthread class library. It lost a file called pthreadvc2.lib. You can try my following suggestions to configure it without any settings in project properties.
Solution
1) download pthread-w32-2-9-1-release.zip from this link.
2) unpack this file and then copy pthreadVC2.lib from the file(pthreads-w32-2-9-1-release\Pre-built.2\lib\x86 or x64) into
C:\Program Files (x86)\Microsoft Visual Studio\2017\xxxxx\VC\Tools\MSVC\xxxx.xx.xxxx\lib\x86 or x64.
Note that you should copy the related lib into the related folder, x86 pthreadVC2.lib into x86 folder, x64 pthreadVC2.lib into x64 folder.
3) then add this into your cpp file:
#pragma comment(lib,"pthreadVC2.lib")
Then it will work as expected without any errors.

how to use install library in c++ in visual studio code?

I want to use a library with c++ in visual studio code with in Mac. I installed scip and VScode but I can't use it.
when I run
1 error generated.
The terminal process terminated with exit code: 1
I am not familiar with c but I know how to use scip's function. So I need to compile scip in c. any help ?
I installed scip in download file. and I have c/c++ Microsoft for visual studio code
You are mixing up a few things here. Visual Studio Code cannot compile code - it's more like a fancy editor. You are probably referring to Microsoft Visual Studio 2017 or 2019. This is a fully-featured IDE that also comes with a C/C++ compiler.
To compile SCIP, I strongly recommend CMake. There are detailed instructions on how to do this in the SCIP docs.
Also keep in mind, that installation of SCIP is different from compiling it yourself. You need the sources and probably your self-built librarires/binaries to link SCIP to your own custom code. If you only want to use SCIP, then it's sufficient to run the installer and start it - no compilation whatsoever is necessary.

import libssh library in Visual Studio 2017

I'm currently trying to include the libssh library on Visual Studio 2017.
I already downloaded libssh but I don't know exactly what am I supposed to do with cmake. Where should I include files in Visual studio?
What you downloaded is the source code of libssh. So before you can link it to any of your own projects, you need to build libssh first. This were cmake comes in. CMake is the build system used for libssh.
In the source tree, which you have downloaded, you will find a file named INSTALL. It contains descriptions about all the prerequisites and a how you can use cmake to build libssh yourself.
If you prefer it, you can alternatively download a prebuilt version of libssh from https://www.libssh.org/files/win32/0.5/. The downside is, this is a quite dated version.
You can use vcpkg to download C++ libraries like libshh through command prompt. In this way the required dll's will be automatically include in your project directory, once you include the related header file in your project and compile it. See https://www.libssh.org/get-it/.

GTK Linker Issue Visual Studio C Project

it is the third day that I am trying to set up the visual studio 2013 with the GTK libraries. I need to use VS: I've used GCC (both command line and with code blocks) in the past (both on windows and slackware linux too..), but now I have a lot of projects in VS and I want to start making some GUI for them. After seeing that the so called "all-in-one-bundle" is not more available/maintained in the GTK website, I followed a bunch of tutorials (including GTK+ 3.0 setup in Visual Studio 2013, How to configure gtk on Visual studio 2010, How do you install GTK+ 3.0 on Windows?) and I started to install MSYS2 according to this one: https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows/.
Maybe the problem is here: I followed this step properly pacman -S mingw-w64-x86_64-toolchain, but I skipped the creation of PKGBUILD file and successive installation due to the fact that I did not understand the procedure. Furthermore the mingw toolchaing seemed to be already installed.
Sorry for the big introduction, I wanted to be specific.
The problem is at the linking-stage of Visual Studio C Project building. I had also some problem at compilation involving the different inline interpretation of VS (added #define inline __inline // Necessary to make the GTK library Visual Studio compatible definition before calling the GTK header). The linking stage issue consist in the fact that, using pkg-config --libs gtk+-3.0 --msvc-syntax command, I receive a list of files (/libpath:C:/msys64/mingw64/lib gtk-3.lib gdk-3.lib gdi32.lib imm32.lib shell32.lib ole32.lib -Wl,-luuid winmm.lib dwmapi.lib z.lib pangowin32-1.0.lib pangocairo-1.0.lib pango-1.0.lib atk-1.0.lib cairo-gobject.lib cairo.lib gdk_pixbuf-2.0.lib gio-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib) that does not exists in the msys2 directory. As a consequence I receive this error from the linker: error LNK1104: cannot open file 'gtk-3.lib'.
Someone has the same problem (see Error 3 error LNK1104: cannot open file 'gtk-3.lib'), but the solution is to use the all-in-one-bundle.
What shall I do? Have I followed the correct procedure or am I missing something? I've also tried to link to VS the *.a files located in the lib directory of mingw63 (e.g. libgtk-3.dll.a), but the linker error remains.
Best Regards and thank you for the attention
Davide

The program can't start because MSVCR80D.dll

I have made a dll in Microsoft Visual Studio 2005. Then i am trying to use it in other project on the other computer in CodeBlocks IDE. Project is built, but when it use functions from dll i got an error: "The program can't start because MSVCR80D.dll is missing from your computer. Try reinstall the program to fix this problem". How to build my dll without dependences on MSVCR80D.dll or build in this MSVCR80D.dll?
You're trying to run a debug version, which is linked to the debug version of the CRT. The latter is only available where VS has been installed. You should use the release version of your project on other machines (or manually copy all the dependent debug DLLs, which is not legal according to the license...).

Resources