Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
Форум программистов > C/C++: Общие вопросы > ошибка в code:blocks |
Автор: xcf 31.1.2006, 21:22 | ||||
в code:blocks след запускаю прогу
а он мне выдает следущие Compiling: C:\9.c C:\9.c:1:22: iostream.h: No such file or directory C:\9.c: In function `main': C:\9.c:12: error: `cout' undeclared (first use in this function) C:\9.c:12: error: (Each undeclared identifier is reported only once C:\9.c:12: error: for each function it appears in.) C:\9.c:13: error: `cin' undeclared (first use in this function) C:\9.c:5: warning: return type of 'main' is not `int' C:\9.c:25:2: warning: no newline at end of file Process terminated with status 1 (0 minutes, 1 seconds) 5 errors, 2 warnings проверял в корневой папке наличие библиотеки все наместе. в чем дело? надеюсь на скорою помощь
|
Автор: BreakPointMAN 31.1.2006, 22:12 |
поиграйся с #include, возможно, code:blocks хочет, чтобы было все по-новому стандарту, т.е. "iostream", а не "iostream.h"... кстати, кажется, он и на функцию main будет ругаться, требуя, чтобы она возвращала int-значение... ![]() |
Автор: chipset 31.1.2006, 22:14 | ||
|
Автор: xcf 1.2.2006, 08:22 | ||
изменяю на
выдает следущеи Compiling: C:\9.c C:\9.c:1:20: iostream: No such file or directory C:\9.c:2:17: conio: No such file or directory C:\9.c:3:16: math: No such file or directory C:\9.c: In function `main': C:\9.c:12: error: `cout' undeclared (first use in this function) C:\9.c:12: error: (Each undeclared identifier is reported only once C:\9.c:12: error: for each function it appears in.) C:\9.c:13: error: `cin' undeclared (first use in this function) C:\9.c:25:2: warning: no newline at end of file Process terminated with status 1 (0 minutes, 0 seconds) 7 errors, 1 warnings есть по code:blocks how to на руском ![]() |
Автор: Romikgy 1.2.2006, 12:57 |
А пути прописанны? к инклюдам? да и |
Автор: xcf 1.2.2006, 14:00 |
в настройках прописано расположение библиотек копировал из bcw 3.1 все ттоже самое |
Автор: Partizan 1.2.2006, 16:20 |
мдя....попробуй скниуть нужные *.h файлы туда же где лежит исходник и поменяй <... .h> на "... .h " |
Автор: xcf 1.2.2006, 16:48 | ||
возникла новая проблема
Compiling: C:\inf\ERT.CPP In file included from C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/backward/iostream.h:31, from C:\inf\ERT.CPP:1: C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. C:\inf\ERT.CPP:6: error: `main' must return `int' C:\inf\ERT.CPP:26:2: warning: no newline at end of file Process terminated with status 1 (0 minutes, 4 seconds) 1 errors, 2 warnings проблема в том что когда void заменяешь на int результат проги не правльный |
Автор: Romikgy 1.2.2006, 16:54 | ||
Вот так работает, только проект создай и нет в ф-ции Это только борландовская фича |
Автор: xcf 2.2.2006, 00:18 | ||
кто знает в чем дело? |
Автор: Partizan 2.2.2006, 02:44 |
?!?!?! это как? |
Автор: S.A.P. 2.2.2006, 08:37 | ||
Поставь int main(), а в конце return 0.
а какой правильный? ![]() |
Автор: Romikgy 2.2.2006, 09:48 |
xcf дык покажи че выдает , и че должно быть , а мы подскажем че править ![]() |
Автор: xcf 2.2.2006, 09:48 | ||
если посмотреть на этот цикл
то внем используется тип double что при использовании int что не дает правильного результата а вообще прога должна упорядочить масив по четным и нечетным числам |
Автор: Romikgy 2.2.2006, 09:52 |
Так в чем трабла, замени на инт |
Автор: xcf 2.2.2006, 09:54 |
а вообще прога должна упорядочить масив по четным и нечетным числам |
Автор: volvo877 2.2.2006, 10:04 | ||
Ну, а ты упорядочиваешь по индексам ![]() Держи:
|
Автор: xcf 2.2.2006, 11:49 |
спасибо volvo877 за помощь но опять выдает ошибки Compiling: C:\inf\code\Untitled1.c C:\inf\code\Untitled1.c:1:22: iostream.h: No such file or directory C:\inf\code\Untitled1.c:3: error: syntax error before "namespace" C:\inf\code\Untitled1.c:3: warning: data definition has no type or storage class C:\inf\code\Untitled1.c: In function `main': C:\inf\code\Untitled1.c:8: error: `cout' undeclared (first use in this function) C:\inf\code\Untitled1.c:8: error: (Each undeclared identifier is reported only once C:\inf\code\Untitled1.c:8: error: for each function it appears in.) C:\inf\code\Untitled1.c:10: error: `cin' undeclared (first use in this function) C:\inf\code\Untitled1.c:21:2: warning: no newline at end of file Process terminated with status 1 (0 minutes, 0 seconds) 6 errors, 2 warnings PS Я наверно уже надоел со своими ошибками |
Автор: Romikgy 2.2.2006, 11:56 | ||||
Замени в рабочем коде между
вот это , но только там где работало ![]() |
Автор: volvo877 2.2.2006, 12:01 |
xcf, у тебя что-то с настройками... Дело в том, что я копировал текст из окна MinGW Studio. Там все отработало прекрасно. Должно работать и в code:blocks. Это откуда? У меня в коде <iostream> стоит... Ты бы ПОЛНОСТЬЮ код отсюда копировал, и только потом тестил... Добавлено @ 12:02 АААА !!! Ты файл как назвал? Это же CPP !!! ![]() |
Автор: Romikgy 2.2.2006, 12:07 |
Имхо побоку , в среде указываешь какой код ![]() Я тестил в и номано ![]() |
Автор: xcf 2.2.2006, 17:51 | ||
файл н-ся *.с исправил на *.срр все нормально пошло volvo877 я полностью код вставлял Romikgy можно в code:blocks настороить что он сразу сохранял как *.срр вот новая проблема
следущие ошибки Compiling: C:\inf\code\1.c C:\inf\code\1.c:5: error: syntax error before "namespace" C:\inf\code\1.c:5: warning: data definition has no type or storage class C:\inf\code\1.c: In function `main': C:\inf\code\1.c:25: error: `red' undeclared (first use in this function) C:\inf\code\1.c:25: error: (Each undeclared identifier is reported only once C:\inf\code\1.c:25: error: for each function it appears in.) C:\inf\code\1.c:25: error: `blink' undeclared (first use in this function) C:\inf\code\1.c:30: error: `green' undeclared (first use in this function) C:\inf\code\1.c:34: error: `lightgray' undeclared (first use in this function) C:\inf\code\1.c:37:2: warning: no newline at end of file Process terminated with status 1 (0 minutes, 1 seconds) 7 errors, 2 warnings |
Автор: S.A.P. 2.2.2006, 18:28 |
xcf откуда ты вобще этот код откопал??? Судя по всему он предназначался для Борлы, а ты как я понял на VCT сидишь. |
Автор: xcf 2.2.2006, 21:19 | ||
извеняюсь за глупые фопросы S.A.P.
что это такое? этот код из задачника для си к тому же разве нет разници(большой) между средами разработки я так думаю что синтаксис везде одинаковый должен быть тк си должен портироваться на все платформы без ощютимых изменений... а у меня стоит bcw 3.1 и code:blocks скачал нравится то что синтаксис делает тк положено а у меня с ним одни проблемы mvs не хочю устанавливат слишком мног ресурсов жрет и места занимает... |
Автор: ЧихПых 16.3.2006, 18:14 |
Привет! У меня такая ошибка: Project : Console application Compiler : GNU GCC Compiler (called directly) Directory : D:\Projects\matrix\ -------------------------------------------------------------------------------- Switching to target: default Linking console executable: D:\Projects\matrix\matrix.exe .objs\main.o:main.cpp:(.text+0x1bd): undefined reference to `Rus(char const*)' .objs\main.o:main.cpp:(.text+0x474): undefined reference to `Rus(char const*)' .objs\main.o:main.cpp:(.text+0x49c): undefined reference to `col_line(int**, int)' collect2: ld returned 1 exit status Process terminated with status 1 (0 minutes, 0 seconds) 0 errors, 0 warnings Можете объяснить что произошло, до этого нормально всё компилировалось ![]() |
Автор: xcf 3.6.2007, 00:35 | ||
првиет) чтоб не плодить темы с ошибками я решил написать в ту тему... C: ![]()
на строке fout<<setw(20)<<mash[i].... выдает следующию ошибку eror: no math for 'operator<<' in ' fout << std::setw(20)' та же самая сторока только для cout никаких ошибок... |
Автор: JackYF 3.6.2007, 14:51 | ||
FILE* - это не потоковая файловая переменная. Потоковая файловая переменная - fstream.
|