Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

DeV - C++


  • Please log in to reply

#1
MaverickSidewinder

MaverickSidewinder

    Member

  • Member
  • PipPipPip
  • 257 posts
Hi everyone!

I downloaded and installed Dev-C++.
Everything went great...
I made a stupid little program that runs on comand prompt or DOS.

This is the problem...

How do i convert a .cpp file so that another person double clicks on it and it automatically goes on msdos or cmd prompt. (in other words a .exe file)

I would really appreciate help!

:tazz:

- Maverick
  • 0

Advertisements


#2
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
Should be Execute -> Compile

Here's a tutorial:
http://www.geocities...eness_template/
  • 0

#3
MaverickSidewinder

MaverickSidewinder

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 257 posts
Thank you for the tutorial site... :tazz:

Maybe you already answered my question...but i was asking how to make a file so that if i send it to a friend or save it on a floppy disk and he double clicks on it, it will directly go on MSDOS or cmd prompt and execute.

Sorry if i ask really dumb questions its just that im new to the C++ world...(but i like it ;) )


Anyways, thanks for your help! ;)

- Maverick
  • 0

#4
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 875 posts
here's some general c++ info:

reread mpfeif101's post. are you able to compile?
once compiling is successful, a .exe file is created.
find the .exe file - it may be named after the project(if you used a project), or it may be named after the source file containing main().

to run:
right click start
left click explore
navigate to the directory containing the .exe file
double click on the .exe file

most likely a command window will open, then close when the program terminates. if this happens, create a .bat file to run the .exe file. to run the .bat file - double click on the .bat file.

using notepad, create the following .bat file and call it runcpp.bat. this file would run the compiled .exe called test.exe located on the c: drive in folder \cpptest.
you need to provide the actual drive, folder, and .exe name. the pause statement prevents the command window from closing. press any key, then click on the 'X' to close the command window.

rem runcpp.bat 06-13-05
cd c:\cpptest
test.exe
echo done
pause

copy the .exe file and .bat file to floppy, then copy to the other pc. the .bat file will need to be modified for the proper drive and folder.

please post details on what is successful(i.e. compile ok) or on what is unsuccessful(i.e. won't compile, can't find .exe)
  • 0

#5
MaverickSidewinder

MaverickSidewinder

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 257 posts
I found the .exe files. Thanks for your help!

:tazz:

- Maverick

p.s. ill keep the .bat things in mind though.
  • 0

#6
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
Just FYI, you can use this function to stop the file from opening and closing really fast:
system("PAUSE");

I think that it is in the standard template with Dev C++ :tazz:
  • 0

#7
MaverickSidewinder

MaverickSidewinder

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 257 posts
Thanks, ill keep that in mind. I double-click on the .exe file and everything works. No flashing. With borland i had flashing stuff. But Dev-C++ is much simpler to use.


Thanks again to everyone who answered my topic!

:tazz:

- Maverick
  • 0

#8
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
Yeah, it's because the system pause function is in the basic dev template.
  • 0

#9
MaverickSidewinder

MaverickSidewinder

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 257 posts
Got it!

:tazz:

Thanks!


- Maverick
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP