Linux GCC上的C编译问题

前端之家收集整理的这篇文章主要介绍了Linux GCC上的C编译问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
尝试谷歌搜索,但没有运气.

我正在尝试移植一些用于Linux的Windows代码.

然后我收到大量的编译错误.

我所做的只是

#include <emmintrin.h>

然后 :

g++ -c -pipe -march=i686 -mtune=generic -O2 -pipe -D_REENTRANT -w -D__SSE__ -D__SSE2__ -D__MMX__ -I/usr/share/qt/mkspecs/linux-g++ -I. -o .obj/Test.o Test.cpp
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/xmmintrin.h:36:0,from /usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/emmintrin.h:36,from Test.cpp:33:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘void _mm_empty()’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:49:24: error: ‘__builtin_ia32_emms’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_cvtsi32_si64(int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:62:54: error: ‘__builtin_ia32_vec_init_v2si’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘int _mm_cvtsi64_si32(__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:105:53: error: ‘__builtin_ia32_vec_ext_v2si’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_packs_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:144:69: error: ‘__builtin_ia32_packsswb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_packs_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:159:69: error: ‘__builtin_ia32_packssdw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_packs_pu16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:174:69: error: ‘__builtin_ia32_packuswb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_unpackhi_pi8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:188:70: error: ‘__builtin_ia32_punpckhbw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_unpackhi_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:202:70: error: ‘__builtin_ia32_punpckhwd’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_unpackhi_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:216:70: error: ‘__builtin_ia32_punpckhdq’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_unpacklo_pi8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:230:70: error: ‘__builtin_ia32_punpcklbw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_unpacklo_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:244:70: error: ‘__builtin_ia32_punpcklwd’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_unpacklo_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:258:70: error: ‘__builtin_ia32_punpckldq’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_add_pi8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:271:66: error: ‘__builtin_ia32_paddb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_add_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:284:66: error: ‘__builtin_ia32_paddw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_add_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:297:66: error: ‘__builtin_ia32_paddd’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_add_si64(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:311:66: error: ‘__builtin_ia32_paddq’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_adds_pi8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:320:67: error: ‘__builtin_ia32_paddsb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_adds_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:334:67: error: ‘__builtin_ia32_paddsw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_adds_pu8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:348:68: error: ‘__builtin_ia32_paddusb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_adds_pu16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:362:68: error: ‘__builtin_ia32_paddusw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sub_pi8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:375:66: error: ‘__builtin_ia32_psubb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sub_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:388:66: error: ‘__builtin_ia32_psubw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sub_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:401:66: error: ‘__builtin_ia32_psubd’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sub_si64(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:415:66: error: ‘__builtin_ia32_psubq’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_subs_pi8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:424:67: error: ‘__builtin_ia32_psubsb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_subs_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:438:67: error: ‘__builtin_ia32_psubsw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_subs_pu8(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:452:68: error: ‘__builtin_ia32_psubusb’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_subs_pu16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:466:68: error: ‘__builtin_ia32_psubusw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_madd_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:481:68: error: ‘__builtin_ia32_pmaddwd’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_mulhi_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:495:67: error: ‘__builtin_ia32_pmulhw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_mullo_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:509:67: error: ‘__builtin_ia32_pmullw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sll_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:522:68: error: ‘__builtin_ia32_psllw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_slli_pi16(__vector(2) int,int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:534:61: error: ‘__builtin_ia32_psllwi’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sll_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:547:68: error: ‘__builtin_ia32_pslld’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_slli_pi32(__vector(2) int,int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:559:61: error: ‘__builtin_ia32_pslldi’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sll_si64(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:572:68: error: ‘__builtin_ia32_psllq’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_slli_si64(__vector(2) int,int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:584:61: error: ‘__builtin_ia32_psllqi’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sra_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:597:68: error: ‘__builtin_ia32_psraw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_srai_pi16(__vector(2) int,int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:609:61: error: ‘__builtin_ia32_psrawi’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_sra_pi32(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:622:68: error: ‘__builtin_ia32_psrad’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_srai_pi32(__vector(2) int,int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:634:61: error: ‘__builtin_ia32_psradi’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_srl_pi16(__vector(2) int,__vector(2) int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:647:68: error: ‘__builtin_ia32_psrlw’ was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h: In function ‘__vector(2) int _mm_srli_pi16(__vector(2) int,int)’:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/mmintrin.h:659:61: error: ‘__builtin_ia32_psrlwi’ was not declared in this scope

我在这里错过了一些编译器选项吗?或者我需要包含一些其他标题

解决方法

我相信你需要使用-msse来允许SSE指令.
原文链接:https://www.f2er.com/linux/394578.html

猜你在找的Linux相关文章