LINUX.ORG.RU

C++ проблема с компилятором/include-ами


0

0

Решил заново и осноательно выучить C++. Первый же код Липпмана:
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.cpp, что $g++ book.cpp выдал огромную кучу строк ошибок инклудов. Вот небольшая часть из них:
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.cpp: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,

Ну, следовательно, WTF, товарищи?

g++ -o test test.cpp

gcc v4.3.3

Все работает.

P1XeL
()
Ответ на: комментарий от P1XeL

>Стоят ли пакеты libstdc++, libc (development)
Стоят
>g++ -o test test.cpp

>gcc v4.3.3

>Все работает.


тот же gcc. Не работает

GreatCornholio
() автор топика

> Ну, следовательно, WTF, товарищи?

Запусти LiveCD/DVD с современным дистром, где бы стоял GCC (на DVD обычно уже стоят, на CD - просто по сети доставь его); затем собери пример; затем подумай, что у тебя не так с дистром (или инсталляцией GCC), и подумай, как ты можешь это исправить.

Spectr ★★★
()
Ответ на: комментарий от Spectr

у меня есть ощущение, что придётся прибегнуть к самому неприятном и виндовому методу - сносу системы. У меня с pango проблемы, решение которым никто подсказть не может, так ещё и с gcc...

стоит debian squeeze, ставить ленни и обновляться... :-!

GreatCornholio
() автор топика
Ответ на: комментарий от GreatCornholio

Я снёс систему. Можете бить, только не ногами. Я честно трахался с неделю с gcc и 2 месяца с панго/пиджином. Теперь всё работает.

GreatCornholio
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.