Did you manage to compile?

I am having the same problem. Did you ever get it fixed and how?

‘c:\Program’ is not recognized as an internal or external command, operable program or batch file

c:\users\Antonio>

2 Likes

Yeah, I got this same warning anyway to get rid of it without make it worse?
Using VSC 2019.

2 Likes

Yup no problems. I’m using Windows 10.

Works perfect on Windows 10. Nice lecture! Like this tutorial very much!

1 Like

I am getting this error every time I run the command “cl hello.cpp”

hello.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include\ostream(708): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
hello.cpp(5): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char *)' being compiled
Microsoft (R) Incremental Linker Version 14.20.27508.1
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
hello.obj

However, If I run just “hello” and exclude the cl portion I return

c:\Users\rober\OneDrive\Documents\Coding>hello
Hello World

Am I missing something or is it actually executing properly?

@ROBERTII Your program is working properly. Refer to this post for more info on the warning.

1 Like

I was able to compile. However, my graphics card (gtx 550 ti) could not handle the vulkan api used by unreal and it would not start. I put in an rx 570 card and all is now running smoothly.

linuxmint 19
rx 570 gpu
amd quadrcore cpu
8 gb ram

I can compile the programm and it works just fine, but I get an #include error, which most likely is because I am using VS2017 and VS2019 aswell and i cant find out what my includePath should be.

I´m happy to get the basics of C++ again! Was 3 years ago i played around with C++ and now I might need it for a new job! So this is Gr8!

Got it done! I was a little confused because my computer didn’t seem to want to work when I just typed “hello” into the terminal and it only did anything when I actually included the file extension “.exe” and “.cpp” but that was because I was misunderstanding that if you use the “CL” command it will automatically compile the .cpp under that name and if you don’t it’s trying to run a program that wasn’t there yet. Once I used CL and a .exe program was actually created all went perfectly. Thank you!

Thank you! I tried setting up VS Code to compile C++ about 1,5y ago and couldn’t do it. But with this guide it was so simple! I’m so happy to see it work, compile and run with no problems now. :smiley:

I’m from the future now apparently and got Visual Studio 2019 Community and just downloaded that with no modifications. Got a error that said “fatal error LNK1104” but that was an easy fix by just downloading the Windows 10 SDK’s with the Visual Studio Installer.

I’m really looking forward to completing this course now. Last time I dropped out when I couldn’t set up VS Code. Idk why, just really wanted the light weight “IDE”.

1 Like

Didnt work

Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26129 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

d:\Michael\Programming\Beginner>cl hello.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26129 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

hello.cpp
Microsoft (R) Incremental Linker Version 14.13.26129.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
hello.obj
LINK : fatal error LNK1561: entry point must be defined

as you can see i got a fatal error

saving the file first fixed it

4 Likes

I got the program to compile. Simple program with clear instructions. :+1:

When I try to compile the code for the first time it seems to compile but I get a warning.
When I try to run the exe it says access denied and my antivirus software gives me a warning and deletes the exe.
When I try to compile again it doesn’t work anymore and I get a Linker error “LINK : fatal error LNK1104: cannot open file ‘hello.exe’”

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.9
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

c:\UneralCPPTutorial>cl hello.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

hello.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\xlocale(319): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Microsoft (R) Incremental Linker Version 14.16.27027.1
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
hello.obj

c:\UneralCPPTutorial>hello
Access is denied.

c:\UneralCPPTutorial>cl hello.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

hello.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\xlocale(319): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Microsoft (R) Incremental Linker Version 14.16.27027.1
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
hello.obj
LINK : fatal error LNK1104: cannot open file 'hello.exe'

Does anyone know how to get this to work?
Thanks

compilation went ok, but afterwards i am not able to delete the .exe file! (win 10) it says access denied. i have to ask user (my own admin user i am logged in as) for permission… no way to authenticate again…

i am now unable to get rid of the file…

Welcome @Bitefish and @KnitterX to the community!

I had no problem compiling.

1 Like

pretty sure that’s because it’s using normal windows console not developer console Don’t remember how I fixed it but it’s not hard

It seems to work now except that I got the warning C4530 I just have no idea why it works now

(Edit
actually now I know why it works I added Windows 10 SDK both of them since I did add one before but it didn’t fix it
)

#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
    return 0;
}

also I added Hello world there

Privacy & Terms