Error stray 342 in program ошибка

trying to build project from chapter 8 MultithreadedCV in QtCreator under Archlinux I got : /usr/bin/uic ../MultithreadedCV/mainwindow.ui -o ui_mainwindow.h g++ -c -pipe -g -Wall -W -D_REENTRANT -f...

trying to build project from chapter 8 MultithreadedCV in QtCreator under Archlinux I got :

/usr/bin/uic ../MultithreadedCV/mainwindow.ui -o ui_mainwindow.h
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../MultithreadedCV -I. -isystem /usr/local/include/opencv -isystem /usr/local/include -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/qt/mkspecs/linux-g++ -o main.o ../MultithreadedCV/main.cpp
../MultithreadedCV/main.cpp:26:16: error: stray ‘342’ in program
         return “”;
                ^
../MultithreadedCV/main.cpp:26:17: error: stray ‘200’ in program
         return “”;
                 ^
../MultithreadedCV/main.cpp:26:18: error: stray ‘234’ in program
         return “”;
                  ^
../MultithreadedCV/main.cpp:26:19: error: stray ‘342’ in program
         return “”;
                   ^
../MultithreadedCV/main.cpp:26:20: error: stray ‘200’ in program
         return “”;
                    ^
../MultithreadedCV/main.cpp:26:21: error: stray ‘235’ in program
         return “”;
                     ^
../MultithreadedCV/main.cpp:32:31: error: stray ‘342’ in program
                       QString(“”).toStdWString().c_str(),
                               ^
../MultithreadedCV/main.cpp:32:32: error: stray ‘200’ in program
                       QString(“”).toStdWString().c_str(),
                                ^
../MultithreadedCV/main.cpp:32:33: error: stray ‘234’ in program
                       QString(“”).toStdWString().c_str(),
                                 ^
../MultithreadedCV/main.cpp:32:34: error: stray ‘’ in program
                       QString(“”).toStdWString().c_str(),
                                  ^
../MultithreadedCV/main.cpp:32:35: error: stray ‘342’ in program
                       QString(“”).toStdWString().c_str(),
                                   ^
../MultithreadedCV/main.cpp:32:36: error: stray ‘200’ in program
                       QString(“”).toStdWString().c_str(),
                                    ^
../MultithreadedCV/main.cpp:32:37: error: stray ‘235’ in program
                       QString(“”).toStdWString().c_str(),
                                     ^
../MultithreadedCV/main.cpp: In function ‘QString getVersionString(QString)’:
../MultithreadedCV/main.cpp:18:5: error: ‘DWORD’ was not declared in this scope
     DWORD dwHandle;
     ^~~~~
../MultithreadedCV/main.cpp:19:11: error: expected ‘;’ before ‘dwLen’
     DWORD dwLen = GetFileVersionInfoSize(fName.toStdWString().c_str(), &dwHandle);
           ^~~~~
../MultithreadedCV/main.cpp:21:5: error: ‘LPVOID’ was not declared in this scope
     LPVOID lpData = new BYTE[dwLen];
     ^~~~~~
../MultithreadedCV/main.cpp:22:58: error: ‘dwHandle’ was not declared in this scope
     if(!GetFileVersionInfo(fName.toStdWString().c_str(), dwHandle, dwLen, lpData))
                                                          ^~~~~~~~
../MultithreadedCV/main.cpp:22:58: note: suggested alternative: ‘drand48’
     if(!GetFileVersionInfo(fName.toStdWString().c_str(), dwHandle, dwLen, lpData))
                                                          ^~~~~~~~
                                                          drand48
../MultithreadedCV/main.cpp:22:68: error: ‘dwLen’ was not declared in this scope
     if(!GetFileVersionInfo(fName.toStdWString().c_str(), dwHandle, dwLen, lpData))
                                                                    ^~~~~
../MultithreadedCV/main.cpp:22:75: error: ‘lpData’ was not declared in this scope
     if(!GetFileVersionInfo(fName.toStdWString().c_str(), dwHandle, dwLen, lpData))
                                                                           ^~~~~~
../MultithreadedCV/main.cpp:22:75: note: suggested alternative: ‘QMapData’
     if(!GetFileVersionInfo(fName.toStdWString().c_str(), dwHandle, dwLen, lpData))
                                                                           ^~~~~~
                                                                           QMapData
../MultithreadedCV/main.cpp:22:9: error: ‘GetFileVersionInfo’ was not declared in this scope
     if(!GetFileVersionInfo(fName.toStdWString().c_str(), dwHandle, dwLen, lpData))
         ^~~~~~~~~~~~~~~~~~
../MultithreadedCV/main.cpp:25:18: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
         delete[] lpData;
                  ^~~~~~
../MultithreadedCV/main.cpp:26:9: error: return-statement with no value, in function returning ‘QString’ [-fpermissive]
         return “”;
         ^~~~~~
../MultithreadedCV/main.cpp:29:5: error: ‘VS_FIXEDFILEINFO’ was not declared in this scope
     VS_FIXEDFILEINFO *lpBuffer = NULL;
     ^~~~~~~~~~~~~~~~
../MultithreadedCV/main.cpp:29:23: error: ‘lpBuffer’ was not declared in this scope
     VS_FIXEDFILEINFO *lpBuffer = NULL;
                       ^~~~~~~~
../MultithreadedCV/main.cpp:29:23: note: suggested alternative: ‘setbuffer’
     VS_FIXEDFILEINFO *lpBuffer = NULL;
                       ^~~~~~~~
                       setbuffer
../MultithreadedCV/main.cpp:30:5: error: ‘UINT’ was not declared in this scope
     UINT uLen;
     ^~~~
../MultithreadedCV/main.cpp:30:5: note: suggested alternative: ‘MIN’
     UINT uLen;
     ^~~~
     MIN
../MultithreadedCV/main.cpp:31:23: error: ‘lpData’ was not declared in this scope
     if(!VerQueryValue(lpData,
                       ^~~~~~
../MultithreadedCV/main.cpp:31:23: note: suggested alternative: ‘QMapData’
     if(!VerQueryValue(lpData,
                       ^~~~~~
                       QMapData
../MultithreadedCV/main.cpp:33:31: error: expected primary-expression before ‘)’ token
                       (LPVOID*)&lpBuffer,
                               ^
../MultithreadedCV/main.cpp:34:24: error: ‘uLen’ was not declared in this scope
                       &uLen))
                        ^~~~
../MultithreadedCV/main.cpp:34:24: note: suggested alternative: ‘QPen’
                       &uL``en))
                        ^~~~
                        QPen
../MultithreadedCV/main.cpp:31:9: error: ‘VerQueryValue’ was not declared in this scope
     if(!VerQueryValue(lpData,
         ^~~~~~~~~~~~~
../MultithreadedCV/main.cpp:42:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Makefile:603: main.o] Error 1
16:51:15: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project MultithreadedCV (kit: Desktop)
When executing step "Make"
16:51:15: Elapsed time: 00:03.
  1. //——————————-таймер вызова подпрограммы ————
    if (time == 0){
    //подпрограмма
    readTemp();

    }
    else{
    time;
    }

    Arduino: 1.6.12 (Windows 7), Плата:»Arduino Nano, ATmega328″

    test_seti_2:79: error: stray ‘342’ in program

    time —;

    ^

    test_seti_2:79: error: stray ‘200’ in program

    test_seti_2:79: error: stray ‘224’ in program

    exit status 1
    stray ‘342’ in program

    как исправить данную ошибку ?

    Последнее редактирование: 20 ноя 2016

  2. на этот бред и ругается.

    P.S. Пожалуйста, оформляйте код правильно (9-я кнопка в этом редакторе).

  3. что нужно изменить чтоб он работал ?

  4. Нет, ругается он явно на кодировки.

  5. Я ж не знаю что должна делать эта программа.
    Возможно так:

    Если ругается на кодировки, то все сомнительные буковки (русская ‘о’ и латинская ‘o’ выглядят одинаково) надо переписать корректно.

  6. исправил ошибка ушла

    if (time == 0){
    //подпрограмма
    readTemp();

    }
    else{
    time ;
    }

    полная версия кода

    // IDE 1.5.2
    //———————— PIN ETHERNET ENC28J60—————
    //Ethetnet Arduino UNO
    //VCC +3.3V
    //GND GND
    //CS(SS) D10
    //SI(MOSI) D11
    //SO(MISO) D12
    //SCK D13
    //———————— PIN ETHERNET ENC28J60—————

    #include «DHT.h»
    #include <EtherCard.h>
    #include <EEPROM.h>
    #define DHTPIN 2 // what pin we’re connected to
    #define DHTTYPE DHT11 // DHT 11
    //#define DHTTYPE DHT22 // DHT 22 (AM2302)
    //#define DHTTYPE DHT21 // DHT 21 (AM2301)
    // Connect pin 1 (on the left) of the sensor to +5V
    // Connect pin 2 of the sensor to whatever your DHTPIN is
    // Connect pin 4 (on the right) of the sensor to GROUND
    // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
    DHT dht(DHTPIN, DHTTYPE);

    static byte mymac[] = {0xDD,0xDD,0xDD,0x00,0x00,0x01};
    static byte myip[] = {192,168,88,24};
    byte Ethernet::buffer[1100];

    //float h ;
    //float t ;

    byte vlaga = 75;
    int temp = 55;
    int vent =85;

    int pot; // переменная датчика затопления
    byte vf; // переменная для значения влаги во флеше

    #define VlagInPin 3 // Пин для подключения Датчика затопления
    #define RelPin 4 // Пин реле упраления вентиляции
    #define PotPin 5 // Пин реле клапана воды , сирены,откачивающего насоса, отключение гидрофора от «Датчика затопления»

    unsigned long time = 0;

    void setup () {
    Serial.begin(115200);
    Serial.println( «Bolshoy podval 192.168.88.24»);
    if (!ether.begin(sizeof Ethernet::buffer, mymac, 10))
    Serial.println( «Failed to access Ethernet controller»);
    else
    Serial.println(«Ethernet controller initialized»);

    if(!ether.staticSetup(myip))
    Serial.println(«Failed to set IP address»);

    dht.begin();
    pinMode(VlagInPin, INPUT);
    pinMode(RelPin, OUTPUT);
    digitalWrite(RelPin, HIGH);
    pinMode(PotPin, OUTPUT);
    digitalWrite(PotPin, HIGH);

    vent = EEPROM.read(0);
    }

    void loop(){

    if (vlaga >= vent) {digitalWrite(RelPin, LOW);}
    else if(vlaga <= (vent2)) {digitalWrite(RelPin, HIGH);}

    //——————————-таймер вызова подпрограммы ————
    if (time == 0){
    //подпрограмма
    readTemp();

    }
    else{
    time ;
    }
    //———————————————————————

    word len = ether.packetReceive();
    word pos = ether.packetLoop(len);

    if(pos) {

    Serial.println();
    //boolean password_valid = true;

    // is it a POST request?
    if(strstr((char *)Ethernet::buffer + pos, «POST /») != 0) {

    }

    if(strstr((char *)Ethernet::buffer + pos, «minus») != 0) {
    if (vent < 1) {vent = 100;}
    else vent;
    EEPROM.write(0, vent);
    }
    if(strstr((char *)Ethernet::buffer + pos, «plus») != 0) {
    vent++;
    if (vent > 100) {vent = 0;}
    EEPROM.write(0, vent);
    }
    // —————————————————————————-—

    // Output HTML page
    BufferFiller bfill = ether.tcpOffset();
    bfill.emit_p(PSTR(«HTTP/1.0 200 OKrn«
    «Content-Type: text/htmlrnPragma: no-cachernrn«
    «<meta http-equiv=’refresh’ content=’5’/>» // автообновление странички каждый 5 сек
    «<html><head><title>Большой подвал Басейна</title></head>»
    «<html><body>»
    «<H1>Большой подвал басейна</H1>»

    «<form method=«POST«));

    bfill.emit_p(PSTR(«<table border=«1«
    «<tr><td>Температура</td><td> $D &deg;C </td></tr>»
    «<tr><td>Влажность</td><td> $D % </td></tr>»
    «<tr><td>Вкл Вент</td><td> $D %</div></td></tr>»
    «</table>»),temp,vlaga,vent);

    bfill.emit_p(PSTR(«<button name=«plus«>+</button></div>»));
    bfill.emit_p(PSTR(«<button name=«minus«>-</button></div>»));

    bfill.emit_p(PSTR(«</form></body></html>»));
    ether.httpServerReply(bfill.position());
    }
    }

    void readTemp(){ //—————————————-Чтение температуры —————————

    vlaga = dht.readHumidity();
    temp = dht.readTemperature();
    time = 100000;
    }

  7. Добрый день!
    Приобрел датчик DHT22, работает ровно несколько минут, после выдает ошибку «dht11 start condition 1 not met», следом «dht11 start condition 2 not met» дважды и тишина.
    Arduino uno, библиотека стандартная DHT, пример DHTtester.ino

  8. Интересно, что с библиотекой shDHT, работает отлично!

  9. у тебя датчик DTH 22 после выдал ошибку о датчике dth 11? а ты правильно скетч отредактировал ?

  10. код можешь выложить ?

    у меня так выглядит

    //выбор используемого датчика
    #define DHTTYPE DHT11   // DHT 11
    //#define DHTTYPE DHT22   // DHT 22  (AM2302)
    //#define DHTTYPE DHT21   // DHT 21 (AM2301)

    // Подключить pin 1 датчика DHT (считаем слева) к питанию +5V
    // Подключить pin 2 датчика DHT к выводу указанному выше переменной DHTPIN
    // Подключить pin 4 датчика DHT (on the right) к минусу питания 0V
    // Подключить 10K сопротивление между pin 2 (data) и pin 1 (+5В) на датчике DHT

    //инициализация датчика
    DHT dht(DHTPIN, DHTTYPE);
    int VlagInPin = 3; // Пин для подключения Датчика затопления
    int RelPin = 4;  // Пин реле упраления вентиляции
    int PotPin = 5; // Пин реле клапана воды , сирены,откачивающего насоса, отключение гидрофора от «Датчика затопления»
    byte vlaga = 75;
    int temp = 55;
    int vent =85;
    int pot; // переменная датчика затопления
    byte vf; // переменная для значения влаги во флеше

  11. Стандартный код из библиотеки DHT, пример DHTtester

    // Example testing sketch for various DHT humidity/temperature sensors
    // Written by ladyada, public domain

    #include «DHT.h»

    #define DHTPIN 2 // what pin we’re connected to

    // Uncomment whatever type you’re using!
    //#define DHTTYPE DHT11 // DHT 11
    #define DHTTYPE DHT22 // DHT 22 (AM2302)
    //#define DHTTYPE DHT21 // DHT 21 (AM2301)

    // Connect pin 1 (on the left) of the sensor to +5V
    // Connect pin 2 of the sensor to whatever your DHTPIN is
    // Connect pin 4 (on the right) of the sensor to GROUND
    // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

    DHT dht(DHTPIN, DHTTYPE);

    void setup() {
    Serial.begin(9600);
    Serial.println(«DHTxx test!»);

    dht.begin();
    }

    Ничего не перепутано.

  • Forum
  • Beginners
  • error: stray ‘342’ in program

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\O2Gfxcore.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:UsersSebastianDesktopcpp projectsranyatestmain.cpp:2:2: warning: #import is a deprecated GCC extension
In file included from C:UsersSebastianDesktopcpp projectsranyatestmain.cpp:2:
C:\fxcore.dll:1: error: stray '220' in program
In file included from C:UsersSebastianDesktopcpp projectsranyatestmain.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.

Понравилась статья? Поделить с друзьями:
  • Error stray 340 in program
  • Error stray 321 in program
  • Error stray 253 in program
  • Error stray 241 in program
  • Error stray 227 in program