Официальный сайт студ.городка НГТУ
Программирование и БД » странное поведение компилятора 

#1  22.09.11 15:23

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

суть:
создаю в вижуале 10 обчный проект win32 console.
подключаю библиотеку "mathx.h" и провожу некоторые действия с объектами описанными в этой библиотеке. компилирую все отлично.

далее необходимо обернуть программу в оболочку.
создаю проект MFC dialog based.
так же подключаю эту библиотеку и провожу те же самые действия.
компилирую и..... выдается куча ошибок внутри этой библиотеки.

если важно, все фалы в библиотеке с расширением .h

что такое??

Исправлено Flinn (22.09.11 15:26)

Offline

#2  22.09.11 15:37

Re: странное поведение компилятора

Flinn, каких ошибок?

Offline

#3  22.09.11 15:43

Re: странное поведение компилятора

1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(242): error C2062: type 'char' unexpected
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\uint_mathx.h(63) : see reference to function template instantiation 't &mathx_mul_t<uint_t<hi_lo>>(t *,const t &)' being compiled
1>          with
1>          [
1>              t=uint_t<mathx_u256>,
1>              hi_lo=mathx_u256
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\uint_mathx.h(63) : while compiling class template member function 'uint_t<hi_lo> &uint_t<hi_lo>::operator *=(const uint_t<hi_lo> &)'
1>          with
1>          [
1>              hi_lo=mathx_u256
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\int_shared_mathx.h(152) : see reference to class template instantiation 'uint_t<hi_lo>' being compiled
1>          with
1>          [
1>              hi_lo=mathx_u256
1>          ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(251): warning C4091: '' : ignored on left of 'char' when no variable is declared
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(251): error C2143: syntax error : missing ';' before '*='
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(251): error C2143: syntax error : missing ';' before '*='
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(255): error C2062: type 'char' unexpected
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(255): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(255): error C2062: type 'char' unexpected
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(255): error C2513: 'char' : no variable declared before '='
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(261): error C2062: type 'char' unexpected
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(261): error C2143: syntax error : missing ';' before ')'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(261): error C2143: syntax error : missing ';' before ')'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(262): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(263): error C2143: syntax error : missing ')' before '.'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(263): error C2059: syntax error : '.'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(263): error C2059: syntax error : ')'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(264): warning C4091: '' : ignored on left of 'char' when no variable is declared
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(264): error C2143: syntax error : missing ';' before '>>='
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\common_mathx.h(264): error C2143: syntax error : missing ';' before '>>='

Offline

#4  22.09.11 15:51

Re: странное поведение компилятора

Flinn, хз.Сложно так сказать. Надо бы проект посмотреть.

Offline

#5  22.09.11 16:07

Re: странное поведение компилятора

в win32 project тоже нормально только что попробовал. но win32 project пользоваться не умею.

Offline

#6  22.09.11 16:34

Re: странное поведение компилятора

во, что обнаружил. если закоментить все функции которые преобразуют числа в строки string то компилится

Offline

#7  22.09.11 21:38

Re: странное поведение компилятора

ммм... навскидку могу сказать, что проблема с переводом из строк типа Unicode в ANSI

Offline

#8  22.09.11 21:43

Re: странное поведение компилятора

проблема решена. было следующее:
внутри библиотеки задефайнены переменные, но как то криво и получалось пересечение
решение: включать библиотеку перед "stdafx.h" и отключить предкомпилирование заголовков

Offline

Программирование и БД » странное поведение компилятора 

ФутЕр:)

© Hostel Web Group, 2002-2025.   Сообщить об ошибке

Сгенерировано за 0.039 сек.
Выполнено 11 запросов.