`
gushengchang
  • 浏览: 28495 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

gcc编译问题

    博客分类:
  • gcc
c++ 
阅读更多
[hadoop@hs15 soap2.21]$ make
gcc  -c -msse3 -O3 -funroll-loops -maccumulate-outgoing-args -fomit-frame-pointer  -DMAKE_TIME=\""`date`"\" -DPTHREADS BWT.c -o BWT.o
BWT.c:537: error: shift must be an immediate
BWT.c:424: error: shift must be an immediate
BWT.c:425: error: shift must be an immediate
make: *** [BWT.o] Error 1


出现这个问题是GCC版本的问题,当前机器的版本为:
[hadoop@hs15 soap2.21]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)


把代码放到高版本GCC的机器上编译就通过了。
[hadoop@hs12 b]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-mpfr=/builddir/build/BUILD/gcc-4.4.0-20090514/obj-x86_64-redhat-linux6E/mpfr-install/ --with-ppl=/builddir/build/BUILD/gcc-4.4.0-20090514/obj-x86_64-redhat-linux6E/ppl-install --with-cloog=/builddir/build/BUILD/gcc-4.4.0-20090514/obj-x86_64-redhat-linux6E/cloog-install --with-tune=generic --with-arch_32=i586 --build=x86_64-redhat-linux6E
Thread model: posix
gcc version 4.4.0 20090514 (Red Hat 4.4.0-6) (GCC) 


分享到:
评论
2 楼 gushengchang 2012-01-05  
你试试看编译成静态的 -static
1 楼 bu33122 2012-01-05  
但有一个问题是,在高版本的GCC下编译能通过,但在低版本的机器上运行时是不能运行的,由于Glibc版本的问题,这个问题你是怎么解决的?

相关推荐

Global site tag (gtag.js) - Google Analytics