Jump to content

? servers

? players online

Compile/Run

Recommended Posts


  • Content Count:  3697
  • Joined:  01/07/09
  • Status:  Offline

Ok I am taking computer science, and I want to be able to work on some files from home. I downloaded jEdit and it seems awesome. It works a lot like Kate that I was using in the labs at school. But I have no idea how to compile or run my files. I've looked and looked and looked and I looked more, and I kept looking, and I could not find it. I'm really pissed right now because of how long I looked to find no way to do it.

 

So yeah, Idc if it takes another program, or what, I really don't care. I just want to be able to compile and run these files.

 

Not sure if it matters, but they are .cpp files. jEdit opens them and they look just like they did in Kate, but I can't figure out how to compile or run.

(At school I opened console and did

g++ A4Q3.cpp

./a.out

 

The g++ would compile that file, ./a.out would run the file.

I can't figure out how to do it at home though.

 

Thanks.

Link to comment

  • Content Count:  1740
  • Joined:  04/04/10
  • Status:  Offline

well what i learned at programming in school last year is if you want to compile and run a file, we typed:

 

g++ -o A4Q3 A4Q3.cpp (the A4Q3 is in your case then) in the cmd.exe

 

but you have to be in the directory where the file is located

 

we used Kate or other c++ programs from Linux

Link to comment

  • Content Count:  1740
  • Joined:  04/04/10
  • Status:  Offline

hmm well i did some research since it's been a long time since i've used a program like that, are you in the right directory to where the file is located?

if so try typing "dir /on" to see which files are in the directory if the file is in that directory try typing:

 

g++ A4Q3.cpp

 

AND THEN

 

g++ -o A4Q3 A4Q3.cpp

 

that shuld usually work

Link to comment

  • Content Count:  1740
  • Joined:  04/04/10
  • Status:  Offline

hmm well it's difficult to help you out like this, but type the dir /on in the directory and put the files here that you have in that directroy, that way i can help you out better

Link to comment

  • Content Count:  3697
  • Joined:  01/07/09
  • Status:  Offline

Directory of C:\Users\Tyler\Desktop\CMPT 111

 

04/10/2010 05:32 PM

.

04/10/2010 05:32 PM

..

Process dir exited with code 0

04/10/2010 04:48 PM 1,562 A3Q5.cpp

04/10/2010 04:48 PM 794 A4Q1.cpp

04/10/2010 05:29 PM 885 A4Q2.cpp

04/10/2010 04:48 PM 1,022 A4Q3.cpp

4 File(s) 4,263 bytes

2 Dir(s) 337,995,837,440 bytes free

%USERPROFILE%\Desktop\CMPT 111>

 

-----------------------------------------------------------

 

And this is whta I get when I type in wha tyou said before:

 

 

%USERPROFILE%\Desktop\CMPT 111> g++ A4Q3.cpp

Process g++ exited with code 1

'g++' is not recognized as an internal or external command,

operable program or batch file.

%USERPROFILE%\Desktop\CMPT 111> g++ -o A4Q3 A4Q3.cpp

'g++' is not recognized as an internal or external command,

Process g++ exited with code 1

operable program or batch file.

 

Im pretty sure I need an external compiler? Does anyone know of one?

Edited by Bob Loblaw
Link to comment

  • Content Count:  1740
  • Joined:  04/04/10
  • Status:  Offline

what windows are you using, that kinda narrows it slightly down

 

edit: also what other programs are you using with it

 

EDIT: yes you need an external compiler, try using MinGW and/or Objective C compiler as a compiler prog

 

it's really rusty, so sry if i'm vague about this

Edited by Chaoz`
Link to comment

  • Content Count:  2085
  • Joined:  04/19/10
  • Status:  Offline

You're using Windows at home, school is using Linux. Is this correct?

 

You should get MinGW (Minimalistic GNU for Windows). This comes with Dev-C++ which is a good, free IDE for C and C++ Programming. http://www.mingw.org/

Now, you need to add the location to the GCC exe in your Windows PATH.

Steps:

1. Install a compiler. Remember where it is installed to.

2. Open your control panel.

3. Go to "System".

4. Click on the "Advanced" Tab.

5. Click on the "Environment Variables" button at the bottom.

6. Find the variable "PATH" and click "Edit".

7. Go to the end of the line and add a semicolon (;) and then the path to

your gcc.exe. (ex. On Dev-C++ when installed in the default location

the path would be "C:\Dev-cpp\bin") Make sure that you do not

delete any of the other paths in the "PATH" variable.

 

 

Or just skip all of that, and install Linux at home! Either on a VM or on your main HDD, both should work. Windows (in my opinion) is a real pain in the ass for programming.

 

Hope it helped.

Link to comment

  • Content Count:  3697
  • Joined:  01/07/09
  • Status:  Offline

Nothing has worked so far, so still looking for help.

Harry's thing seemed to almost work, I punched it in, and it brought me to the next prompt as if it worked but I don't know where the compiled file is, or anything like that -.-.

 

Any and all help is appreciated!

Link to comment

Reply to Thread

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...