Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems using Microsoft Visual C++
#1
I honestly have no idea what's going wrong anymore.

I tried compiling using a number of different solution types, but I keep getting the following error:
[Image: why1.png]
[Image: why2.png]

I have already tried the filetypes as circled in red.
[Image: why.png]

What is going on? Why is this happening? I tried renaming my .cpp file to .exe to try to solve the problem, but it didn't work. What am I doing wrong?
Reply
#2
Why are there no files in your project other than readme.txt? Your .cpp file does not appear to be in your project.
Reply
#3
How do I do that? I tried saving it within the debug folder, the project folder, etc. It still doesn't work.
Reply
#4
How are you creating the .cpp file? Are you creating it in notepad or something and then trying to use Visual C++ to compile?

To add a .cpp file to the project, right-click the Source Files folder and choose Add New Item.
Reply
#5
You do realize that won't compile right?

Code:
int x = "I quit";

I don't know how that makes sense. A string is not an integer.
Reply
#6
So... what should I have used instead?
Reply
#7
http://www.cplusplus.com/reference/string/string/
Reply
#8
Besides the problem Fiel specified, also you need to include all your .cpp files in your project.
To do this do the following:
1. Go to File.
2. Move "something.cpp" into...
3. Choose your project.
Try to compile then.
EDIT: I always use Empty Project unless I am working with Graphics in which case I use Windows Applications with settings on Empty Project.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)