error: stray '\342' in program

trying a code for a simple game i downloaded. when i run it i get lines and lines of this error:
error stray '\200' in program (with different numbers)
- i'm using code::blocks, in case that matters....

what does this mean??
here are the first lines of the code. the first error (one in subject) points to line 36

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//Mine Field
#include <iostream> 
#include <exception> 
#include <string> 
#include <vector> 
#include <cstdlib> 
#include <ctime> 

using std::string;
using std::vector; 
using std::srand;
using std::time;


class StepOnMine {}; 
class FailedDisarm {}; 
class MineField 
{ 
	vector<bool> minefield; 

	//stores where the player has been 
	vector<bool> beenThere; 
	
	//current location of player
	int location; 

	int menu(string choices[], int numChoices)
	{
		using std::cout;
		using std::cin;

		int choice;
		do {
			for (int i = 0; i < numChoices; i++)
			{
				cout << i+1 << “) “ << choices[i] << “\n”;
			}
			cin << choice;
		while (choice < 1 || choice > numChoices);
		return choice;
	}


thank you!!
Last edited on
Well, it is because there are “ and ” instead of " (note the slant!), and these characters are not valid.
.......... it's always the little things that matter :)
cin >> not <<
wow i guess there's a lot wrong with this code.

I just got the same error doing something different now. In another example, i need to use this line:

#import "C:\\Program Files\\O2G\fxcore.dll"

does that mean the line is wrong or is the .dll library wrong?
Do you not notice the single backslash before fxcore.dll?
still getting the same error. I even moved the file to c:\ and used:

#import "C:\\fxcore.dll"

and still same error
Could you copy and paste the error exactly?
Switch to forward slash / instead of double-backslashes. It works on Win, and means you don't have to worry about double-slashes.

Which compiler (and preprocessor) are you using? Does it recognise #import? It's not part of the C++ standard.
the code (i tried include in place of import, same problem):

1
2
3
4
5
6
7
8
9
10
#include <iostream>
#import "C:\\fxcore.dll"

using namespace std;

int main()
{
   cout << "It works!!!\n";
    return 0;
}


the error:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

Compiling: main.cpp
C:\Users\Sebastian\Desktop\cpp projects\ranya\test\main.cpp:2:2: warning: #import is a deprecated GCC extension
In file included from C:\Users\Sebastian\Desktop\cpp projects\ranya\test\main.cpp:2:
C:\\fxcore.dll:1: error: stray '\220' in program
In file included from C:\Users\Sebastian\Desktop\cpp projects\ranya\test\main.cpp:2:
C:\\fxcore.dll:1:4: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\3' in program
C:\\fxcore.dll:1:6: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\4' in program
C:\\fxcore.dll:1:10: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\377' in program
C:\\fxcore.dll:1: error: stray '\377' in program
C:\\fxcore.dll:1:15: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\270' in program
C:\\fxcore.dll:1:18: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '@' in program
C:\\fxcore.dll:1:26: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\20' in program
C:\\fxcore.dll:1: error: stray '\1' in program
C:\\fxcore.dll:1:63: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\16' in program
C:\\fxcore.dll:1: error: stray '\37' in program
C:\\fxcore.dll:1: error: stray '\272' in program
C:\\fxcore.dll:1: error: stray '\16' in program
C:\\fxcore.dll:1:69: warning: null character(s) ignored
C:\\fxcore.dll:1: error: stray '\264' in program
C:\\fxcore.dll:1: error: stray '\315' in program
C:\\fxcore.dll:1: error: stray '\270' in program
C:\\fxcore.dll:1: error: stray '\1' in program
C:\\fxcore.dll:1: error: stray '\315' in program
C:\\fxcore.dll:3:2: warning: null character(s) ignored
C:\\fxcore.dll:3: error: stray '\20' in program
C:\\fxcore.dll:3: error: stray '\311' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\365' in program
C:\\fxcore.dll:3: error: stray '\265' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\267' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\267' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\241' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\345' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\267' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\241' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\3' in program
C:\\fxcore.dll:3: error: stray '\232' in program
C:\\fxcore.dll:3: error: stray '\267' in program
C:\\fxcore.dll:3: error: stray '\232' in program
warning: #import is a deprecated GCC extension

Um...why are you using #import in that case?
Last edited on
Don't use import. It seems that your preprocessor doesn't recognise it.

Don't #include a dll file. It's meaningless. #include literally copies the entire file you want to include, and puts it into the place where you wrote #include .

Do not #include a dll file. I know I already said that, but I get the feeling saying it twice will help.

Why are you trying to #include a dll file? I think you must have misunderstood what a dll file is.
Last edited on
Topic archived. No new replies allowed.