Use CLion2018 or VS2015 to build C project without dependency - c

I have a c++ application built in Visual studio 2015, It seems c++ apps have need visual c++ 2015 (In my case) to be installed (on targeted windows version). Then i decided to convert my c++ source to c and use CLion 2018 for build this project. It has no error but the output executable has visual c++ 2015 (It says: vcruntime140.dll is missing) dependency again. Here is my questions:
Does C written executable's have any external dependencies ? What are those dependencies ?
Im new to CLion2018, How to build c projects to work without dependency on all windows versions and architectures ?
Is still any way to use VS2015 to create and build c projects ? (Already tried changing compile as: option to /TC and changing extensions to .c. Build was successful but Output has VCRUNTIME140.dll error).
Note1: Both output files (In CLion and VS) are working on windows 7,8.1,10 with visual c++ 2015 installed. And both have "VCRUNTIME140.dll is missing" error on raw windows 7,8.1,10 without visual c++ 2015 installed.
Note2: Don't want to pack those dll's with my file, Or installing vc++ 2015.

Related

installing GSL library for C programming in windows

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!).

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.

LINK : fatal error LNK1146: no argument specified with option '/MT'

I'm using Visual Studio 2019 and trying to compile a program that was compatible with Windows XP 32-bit.
When I first ran my .exe on my VM it said that it wasn't compatible with Win32.
I've then changed the Platform Toolset to Visual Studio 2017 - Windows XP (v141_xp).
Now it says I'm missing a VCRUNTIME140d.dll, and following instructions that said to change my Runtime Library to /MT I get the error stated in the title.
Any suggestions would be very much appreciated.
VCRUNTIME140d.dll is Visual C++ Redistributable for Visual Studio 2015.You need to download and install. And this is Debug versions of DLL. You must compile in Release mode.

Cannot include certain header files using the Visual C++ compiler

Hello I'm getting into Winsock programming in C. I believe that in order for me to access the (or any other header related to Winsock for that matter) header file I have to have Visual C++ 2010 installed and set it as my default compiler. So I download it, and in CodeBlocks I set it to my compiler. I run some Winsock code and I get this message:
C:\Users\Jared\Documents\Test.c|6|fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory|
I also get this message for including 'winsock.h' and 'windows.h'. This has something to do with the Visual C++ compiler. I try installing Visual C++ 2008 and use it as my compiler and get the same message. I then read that I have to install microsoft's SDK. I download and install it and it gets an error saying that I can't install it (this is the .Net framework 4.0 version). I then try the 3.5 version and it installs fine but my compiler still can't find the header files. I have the .net framework 4.0 so I don't see the problem. I also read that I have to include some header files in Visual C++ by going to Tools>Options>Projects and Solutions>VC++ Directories and I get the following message:
"VC++ Directory editing in tools > options has been deprecated."
Visual C++ 2010 no longer supports this feature. Does anyone have a solution or can help me with this?
Long story short: I cannot include 'winsock.h', 'winsock2.h', or 'windows.h' using the Visual C++ 2010 compiler.
All help is appreciated.
In Visual C++ 2010 it is recommended to use property sheets instead of this kind of global directory settings editing. You need to edit the user settings property sheet (probably Microsoft.Cpp.Win32.user.props) in your AppData folder. You can do it in the UI through the Property Manager via View->Property Manager and browsing for that sheet.
However, I think you should have $(WindowsSdkDir)include in Include Directories if you have it installed correctly.

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