2016-06-14 45 views
0

我有一些問題,從源代碼編譯彎曲。該配置正在通過 CC=/home/mybin/bin/gcc CPPFLAGS=-I/home/mybin/include LDFLAGS=-L/home/mybin/libLinux的柔性GCC編譯失敗,`未定義參考`TclReError'`

在../include我有運行配置,當包含引用

regex.h:110:#define regerror TclReError 
regcustom.h:78:#define regerror TclReError 

兩個文件,產生並沒有什麼的在日誌興趣沒有錯誤,但是,應引發錯誤

 /bin/sh ../libtool --tag=CC --mode=link /home/mybin/bin/gcc -g -O2 -L/home/mybin/lib -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o ../lib/libcompat.la -lm 
libtool: link: /home/mybin/bin/gcc -g -O2 -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o -L/home/_bin/lib ../lib/.libs/libcompat.a -lm 
regex.o: In function `flex_regcomp': 
/home/tmp/flex-2.6.0/src/regex.c:66: undefined reference to `TclReError' 
collect2: error: ld returned 1 exit status 
make[2]: *** [flex] Error 1 

在configure --help中沒有提及顯式標誌

Some influential environment variables: 

    CC   C compiler command 
    CFLAGS  C compiler flags 
    LDFLAGS  linker flags, e.g. -L<lib dir> if you have libraries in a 
       nonstandard directory <lib dir> 
    LIBS  libraries to pass to the linker, e.g. -l<library> 
    CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if 
       you have headers in a nonstandard directory <include dir> 
    LT_SYS_LIBRARY_PATH 
       User-defined run-time library search path. 
    CPP   C preprocessor 
    YACC  The `Yet Another Compiler Compiler' implementation to use. 
       Defaults to the first program found out of: `bison -y', `byacc', 
       `yacc'. 
    YFLAGS  The list of arguments that will be passed by default to $YACC. 
       This script will default YFLAGS to the empty string to avoid a 
       default value of `-d' given by some make applications. 
    CXX   C++ compiler command 
    CXXFLAGS C++ compiler flags 
    CXXCPP  C++ preprocessor 

我也有試圖直接與export CPPFLAGS="-I/home/mybin/include"

擴展搜索對SO和谷歌已經返回指出顯而易見的,任何指點我缺少什麼出口?

+1

擺脫雙引號的,並給它一個鏡頭:'出口CPPFLAGS = -I/home/mybin/include' – LPs

+0

嘗試了引用和未引用,同樣的錯誤。也嘗試在調用make之前在bash腳本中明確設置。沒有運氣 –

+0

你用'CFLAGS'而不是'CPPFLAGS'來試試嗎? – LPs

回答

2

你將它們設置爲一個環境變量;配置決定LDFLAGSCPPFLAGS通過檢查配置文件和環境。你可以嘗試這樣。

export CPPFLAGS='-I/home/mybin/include' 
    export LDFLAGS='-L/home/mybin/lib' 
    ./configure 

或作爲一個班輪:

env CPPFLAGS='-I/home/mybin/include' LDFLAGS='-L/home/mybin/lib' ./configure 

請試試這個...

+0

有趣的是,我嘗試了它作爲一個班輪,而不是一個bash腳本,並得到了一個稍微不同的輸出'regex.c :(。text + 0xfd):未定義引用'TclReError'' –

相關問題