Jump to content

c++ file read/open error

Go to solution Solved by WorldDominator,

I'm not going to lie, I don't want to open those and read them. How did you try opening/closing them?

Hi guys,

 

My code compiles fine however when choose to run the code it gives me a file read/open error. I already executed "chmod 777 *.h *.cpp a.out" in the project directory to be sure there is no permission issues.

I get this error both on my windows machine in NetBeans and on my schools Linux ssh using gdb (g++ compiler).

 

If anyone can point me to what might be causing this I would be very grateful. It's a project for my C++ in a Unix Environment class and is due tomorrow at midnight =/

 

Thanks!

 

Main is in store.cpp

Source Files:

LookupTable.h.txt

Product.cpp.txt

Product.h.txt

SimpleVector.h.txt

store.cpp.txt

Tokenizer.cpp.txt

Tokenizer.h.txt

 

 

edit:

Wanted to add that gdb also gives this info in addition to the error:

"error code 01"

"Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6_4.2.x86_64 libgcc-4.4.7-3.el6.x86_64 libstdc++-4.4.7-3.el6.x86_64"

 

Hope that helps =/

Link to comment
https://linustechtips.com/topic/80424-c-file-readopen-error/
Share on other sites

Link to post
Share on other sites

I'm not going to lie, I don't want to open those and read them. How did you try opening/closing them?

i5 4670k | Sapphire 7950 | Kingston 120GB SSD | Seagate 1TB | G.Skill Ripjaw X Series 8GB

PB238Q | Steelseries Sensei | Ducky DK9087 | Qck Heavy

Build Log: http://linustechtips.com/main/topic/44902-from-imac-to-my-own-creation/

Link to comment
https://linustechtips.com/topic/80424-c-file-readopen-error/#findComment-1102747
Share on other sites

Link to post
Share on other sites

Why are your files named .h.txt and .cpp.txt

CPU: i7 4770k | GPU: Sapphire 290 Tri-X OC | RAM: Corsair Vengeance LP 2x8GB | MTB: GA-Z87X-UD5HCOOLER: Noctua NH-D14 | PSU: Corsair 760i | CASE: Corsair 550D | DISPLAY:  BenQ XL2420TE


Firestrike scores - Graphics: 10781 Physics: 9448 Combined: 4289


"Nvidia, Fuck you" - Linus Torvald

Link to comment
https://linustechtips.com/topic/80424-c-file-readopen-error/#findComment-1102766
Share on other sites

Link to post
Share on other sites

Why are your files named .h.txt and .cpp.txt

because the forum wont let me upload .h or .cpp files

 

I'm not going to lie, I don't want to open those and read them. How did you try opening/closing them?

well now i feel really dumb.... this was a project we worked on before and then he assigned us to update the lookuptable as a template. He also gave us some of his own updated files but he changed the inventory.txt we were reading from to a .csv for some reason. This is how you know it's too late for this shit.

Link to comment
https://linustechtips.com/topic/80424-c-file-readopen-error/#findComment-1102944
Share on other sites

Link to post
Share on other sites

From my experiences it's usually the trivial things that kill me when debugging.

 

Be glad you are developing with C++ as you have TONS of debugging tools.

 

How far along are you in your programming career? There are fairly complex data types used and this seems to be an applied class but, your code could use some optimization if your specs request it.

 

Most of the files looks fine but, mainly store.cpp bugs me...

 

On a side note, I wonder why people are afraid to download your files... It's not like they are executables.  <_<

Link to comment
https://linustechtips.com/topic/80424-c-file-readopen-error/#findComment-1103521
Share on other sites

Link to post
Share on other sites

I've got 4 semesters left of my Computer Science degree but i haven't done any "real work" involving programming yet. Yea, it has some issues... one of those being it didn't even run on my schools Linux server and i had to change a few things. I actually learn so little from my current professor that I'm considering take a c++ class at my county's community college over next summer just to learn more even though it won't count as a credit. I am currently learning c++ from a friend who has taken it before instead of my professor =/

 

Also I think people just didn't wanna look through all of it to find out whats going on. I actually probably should have uploaded the inventory file too =p

Link to comment
https://linustechtips.com/topic/80424-c-file-readopen-error/#findComment-1112047
Share on other sites

Link to post
Share on other sites

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

×