Link to home
Start Free TrialLog in
Avatar of Stanley Lai
Stanley LaiFlag for Hong Kong

asked on

simple C++ main but get Access Violation?

#include <iostream.h>

int main() {
      
                cout << "hello Joyce" << endl;      
      return 0;

}


when i run and step into it, i got this..... what should i do?

Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
First-chance exception in assign1.exe: 0xC0000005: Access Violation.
First-chance exception in assign1.exe: 0xC0000005: Access Violation.


Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

which compiler ?

also try to use
#include <iostream>

but I think problem is more related to some compiler options.
Avatar of Stanley Lai

ASKER

I am using MS Visual C++ 6.0

now i removed the ".h". It then cannot reconize cout, so i add namespace. I got access violation error.
When i step into it, it asked me for path of strlen.asm......

#include <iostream>
using namespace std;

int main() {
      
      cout << "hello Joyce" << endl;      
      return 0;

}
It appear to be that you are not linking STL library correctly.
You have not responded which compiler are you using.

I did respond... MS Visual C++ 6.0.

 i am waiting ... James...
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

IT WORKS!!!! Thanks alot!!!! You earn another 500 points.
I also created in that win32 console. i tried copy the arguments in my main... i still got run time error. not sure why.
Can you please also answer my 2nd questions?
please also answer my open question linklist.cpp. thanks!
> i tried copy the arguments in my main... i still got run time error. not sure why.
> Can you please also answer my 2nd questions?

I am not sure about what are you asking, could you be more specific?, if an error message, please post it.

i already post it as my open questions.
OK, I have post an answer, hope to be useful.