I know that I have mentioned that I am learning C# Programming at the moment, but I am doing that for work anyway.
I was told from my teachers from Uni, that I will be learning C++ instead. So I am wondering while I am stuck with some sort of coding of this C++ World. Do you know how to execute C++ applications manually via the command prompt? Like for example where I execute .exe files for C# applications where it is show below
C:/<file location>>csc /nologo /out:<filename>.exe <filename>.cs
Is there any similarity like this for C++ .exe executions??
C++ manual execution
Started by jclarke, Feb 19 2008 03:25 PM
12 replies to this topic
#1
Posted 19 February 2008 - 03:25 PM
|
|
|
#2
Posted 19 February 2008 - 03:47 PM
Hi Jclarke from what i have learned i think that it depends on the program you are using to create your C++ projects. I have used Microsoft Visual Studios 5 and 6 packages and this creates an executable for you within the project folder which will run the program for you.
What program are you using to write your code?
I am not to sure but i should imagine if an executable isn't created automatically there will be an option with the program to do so. And then when you have the .exe file it is just a matter of typing the correct command in the cmd window.
Hope this helps, if anything i said is wrong please correct. :D
What program are you using to write your code?
I am not to sure but i should imagine if an executable isn't created automatically there will be an option with the program to do so. And then when you have the .exe file it is just a matter of typing the correct command in the cmd window.
Hope this helps, if anything i said is wrong please correct. :D
#3
Posted 19 February 2008 - 09:06 PM
I currently make the applications by Visual Studio 2005, but I would like to know if there is a 'manual' way to do it in the hard way to execute the application from the CMD window.
#4
Posted 20 February 2008 - 08:32 AM
Ahh in that case i think you are looking for this - Deployment (C++). Visual Studios has in-built deployment options. There are other ways to do this i think but may as well follow the guide mentioned on the page above.
Hope that helps
Hope that helps
#5
Posted 20 February 2008 - 08:55 AM
Yes, there are ways to manually compile C++ programs. You can also execute them from the command line. The details will vary depending on the compiler.
#6
Posted 20 February 2008 - 11:46 PM
I would have been expecting some sort of CMD code to execute the .cpp applications. But Visual Studio automatically executes them once it is completed in the software. But I'd like to see in a hard way, manually and outside VS 2005.
#7
Posted 22 February 2008 - 09:05 AM
I know there is a compiler that can be run outside the development environment. I haven't used it myself, however.
#9
Posted 23 February 2008 - 08:13 PM
dargueta said:
From what I've been reading, it appears that you're looking for a C/C++ interpreter. If that's what you want, you can try Ch 4.5.
I am not sure what you mean, but it might be the one, you explained. But is that where it would execute the cpp.applications externally from the program through via the command prompt, is that correct?
#10
Posted 23 February 2008 - 08:22 PM
Assuming that they haven't been compiled into an exe, then yes. For example, you'd have a file called myprog.cpp with your source code in it, and then you'd run it from the command prompt or a batch file like so:
ch myprog.cpp
(I think.) I'm not entirely sure, but it's probably something like that. It actually depends on the file names, but it's basically the same. Why are you looking for an interpreter anyway?
ch myprog.cpp
(I think.) I'm not entirely sure, but it's probably something like that. It actually depends on the file names, but it's basically the same. Why are you looking for an interpreter anyway?
#11
Posted 23 February 2008 - 11:49 PM
dargueta: I don't think he's looking for an interpreter. I just think he wants to learn how to use a compiler manually, and not through an IDE (in this case, Visual Studio) where the whole compiling-process is done automatically.
jclarke: I'm not sure what the compiler Visual Studio is using is called. But I can give you an example on how to use the open-source compiler GCC for compiling a C++-source-file.
jclarke: I'm not sure what the compiler Visual Studio is using is called. But I can give you an example on how to use the open-source compiler GCC for compiling a C++-source-file.
$ g++ ./filename.cpp -o ./filenameThis will produce an executable file called; filename.
#12
Posted 24 February 2008 - 12:09 AM
vOid - I will give that code a try tomorrow at work and see what happens.
dargueta - What vOid just said is right, and to answer to your question. I am currently studying C++ at uni in part of my job, and I want to learn the most of it to acheive my grade into my certificate -- I enjoyed executing my C# files manually via the command prompt which it is the hard way to execute them but you always know that the Visual Studio automatically executes for you, but I would love to see in the hard way and manually for myself to see what is the difference and so I know how to if the Visual Studio crashes or doesnt work, you know what I mean?
dargueta - What vOid just said is right, and to answer to your question. I am currently studying C++ at uni in part of my job, and I want to learn the most of it to acheive my grade into my certificate -- I enjoyed executing my C# files manually via the command prompt which it is the hard way to execute them but you always know that the Visual Studio automatically executes for you, but I would love to see in the hard way and manually for myself to see what is the difference and so I know how to if the Visual Studio crashes or doesnt work, you know what I mean?


Sign In
Create Account


Back to top









