bitmap_image nie chce się skompilować
Ostatnio zmodyfikowano 2014-01-09 20:40
Katruf Temat założony przez niniejszego użytkownika |
bitmap_image nie chce się skompilować » 2014-01-09 19:11:05 witam, kiedyś mi polecono bibliotekę bitmap_image.hpp do obsługi pików z bitmapami, pobrałem ją (https://code.google.com/p/bitmap/source/browse/trunk/bitmap_test.cpp?spec=svn30&r=30) zapisałem i dołączyłem do projektu, ale kompilator sypie błędami, wydaje mi się że kod czegoś takiego jest dobry, bo przecież to jest dość popularne :P
warning C4003: not enough actual parameters for macro 'max' warning C4003: not enough actual parameters for macro 'max' warning C4003: not enough actual parameters for macro 'max' error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::' error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::' error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::'
co może być przyczyną tych błędów? |
|
SeaMonster131 |
» 2014-01-09 19:32:29 Podaj kod. |
|
Monika90 |
» 2014-01-09 19:41:33 Używasz <windows.h>? W takim raazie zdefiniuj makro NOMINMAX (dla całego projektu najlepiej) |
|
Katruf Temat założony przez niniejszego użytkownika |
» 2014-01-09 19:42:12 kod jest pod tym linkiem :P a błąd dotyczy tego fragmentu (a przynajmniej tak pokazuje) inline unsigned int offset( const color_plane color ) { switch( channel_mode_ ) { case rgb_mode: { switch( color ) { case red_plane: return 0; case green_plane: return 1; case blue_plane: return 2; default: return std::numeric_limits < unsigned int >::max(); } } case bgr_mode: { switch( color ) { case red_plane: return 2; case green_plane: return 1; case blue_plane: return 0; default: return std::numeric_limits < unsigned int >::max(); } } default: return std::numeric_limits < unsigned int >::max(); } }
Edit: NOMINMAX pomogło ale teraz jest kolejny błąd :( tym razem w bibliotece "xutility" (to jest jakaś wbudowana) błąd to: error C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' 1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2157) : see declaration of 'std::_Copy_impl' 1> e:\projekty\obrazek\obrazek\bitmap_image.hpp(98) : see reference to function template instantiation '_OutIt std::copy<unsigned char*,unsigned char*>(_InIt,_InIt,_OutIt)' being compiled 1> with 1> [
1> _OutIt=unsigned char *, 1> _InIt=unsigned char * 1> ] pokazuje na ten kod: template < class _InIt, class _OutIt > inline _OutIt copy( _InIt _First, _InIt _Last, _OutIt _Dest ) { if( _First == _Last ) return( _Dest ); else { _DEBUG_RANGE( _First, _Last ); _DEBUG_POINTER( _Dest ); return( _Copy_impl( _Unchecked( _First ), _Unchecked( _Last ), _Dest, _Is_checked( _Dest ) ) ); } }
|
|
Monika90 |
» 2014-01-09 19:58:18 Ale to jest warning a nie error, poza tym w komunikacie jest napisane jak go wyłączyć. |
|
Katruf Temat założony przez niniejszego użytkownika |
» 2014-01-09 20:40:52 faktycznie pomogło :) dziękuję :) |
|
« 1 » |