Stanley Lai
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\kerne l32.dll', no matching symbolic information found.
First-chance exception in assign1.exe: 0xC0000005: Access Violation.
First-chance exception in assign1.exe: 0xC0000005: Access Violation.
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\kerne
First-chance exception in assign1.exe: 0xC0000005: Access Violation.
First-chance exception in assign1.exe: 0xC0000005: Access Violation.
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;
}
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.
You have not responded which compiler are you using.
ASKER
I did respond... MS Visual C++ 6.0.
ASKER
i am waiting ... James...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
ASKER
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.
> 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.
ASKER
i already post it as my open questions.
OK, I have post an answer, hope to be useful.
also try to use
#include <iostream>
but I think problem is more related to some compiler options.