I use sublime text as my text editor and the cmd prompt to compile and run the code. The cmd prompt out of no where will no longer update the exe with the new code added to the program. Has anyone had this problem? It was working the other night and I have not changed any settings on the computer that would make this not work. Also the program has no errors
If you have installed Visual Studio 2015 (or other edition) on Windows 10 and create source code file with .c extension, you can use cl.exe.
It is better to use Visual C++ developer command prompt (can be started from Start button).
C:\Program Files (x86)\Microsoft Visual Studio 14.0>cl prog.c
Visual C++ developer command prompt provides environment settings like Path.
If you just run cl.exe without parameters you should see something like
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23918 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
This way is not for Mingw. But, perhaps, compiler is not limiting... so Visual Studio can work at the same PC. Just as an option
Related
I want to use libcurl in my C program. So I have curl-7.87.0 but some errors happen in x64 build.
in x86 build does not have any errors but its have libcurl.lib not libcurl.a in libs.
To build in Visual Studio 2022 Developer command prompt:
cd curl-7.87.0\winbuild
nmake /f Makefile.vc mode=dll VC=10 debug=no machine=x64
I guss "developer command prompt" uses x86 nmake. Like in image:"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\ HostX86\x86 \nmake.exe"
What can I do to solve it?
Thanks for any help.
I Copied all files of HostX64\x64 to HostX86\x86 and build again but again those errors.
I am trying to do simulation using Delmia. This requires a functioning C compiler. When i test my C compiler in Delmia, which tries to compile a very simple source file that includes stdio.h, I get the error "Cannot open include file: 'stdio.h': No such file or directory":
Compiling and linking the model (Visual C++).
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.6.2
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
Guessed compiler version: 1913
"Testing 32-bit compilation"
dsmodel.c
dsmodel.c(1): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
Error generating Dymosim.
It seems to be entirely the same issue as:
Visual Studio 2017 for Dymola cannot open stdio.h
His solution is not descriptive enough for me to solve my issue, as his "IT dept" apparently solved it for him, but he mentions allowing access to regedit which I do not understand the reason for in this context.
I have tried to recreate the error that Delmia generates by compiling dsmodel.c with VS2017 Developer Command Promt. If I run the command prompt in Administrator it compiles fine, if I do not, I get the samme error as Delmia outputs. Why is this?
If I find a solution such that I can compile it with command prompt without being in Administrator mode, then should Delmia not also be able to? How can i achieve this?
Some additional information: I have installed Visual Studio not on my main drive, and the Windows SDK is in program files on my main drive. Does this have any relevance?
Edit: For anyone else with this issue in Delmia, I would suggest simply installing another compatible compiler as a work-around. I installed MinGW which works well, even though this additional compiler takes up 500 MB. Remember that it has to be 64-bit. I used the "MingW-W64-builds" from http://mingw-w64.org/doku.php/download
I'm following GNSDK: The Barebones C Intro and have a problem while setting up the development environment.
The instructions say:
The first thing you need to do is set up your development environment. I coded and ran this application on Windows System 7. The SDK comes with a number of C samples. Each sample has its own folder. For this application, I cloned one of the folders and named it "/Samples/gnsdk_barebones". I used the "makefile" in the cloned directory and the Visual Studio 2008 C/C++ compiler to run the makefile from the command line (Visual Studio 2008 > Tools > Visual Studio 2008 Command Prompt). It's important that you create your folder under /Samples as the makefile uses relative path names to do its build.
I'm running MSVS 2015 on MS-Windows10 laptop.
I opened the 'Developer Command Prompt for VS2015' and type the following command
C:\Users\Dell\Documents\Play\GNSDK\samples\gnsdk_barebones>nmake -f makefile
Microsoft (R) Program Maintenance Utility Version 14.00.23918.0
Copyright (C) Microsoft Corporation. All rights reserved.
makefile(8) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.
The gnsdk_barebones folder contains two files that were downloaded as part of the SDK.
main.c
makefile
I couldn't find any record makefile(8) error type and would appreciate your advice.
Please let me know if further info is required.
Thanks a lot for your help!
In the light of your comments, the explanation of your problem is that your makefile is
a makefile for GNU make - which is the make-
tool almost always used - and you are trying to run it with Microsoft's
make-tool, nmake, which is almost forgotten and cannot parse a GNU makefile.
You can get GNU make for Windows
as a standalone package, or install it as part of a complete GNU GCC toolchain
for Windows such as TDM GCC.
Your comments pose additional questions. It's one question at a time on
Stackoverflow :) See How to ask.
I have visual studio 2012 ultimate and mingw installed on my pc.
However, when I try to compile any program (I have only tried a simple hello world program)
e.g when I use the visual studio cl compiler or the gcc compiler I get the error :
cl is not recognized as an internal or external command, operable program or batch file.
and similar for mingw-gcc.
I have visual studio installed in the default location. I have installed mingw in D:\MinGw but I have added it to the path variable. Also I have installed CodeBlocks after getting frustrated with this and my program builds and runs easily when I try that from inside CodeBlocks. I can also compile my program from inside Visual Studio by clicking on the build and run buttons.
What do I need to do to compile and run programs from the commandline in windows 7?
Instead of running a "regular" command prompt, run the "Visual Studio command prompt". You can find a link to it in the start menu.
It's essentially the same, but it sets up for you all the environment variables you need for all the VS tools to work from the command line.
Sounds like you still have a path problem. The mingw-gcc path for example would need to be to the bin directory:
D:\MinGW\bin
in your case. Then you should be able to run gcc.
I was working with visual studio 2012 beta and my desktop (win32) program compiled fine in ARM architecture.
After upgrading to visual studio 2012 RC, the compiler would not work and spews out the following error:
"Compiling Desktop applications for the ARM platform is not supported"
I found a forum post on this
http://connect.microsoft.com/VisualStudio/feedback/details/745580/arm-configuration-doesnt-work
Is it correct that Microsoft is really cutting off win32 development on ARM?
And that compiling in VS2012 beta was just a fluke?
You can edit the file:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\ARM\Microsoft.Cpp.ARM.Common.props
In the <PropertyGroup> section add the line:
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
before </PropertyGroup>
And that's all, you can build ARM desktop apps with VS2012.
I was able to get around that error and compile a little "hello world" cpp file for ARM by adding the "/D _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE" command-line argument to the ARM version of cl at C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm. I found that #define from sn0w's answer on this question in the crtdefs.h file, without having to modify that file. Now, I can't guarantee that anything more complex will actually work, or that Microsoft hasn't instituted some sort of whitelisting or digital signature verification for Windows RT desktop apps, so even though it may compile, it may not be allowed to run when Windows RT is finally available.
Note that before you can run the ARM version of cl.exe from the command line, you must set the environment variables using this batch file: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
Even if you compile the app, you won't be able to run it on Windows 8 RT as unsigned apps will not start.
I just tested this, and unfortunately it is the case.
You receive the following message:
Windows cannot verify the digital signature of this file
I imagine there is probably a work around for this, but it will never be officially supported.
yes of course. i practised with VS2012 RC.
now i'll explain how to avoid "Compiling Desktop applications for the ARM platform is not supported" and build win32 application.
1st way: fix build tools - the goal is to patch (or try to substitute it with beta's one) MSBuild's lib: Microsoft.Build.CPPTasks.Common.v110.dll
2nd way: run the "VS2012 ARM Cross Tools Command Prompt" from Visual Studio Tools start menu, then execute cl [cl params] myfile1.cpp myfile2.cpp myres.res ... /link [linkparams]
for both this cases you also need to commentout an #error directive in crtdefs.h on line 332. (Microsoft Visual Studio 11.0\VC\include)