- Печать
Страницы: [1] Вниз
Тема: Ошибка в ходе компиляции (Прочитано 8893 раз)
0 Пользователей и 1 Гость просматривают эту тему.

OPENANDFREEALEX
Ошибка в ходе компиляции
/home/openandfreealex/avr/main.c: In function ‘main’:
/home/openandfreealex/avr/main.c:9:1: error: stray ‘302’ in program
/home/openandfreealex/avr/main.c:9:1: error: stray ‘253’ in program
/home/openandfreealex/avr/main.c:9:14: error: expected ‘)’ before numeric constant
код:
#include <avr/io.h>
#include <util/delay.h>
void init(void);
int main(void)
{
init(); // Настройка переферии
PORTE |= (1«2);
while(1)
{
PORTA = 0b10101010;
_delay_ms(100);
_delay_ms(100);
PORTA = 0b01010101;
_delay_ms(100);
_delay_ms(100);
}
}
void init(void)
{
/* Конфигурирование портов (1-выход, 0-вход) */
DDRE = 0xFF; // PORTE — выход
PORTE = 0x00;
DDRA = 0xFF; // PORTA — выход
PORTA = 0x00;
}
Пользователь решил продолжить мысль 25 Февраля 2012, 00:58:41:
Можно закрывать, нашел.
« Последнее редактирование: 25 Февраля 2012, 00:58:41 от OPENANDFREEALEX »

НеФормат
НУ давай решение в студию

Olej
НУ давай решение в студию
обычно такие сообщения:
/home/openandfreealex/avr/main.c:9:1: error: stray ‘302’ in program
лезут когда в С-коде недопустимые символы (байты текста кода) — это характерные и очень противные ошибки
/home/openandfreealex/avr/main.c:9:1: error: stray ‘253’ in program, такое часто бывает когда не закрытые литерали встречаются с русскими (UNICODE) буквами…
в данном случае это почти наверняка:
PORTE |= (1«2);
вместо 2-х знаков LT (<) случился какой-то странный знак кавычки.
P.S. это я написал, чтоб, кому случится, сразу знали в чём искать … «stray ‘253’»
- Печать
Страницы: [1] Вверх
Содержание
- unixforum.org
- ошибки коплиляции программ Qt4, stray
- ошибки коплиляции программ Qt4, stray
- unixforum.org
- Решено: error: stray ‘4’ in program (не компилятся проги)
- Решено: error: stray ‘4’ in program
- mirsovetov.net
- Андрощук Александр, ИТ решения, советы, заметки…
- stray # in program
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- Ошибка 40: error: stray ‘’ in program
- Stray error in с program files
unixforum.org
Форум для пользователей UNIX-подобных систем
- Темы без ответов
- Активные темы
- Поиск
- Статус форума
ошибки коплиляции программ Qt4, stray
ошибки коплиляции программ Qt4, stray
Сообщение chups » 28.05.2008 17:17
всем привет. уважаемые форумчане подскажите в чем проблемма: пишу не очень сложную программку, до поры до времени она собиралась, а потом начались появляться непонятные мне ошибки компиляции:
/from PCLinuxOS/Data Base/current work/temp_tableview> make make: Warning: File `ui_dbFile.h’ has modification time 2,2e+04 s in the future g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/QtSql -I/usr/include -I. -I. -I. -o table.o table.cpp table.cpp:10: error: stray ‘321’ in program table.cpp:10: error: stray ‘201’ in program table.cpp:13: error: stray ‘321’ in program table.cpp:13: error: stray ‘201’ in program table.cpp:15: error: stray ‘321’ in program table.cpp:15: error: stray ‘201’ in program make: *** [table.o] Ошибка 1
а вот здесь у меня вообще произошла ломка понятий
:
/from PCLinuxOS/Data Base/current work/temp_tableview> make make: Warning: File `ui_dbFile.h’ has modification time 2,2e+04 s in the future g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/QtSql -I/usr/include -I. -I. -I. -o table.o table.cpp g++ -o temp_tableview main.o table.o workWithDb.o moc_workWithDb.o -L/usr/lib -lQtSql -L/usr/lib -lQtGui -L/usr/X11R6/lib -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -lrt -ldl -lpthread make: предупреждение: Неправильный ход часов. Сборка может быть неполной.
В чем проблема? из-за чего возникают ошибки. код вроде правильный.
Qt4 изаю последний, пробовал собирать в 2 системах: opensuse и pclinuxos, результат одинаков
Источник
unixforum.org
Форум для пользователей UNIX-подобных систем
- Темы без ответов
- Активные темы
- Поиск
- Статус форума
Решено: error: stray ‘194’ in program (не компилятся проги)
Решено: error: stray ‘194’ in program
Сообщение LLIypynuk » 20.07.2007 07:31
Я новичек в программировании под Линух. Помогите.
Я хотел откомпилить очередную прогу с gcc, а она мне выдала FUCK! потом решил откомпилить свой HelloWorld,
но он тоже отказался компилиться и выкинул мне эт:
hello.c: In function ‘main’:
hello.c:5: error: stray ‘194’ in program
hello.c:5: error: stray ‘168’ in program
hello.c:5: error: ‘Hello’ undeclared (first use in this function)
hello.c:5: error: (Each undeclared identifier is reported only once
hello.c:5: error: for each function it appears in.)
hello.c:5: error: syntax error before ‘World!’
hello.c:5: error: stray ‘’ in program
hello.c:5: error: stray ‘194’ in program
hello.c:5: error: stray ‘168’ in program
hello.c:6:3: warning: no newline at end of file
Толи у мня руки из жопы , что ли чё.
====ну я надеюсь что это не первое!
======
Источник
mirsovetov.net
Андрощук Александр, ИТ решения, советы, заметки…
stray # in program
При компиляции проекта в Android IDE возникла ошибка
LampCore:20: error: stray ‘302’ in program
Код, который вызывал ошибку не был какой то особенный, была объявлена простенькая структура с полями:
В моем случае ошибка возникла из за того, что я случайно в названии структуры Config написал не латинский символ C. Самое интересное что с виду все кажется в порядке, а на самом деле это не так, и возникает ошибка «stray ‘320’ in program».
Так что решение — использовать только латинские символы (это не касается комментариев).
Также могут возникать другие ошибки такого же рода, только с другим кодом
Скорее всего что следующие ошибки:
error stray 2 in program
error stray 200 in program
error stray 201 in program
error stray 213 in program
error stray 223 in program
error stray 226 in program
error stray 227 in program
error stray 240 in program
error stray 253 in program
error stray 273 in program
error stray 302 in program
error stray 320 in program
error stray 321 in program
error stray 340 in program
error stray 342 in program
error stray 357 in program
error stray 361 in program
тоже связанны с этой проблемой, если это не так, пожалуйста отпишитесь в комментариях.
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
Ошибка 40: error: stray ‘’ in program
Добрый день. Написал вот такую программульку:
// константы
const int dw = 12; // датчик уровня воды на 12 пин
const int dg1 = 11; // датчик влажности почвы на 11 пин
const int dg2 = 10; // датчик влажности почвы на 10 пин
const int dg3 = 9; // датчик влажности почвы на 9 пин
const int dg4 = 8; // датчик влажности почвы на 8 пин
const int dg5 = 7; // датчик влажности почвы на 7 пин
const int nasos1 = 2; // управление насосом на 2 пин
const int nasos2 = 3; // управление насосом на 3 пин
const int nasos3 = 4; // управление насосом на 4 пин
const int nasos4 = 5; // управление насосом на 5 пин
const int nasos5 = 6; // управление насосом на 6 пин
const int ledB = 1; // звуковой пъезоэлемент на 1 пин
// переменные
int dwS = 0; // состояние датчика уровня воды
int dgS1 = 0; // состояние датчика уровня влажности почвы Nr1
int dgS2 = 0; // состояние датчика уровня влажности почвы Nr2
int dgS3 = 0; // состояние датчика уровня влажности почвы Nr3
int dgS4 = 0; // состояние датчика уровня влажности почвы Nr4
int dgS5 = 0; // состояние датчика уровня влажности почвы Nr5
//установки
void setup() <
// объявляем пины светодиодов и насоса как выходы:
pinMode(nasos1, OUTPUT);
pinMode(nasos2, OUTPUT);
pinMode(nasos3, OUTPUT);
pinMode(nasos4, OUTPUT);
pinMode(nasos5, OUTPUT);
pinMode(ledB, OUTPUT);
// объявляем пины датчиков и насоса как входы:
pinMode(dw, INPUT);
pinMode(dg1, INPUT);
pinMode(dg2, INPUT);
pinMode(dg3, INPUT);
pinMode(dg4, INPUT);
pinMode(dg5, INPUT);
>
// рабочий цикл
void 1оор() <
// считываем состояния датчика уровня жидкости
dwS = digitalRead(dw);
// если воды мало звуковой пъезоэлемент
if (dwS == LOW)
digitalWrite(ledB, HIGH);
else
digitalWrite(ledB, LOW);
// считываем состояния датчика влажности почвы Nr1
dgS1 = digitalRead(dg1);
// если почва сухая, включаем полив насоса Nr1
if (dgS1 == LOW)
digitalWrite(nasos1, HIGH);
delay(2000);
digitalWrite(nasos1, LOW);
delay(30000);
else
digitalWrite(nasos1, LOW);
// считываем состояния датчика влажности почвы Nr2
dgS2 = digitalRead(dg2);
// если почва сухая, включаем полив насоса Nr2
if (dgS2 == LOW)
digitalWrite(nasos2, HIGH);
delay(2000);
digitalWrite(nasos2, LOW);
delay(30000);
else
digitalWrite(nasos2, LOW);
// считываем состояния датчика влажности почвы Nr3
dgS3 = digitalRead(dg3);
// если почва сухая, включаем полив насоса Nr3
if (dgS3 == LOW)
digitalWrite(nasos3, HIGH);
delay(2000);
digitalWrite(nasos3, LOW);
delay(30000);
else
digitalWrite(nasos3, LOW);
// считываем состояния датчика влажности почвы Nr4
dgS4 = digitalRead(dg4);
// если почва сухая, включаем полив насоса Nr4
if (dgS4 == LOW)
digitalWrite(nasos4, HIGH);
delay(2000);
digitalWrite(nasos4, LOW);
delay(30000);
else
digitalWrite(nasos4, LOW);
// считываем состояния датчика влажности почвы Nr5
dgS5 = digitalRead(dg5);
// если почва сухая, включаем полив насоса Nr5
if (dgS1 == LOW)
digitalWrite(nasos5, HIGH);
delay(2000);
digitalWrite(nasos5, LOW);
delay(30000);
else
digitalWrite(nasos5, LOW);
>
Примитивная до безобразия, но при компиляции выдаёт ошибки:
Arduino: 1.6.5 (Windows 8.1), Board: «Arduino Leonardo»
Cveti_Lacplesa_42_2_5pump:40: error: stray ‘’ in program
Cveti_Lacplesa_42_2_5pump:40: error: stray ‘’ in program
Cveti_Lacplesa_42_2_5pump:40: error: stray ‘’ in program
Cveti_Lacplesa_42_2_5pump:40: error: expected unqualified-id before numeric constant
stray ‘’ in program
This report would have more information with
«Show verbose output during compilation»
enabled in File > Preferences.
Источник
Stray error in с program files
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
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?
still getting the same error. I even moved the file to c: and used:
and still same error
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):
warning: #import is a deprecated GCC extension
Um. why are you using #import in that case?
Don’t use import. It seems that your preprocessor doesn’t recognise it.
Don’t a dll file. It’s meaningless. literally copies the entire file you want to include, and puts it into the place where you wrote .
Do not a dll file. I know I already said that, but I get the feeling saying it twice will help.
Why are you trying to a dll file? I think you must have misunderstood what a dll file is.
Источник
- Forum
- Beginners
- Problems with char arrays in dynamic mem
Problems with char arrays in dynamic memory…
I can’t seem to pin down why my program, when run, will puke out this:
... omitted ... a.cpp:29: error: stray '251' in program a.cpp:29: error: stray '255' in program a.cpp:29: error: stray '255' in program a.cpp:29: error: stray '131' in program a.cpp:29: error: stray '209' in program a.cpp:29: error: stray '1' in program a.cpp:29: error: stray '141' in program a.cpp:29: error: stray '20' in program a.cpp:29: error: stray '131' in program a.cpp:29: error: stray '253' in program a.cpp:29: error: stray '252' in program a.cpp:29: error: stray '15' in program a.cpp:29: error: stray '138' in program a.cpp:29: error: stray '2' in program a.cpp:29: error: stray '136' in program a.cpp:29: error: stray '7' in program a.cpp:29: error: stray '247' in program a.cpp:29: error: stray '233' in program ... omitted ... a.cpp:29: error: stray '236' in program a.cpp:29: error: stray '128' in program a.cpp:29: error: stray '233' in program a.cpp:29: error: stray '186' in program a.cpp:29: error: stray '149' in program a.cpp:29: error: stray '255' in program a.cpp:29: error: stray '255' in program a.cpp:29:409: warning: null character(s) ignored a.cpp:29: error: stray '`' in program a.cpp:29: error: stray '128' in program a.cpp:29:561: warning: null character(s) ignored a.cpp:29: error: stray '128' in program a.cpp:29:565: warning: null character(s) ignored a.cpp:29: error: stray '128' in program a.cpp:29:581: warning: null character(s) ignored a.cpp:29: error: stray '128' in program a.cpp:29:585: warning: null character(s) ignored a.cpp:29: error: stray '128' in program a.cpp:29:609: warning: null character(s) ignored a.cpp:29: error: stray '134' in program a.cpp:29: error: stray '128' in program a.cpp:29:613: warning: null character(s) ignored a.cpp:29: error: stray '150' in program a.cpp:29: error: stray '128' in program a.cpp:29:617: warning: null character(s) ignored a.cpp:29: error: stray '166' in program a.cpp:29: error: stray '128' in program a.cpp:29:621: warning: null character(s) ignored a.cpp:29: error: stray '180' in program a.cpp:29: error: stray '128' in program a.cpp:29:625: warning: null character(s) ignored a.cpp:29: error: stray '194' in program a.cpp:29: error: stray '128' in program a.cpp:29:629: warning: null character(s) ignored a.cpp:29: error: stray '208' in program a.cpp:29: error: stray '128' in program a.cpp:29:637: warning: null character(s) ignored a.cpp:29:655: warning: null character(s) ignored a.cpp:29:666: warning: null character(s) ignored a.cpp:29:681: warning: null character(s) ignored a.cpp:29:697: warning: null character(s) ignored a.cpp:29:713: warning: null character(s) ignored a.cpp:29:727: warning: null character(s) ignored a.cpp:29:740: warning: null character(s) ignored a.cpp:29:754: warning: null character(s) ignored a.cpp:29:761: warning: null character(s) ignored a.cpp:29:1059: warning: no newline at end of file
I’m using g++ to compile my program, and using g++ within my source to compile another program… my main program compiles with no complaints, but while executing it, I get that stuff spilling out from g++… Had no probs until I tried to use dynamically allocated char arrays, instead of static ones.
Here is my source, with comments. The comments reguarding my problem are within /*** ***/
|
|
By the way, the program is supposed to use GNU g++ to compile a C/C++ source, then strip it using GNU strip, then pack it using UPX.
Like I said, works fine using static arrays, but I guess I’m not implementing the dynamic arrays correctly or something.
Normally you get that when you have some UTF-8 characters in the file. Try looking with a hex editor at the file and finding these stray characters and deleting them.
Apperently, the cpp was really an exe, it somehow got renamed to .cpp… IDFK how that happened…
So turns out my source was fine. Lol.
Last edited on
Topic archived. No new replies allowed.