Форум программистов, компьютерный форум, киберфорум
C/С++ под Linux
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.92/25: Рейтинг темы: голосов - 25, средняя оценка - 4.92
 Аватар для GreatCornholio
0 / 0 / 0
Регистрация: 02.04.2009
Сообщений: 6

gcc и include - первый код, куча ошибок

02.04.2009, 21:41. Показов 5245. Ответов 10
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Первый код под, написанный под линуксом тупо в виме. Он же - пример в Липпмане( решил заново изучать ). Накодил book.C:
C++
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
#include <iostream>
 
using namespace std;
 
void readLn()
{
cout<<"readLn()\n";
}
 
void sort()
{
cout<<"sort()\n";
}
 
 
void compact()
{
cout<<"compact()\n";
}
 
void print()
{
cout<<"print()\n";
}
 
int main()
{
readLn();
sort();
compact();
print();
return 0;
}
$gcc book.C выдаёт огромный список ошибок с инклудами:
//текст сокрашён раза в 2-3 снизу, но всё равно огромен

Code
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
cornholio@host-10-204-60-69:~/codeshit/cppshit$ gcc book.C
In file included from /usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:33,
                 from /usr/include/c++/4.3/cwchar:52,
                 from /usr/include/c++/4.3/bits/postypes.h:47,
                 from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/c++/4.3/ios:44,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isalnum(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:158: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isalpha(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:159: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int iscntrl(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:160: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isdigit(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:161: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isgraph(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:162: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int islower(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:163: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isprint(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:164: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int ispunct(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:165: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isspace(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:166: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isupper(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:167: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h: In function ‘int isxdigit(int)’:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/ctype.h:168: error: ‘_imp____mb_cur_max_dll’ was not declared in this scope
In file included from /usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:37,
                 from /usr/include/c++/4.3/cwchar:52,
                 from /usr/include/c++/4.3/bits/postypes.h:47,
                 from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/c++/4.3/ios:44,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/time.h: At global scope:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/time.h:207: error: expected constructor, destructor, or type conversion before ‘char’
In file included from /usr/include/c++/4.3/cwchar:52,
                 from /usr/include/c++/4.3/bits/postypes.h:47,
                 from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/c++/4.3/ios:44,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:173: error: ‘_dev_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:174: error: ‘_ino_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:175: error: ‘_mode_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:179: error: ‘_dev_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:180: error: ‘_off_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:189: error: ‘_dev_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:190: error: ‘_ino_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:191: error: ‘_mode_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:195: error: ‘_dev_t’ does not name a type
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/wchar.h:196: error: ‘_off_t’ does not name a type
In file included from /usr/include/c++/4.3/bits/postypes.h:47,
                 from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/c++/4.3/ios:44,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/include/c++/4.3/cwchar:150: error: ‘::fgetws’ has not been declared
/usr/include/c++/4.3/cwchar:152: error: ‘::fputws’ has not been declared
/usr/include/c++/4.3/cwchar:156: error: ‘::getwc’ has not been declared
/usr/include/c++/4.3/cwchar:157: error: ‘::getwchar’ has not been declared
/usr/include/c++/4.3/cwchar:162: error: ‘::putwc’ has not been declared
/usr/include/c++/4.3/cwchar:163: error: ‘::putwchar’ has not been declared
/usr/include/c++/4.3/cwchar:169: error: ‘::vfwscanf’ has not been declared
/usr/include/c++/4.3/cwchar:173: error: ‘::vswscanf’ has not been declared
/usr/include/c++/4.3/cwchar:177: error: ‘::vwscanf’ has not been declared
In file included from /usr/include/c++/4.3/bits/char_traits.h:48,
                 from /usr/include/c++/4.3/ios:46,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/include/c++/4.3/cstdio:171: error: ‘::vfscanf’ has not been declared
/usr/include/c++/4.3/cstdio:172: error: ‘::vscanf’ has not been declared
/usr/include/c++/4.3/cstdio:174: error: ‘::vsscanf’ has not been declared
/usr/include/c++/4.3/cstdio:182: error: ‘__gnu_cxx::vfscanf’ has not been declared
/usr/include/c++/4.3/cstdio:183: error: ‘__gnu_cxx::vscanf’ has not been declared
/usr/include/c++/4.3/cstdio:185: error: ‘__gnu_cxx::vsscanf’ has not been declared
In file included from /usr/include/c++/4.3/bits/localefwd.h:47,
                 from /usr/include/c++/4.3/ios:47,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:57: error: ‘uselocale’ was not declared in this scope
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:57: error: invalid type in declaration before ‘;’ token
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:64: error: ‘__locale_t’ does not name a type
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:71: error: expected ‘,’ or ‘...’ before ‘&’ token
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h: In function ‘int std::__convert_from_v(int)’:
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:77: error: expected `;' before ‘__old’
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:91: error: ‘__fmt’ was not declared in this scope
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:94: error: ‘__out’ was not declared in this scope
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:94: error: ‘__size’ was not declared in this scope
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:102: error: ‘__old’ was not declared in this scope
/usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:102: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
In file included from /usr/lib/gcc/i486-linux-gnu/4.3.3/include/unistd.h:9,
                 from /usr/include/c++/4.3/i486-linux-gnu/bits/gthr-default.h:44,
                 from /usr/include/c++/4.3/i486-linux-gnu/bits/gthr.h:132,
                 from /usr/include/c++/4.3/ext/atomicity.h:39,
                 from /usr/include/c++/4.3/bits/ios_base.h:46,
                 from /usr/include/c++/4.3/ios:48,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/process.h: At global scope:
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/process.h:79: error: ‘_pid_t’ has not been declared
/usr/lib/gcc/i486-linux-gnu/4.3.3/include/process.h:81: error: ‘_pid_t’ does not name a type
In file included from /usr/include/c++/4.3/bits/ios_base.h:48,
                 from /usr/include/c++/4.3/ios:48,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/include/c++/4.3/bits/locale_classes.h:349: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.3/bits/locale_classes.h:380: error: ‘__c_locale’ has not been declared
/usr/include/c++/4.3/bits/locale_classes.h:381: error: ‘__c_locale’ has not been declared
/usr/include/c++/4.3/bits/locale_classes.h:383: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.3/bits/locale_classes.h:387: error: ‘__c_locale’ has not been declared
/usr/include/c++/4.3/bits/locale_classes.h:391: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.3/bits/locale_classes.h:622: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.3/bits/locale_classes.h:650: error: expected `)' before ‘__cloc’
/usr/include/c++/4.3/bits/locale_classes.h: In constructor ‘std::collate<_CharT>::collate(size_t)’:
/usr/include/c++/4.3/bits/locale_classes.h:637: error: class ‘std::collate<_CharT>’ does not have any field named ‘_M_c_locale_collate’
/usr/include/c++/4.3/bits/locale_classes.h:637: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.3/bits/locale_classes.h:637: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/include/c++/4.3/bits/locale_classes.h: In destructor ‘virtual std::collate<_CharT>::~collate()’:
/usr/include/c++/4.3/bits/locale_classes.h:714: error: ‘_M_c_locale_collate’ was not declared in this scope
In file included from /usr/include/c++/4.3/bits/locale_facets.h:46,
                 from /usr/include/c++/4.3/bits/basic_ios.h:44,
                 from /usr/include/c++/4.3/ios:50,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/include/c++/4.3/cwctype: At global scope:
/usr/include/c++/4.3/cwctype:90: error: ‘::iswblank’ has not been declared
In file included from /usr/include/c++/4.3/bits/locale_facets.h:48,
                 from /usr/include/c++/4.3/bits/basic_ios.h:44,
                 from /usr/include/c++/4.3/ios:50,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from book.C:1:
/usr/include/c++/4.3/i486-linux-gnu/bits/ctype_base.h:53: error: ‘_ISupper’ was not declared in this scope
Как думаете, что это?

P.S. debian squeeze, gcc 4.3.3-2
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
02.04.2009, 21:41
Ответы с готовыми решениями:

Работа с файлами в C# с исп. библиотек #include <stdio.h> #include <stdlib.h> #include <math.h> #include <io.h>
В типизированном файле записаны названия городов и их численность. Увеличить численность каждого...

GCC Сборка 32 разрядной версии GCC 64 разрядным GCC
Доброго времени суток. Возникла необходимость под 32х разрядный Linux, собрать 32 разрядный GCC. Но...

Чем отличается #include <cstring>, #include <string> и #include <string.h>?
Доброго времени суток :) Пишу свой класс и мне для нужны функции для работы со строками. Когда...

10
 Аватар для Mecid
684 / 233 / 16
Регистрация: 15.10.2007
Сообщений: 1,246
02.04.2009, 22:06
чтобы компилить с++ код юзай g++

Добавлено через 31 секунду
и расширение сделай cpp
0
 Аватар для GreatCornholio
0 / 0 / 0
Регистрация: 02.04.2009
Сообщений: 6
03.04.2009, 06:41  [ТС]
чтобы компилить с++ код юзай g++
и расширение сделай cpp
g++ выдаёт то же самое
0
 Аватар для Mecid
684 / 233 / 16
Регистрация: 15.10.2007
Сообщений: 1,246
03.04.2009, 07:00
скомпилил твой код все норм,ты расширение поменял???без него много ошибок
0
 Аватар для GreatCornholio
0 / 0 / 0
Регистрация: 02.04.2009
Сообщений: 6
03.04.2009, 14:38  [ТС]
Цитата Сообщение от Mecid Посмотреть сообщение
,ты расширение поменял?
Да.

Видно, что проблема не в коде, а в компиляторе
0
 Аватар для Бартимеус
181 / 33 / 7
Регистрация: 29.10.2008
Сообщений: 283
03.04.2009, 14:47
скачай GCC
0
 Аватар для GreatCornholio
0 / 0 / 0
Регистрация: 02.04.2009
Сообщений: 6
03.04.2009, 14:54  [ТС]
#aptitude purge gcc, полная чистка /usr/include/c++/4.3/, #aptitude install gcc не помогли
0
 Аватар для Бартимеус
181 / 33 / 7
Регистрация: 29.10.2008
Сообщений: 283
03.04.2009, 15:48
я про компилятор)
0
 Аватар для GreatCornholio
0 / 0 / 0
Регистрация: 02.04.2009
Сообщений: 6
03.04.2009, 16:00  [ТС]
а gcc - разве не компилятор?) Gnu C Compiler.
0
 Аватар для Kalashnikov
15 / 15 / 3
Регистрация: 08.02.2009
Сообщений: 63
05.04.2009, 02:32
gcc - для С
g++ - для С++
0
 Аватар для GreatCornholio
0 / 0 / 0
Регистрация: 02.04.2009
Сообщений: 6
05.04.2009, 08:57  [ТС]
Я снёс систему, теперь всё нормально
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
05.04.2009, 08:57
Помогаю со студенческими работами здесь

#include<iostream>// подключение библиотек #include <conio.h> #include <climits>
помогите для этой программы сделать блок-схему. Пожалуйста #include&lt;iostream&gt;// подключение...

Не робит код в Code Blocks, куча ошибок, что не так?
include &lt;iostream&gt;; #include &lt;string&gt;; using namespace std; struct str { int num; string...

gcc: No include path in which to find stdio.h
Все привет! Столкнулся с проблемой. Установил MinGW c подписи niXman mingw-4.6.2+boost-1.48.0....

Include string or not include..?
Доброго времени суток! Готовился к егэ, разбирал ответ к заданию...написан он достаточно коряво,...

Не находит #include<iomanip.h> #include<conio.h>
Само задание: Услуги телефонной сети оплачиваются по следующему правилу: за разговоры до A минут в...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
11
Ответ Создать тему
Новые блоги и статьи
Мысли в слух. Про "навсегда".
kumehtar 16.04.2026
Подумалось тут, что наверное очень глупо использовать во всяких своих установках понятие "навсегда". Это очень сильное понятие, и я только начинаю понимать край его смысла, не смотря на то что давно. . .
My Business CRM
MaGz GoLd 16.04.2026
Всем привет, недавно возникла потребность создать CRM, для личных нужд. Собственно программа предоставляет из себя базу данных клиентов, в которой можно фиксировать звонки, стадии сделки, а также. . .
Знаешь почему 90% людей редко бывают счастливыми?
kumehtar 14.04.2026
Потому что они ждут. Ждут выходных, ждут отпуска, ждут удачного момента. . . а удачный момент так и не приходит.
Фиксация колонок в отчете СКД
Maks 14.04.2026
Фиксация колонок в СКД отчета типа Таблица. Задача: зафиксировать три левых колонки в отчете. Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка) / / . . .
Настройки VS Code
Loafer 13.04.2026
{ "cmake. configureOnOpen": false, "diffEditor. ignoreTrimWhitespace": true, "editor. guides. bracketPairs": "active", "extensions. ignoreRecommendations": true, . . .
Оптимизация кода на разграничение прав доступа к элементам формы
Maks 13.04.2026
Алгоритм из решения ниже реализован на нетиповом документе, разработанного в конфигурации КА2. Задачи, как таковой, поставлено не было, проделанное ниже исключительно моя инициатива. Было так:. . .
Контроль заполнения и очистка дат в зависимости от значения перечислений
Maks 12.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "ПланированиеПерсонала", разработанного в конфигурации КА2. Задача: реализовать контроль корректности заполнения дат назначения. . .
Архитектура слоя интернета для сервера-слоя.
Hrethgir 11.04.2026
В продолжение https:/ / www. cyberforum. ru/ blogs/ 223907/ 10860. html Знаешь что я подумал? Раз мы все источники пишем в голове ветки, то ничего не мешает добавить в голову такой источник, который сам. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru