zoukankan      html  css  js  c++  java
  • fcgi、fastcgi 交叉编译出现的错误总结

     关键词:

    (1)fcgi

    (2)mips、openwrt

    (3)mv : cannot stat `libfcgi_la-fcgiapp.o': No such file or directory

    (4)`alocal symbol' can not be used when making a shared object;

    (5)recompile with -fPIC 

    (6)'EOF' was not declared in this scope

    (7)undefined reference to `frexp' 

    正文:

    1、执行configure,生成Makefile

    ./configure --build=i686-pc-linux-gnu(i486-gnu-linux) --host=mips-openwrt-linux(mipsel-linux) --prefix=$PWD/install(安装的目录) CC=gcc编译器的路径 CXX=g++编译器的路径  CFLAGS="-g -O2 -Wall -fPIC"  CXXFLAGS="-g -O2 -Wall -fPIC" #绿色的在mips下可以不加(openwrt需要加)


    2、make 

    (交叉编译工具链路径请根据情况指定)

    3、make install,安装路径在编译路径的install目录下面

    4.(1)遇到的问题:mv : cannot stat `libfcgi_la-fcgiapp.o': No such file or directory

    (2)原因分析:意思是没有这个文件,原因是libtool里面执行这个文件之前,没有先生成这个文件。

    (3)解决办法:修改libtool文件,找到867行(不同版本可能行数会有点不同),在then后面添加一行,make $output_obj

     

    5.

    (1)遇到的问题:

    relocation R_MIPS_26 against`a local symbol' can not be used when making a shared object;

    recompile with -fPIC

    libfcgi_la-fcgiapp.lo:could not read symbols: Bad value

    (2)原因分析:编译器提示需要添加 -fPIC 选项。但是在configure的时候添加比较方便。

    (3)解决办法:configure的时候添加CFLAGS和CXXFLAGS选项.

    ./configure --build=i686-pc-linux-gnu --host=mips-openwrt-linux --prefix=$PWD/install   CFLAGS="-g -O2 -Wall -fPIC" CXXFLAGS="-g -O2 -Wall -fPIC"

     

    6.

    (1)遇到的问题: fcgio.cpp error: 'EOF' was not declared in this scope 

    (2)原因分析:编译器版本有关

    (3)解决办法:在报错文件的最开始加上 #include<stdio.h>

     

    7.

    (1)遇到的问题:undefined reference to `frexp' 

    (2)原因分析:无法找到数学库(math)

    (3)解决办法:先make clean,然后修改 libfcgi目录下的Makefile,-LIBS那一行增加 -lm 参数

  • 相关阅读:
    HDU 1010 Tempter of the Bone(DFS剪枝)
    HDU 1013 Digital Roots(九余数定理)
    HDU 2680 Choose the best route(反向建图最短路)
    HDU 1596 find the safest road(最短路)
    HDU 2072 单词数
    HDU 3790 最短路径问题 (dijkstra)
    HDU 1018 Big Number
    HDU 1042 N!
    NYOJ 117 求逆序数 (树状数组)
    20.QT文本文件读写
  • 原文地址:https://www.cnblogs.com/LxwEmbedded/p/4180275.html
Copyright © 2011-2022 走看看