"Permission Denied" with a simple class test

I'm running a simple program in emacs where I test a class (called poly.h) for use in a .cpp file (poly.cpp). My teacher provided us with a makefile for it, so I copied it over to my directory, ran it, generated a poly.o, and then used ./poly.o to try and run it, and get a 'Permission Denied'. Any idea what the issue is? I don't know much about emacs commands and whatnot so please keep that in mind!
My teacher provided us with a makefile...

0.o is this a common practice with emacs users? Unless his files are stored the same as yours then the linking in his Makefile won't work on your system.

"Permission Denied" tells me that you are trying to open a file that you are not allowed to. That's just a shot in the dark though.
Last edited on
He didn't teach us how to properly create a makefile, I guess because he had one already made for us. I copied the file in his directory over to my own directory as he instructed, I didn't link it over from his directory if that's what you mean (I don't think I would've even been able to run the makefile if that was the case!). Its strange because I MADE the file, I don't know why I wouldn't have access to it!
./poly.o That is not an executable. The makefile did not do the linking. (or you aren't seeing the executable)
Do you mind to post it?
Last edited on
To expand on what ne555 said poly.o is an object file that is created by the compiler. It's not something the you should be doing anything with, but it also is not an indication of any errors.

My Opinion Not Really Helpful To Your Problem: Your teacher should not be half-assing his leasons by handing out Makefiles. If he doesn't want to teach file linking then you should be using MS Visual Studio.
Be a little more constructive. Like ne555 said, object files are not executable. Do something like this:
 
$ ls -ltr
# show me the latest modified files in the directory in reverse order


After compiling with "make" the executable will be last in the list, assuming that it built. Otherwise, you should see error messages.

The executable will also have "x" permissions. That means you can run it with the ./ in front of it. The file command should also tell you that it is an ELF executable or something like that.

If you still have issues, post the commands and output. Actually, posting the Makefile might be enough.
Last edited on
Topic archived. No new replies allowed.