编译期间,碰到的两个大问题,是环境变量设置问题.

先列出执行脚本是碰到的两个问题,后面给出解决方法并记录执行的命令步骤.

问题1: 编译binutils 2.5出错

------------------------------
错误信息:
make[4]: 正在进入目录 `/home/shakin/work/build_for_windows/pkgs/binutils/build/i686-w64-mingw32/gas'
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT app.o -MD -MP -MF .deps/app.Tpo -c -o app.o ../../../source/binutils-2.24/gas/app.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT as.o -MD -MP -MF .deps/as.Tpo -c -o as.o ../../../source/binutils-2.24/gas/as.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT atof-generic.o -MD -MP -MF .deps/atof-generic.Tpo -c -o atof-generic.o ../../../source/binutils-2.24/gas/atof-generic.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT compress-debug.o -MD -MP -MF .deps/compress-debug.Tpo -c -o compress-debug.o ../../../source/binutils-2.24/gas/compress-debug.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT cond.o -MD -MP -MF .deps/cond.Tpo -c -o cond.o ../../../source/binutils-2.24/gas/cond.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT depend.o -MD -MP -MF .deps/depend.Tpo -c -o depend.o ../../../source/binutils-2.24/gas/depend.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT dwarf2dbg.o -MD -MP -MF .deps/dwarf2dbg.Tpo -c -o dwarf2dbg.o ../../../source/binutils-2.24/gas/dwarf2dbg.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT dw2gencfi.o -MD -MP -MF .deps/dw2gencfi.Tpo -c -o dw2gencfi.o ../../../source/binutils-2.24/gas/dw2gencfi.c
mv -f .deps/compress-debug.Tpo .deps/compress-debug.Po
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT ecoff.o -MD -MP -MF .deps/ecoff.Tpo -c -o ecoff.o ../../../source/binutils-2.24/gas/ecoff.c
../../../source/binutils-2.24/gas/as.c: In function ‘print_version_id’:
../../../source/binutils-2.24/gas/as.c:224:14: error: ‘TARGET_ALIAS’ undeclared (first use in this function)
VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
^
../../../source/binutils-2.24/gas/as.c:224:14: note: each undeclared identifier is reported only once for each function it appears in
../../../source/binutils-2.24/gas/as.c: In function ‘parse_args’:
../../../source/binutils-2.24/gas/as.c:635:5: error: ‘TARGET_ALIAS’ undeclared (first use in this function)
TARGET_ALIAS);
^
../../../source/binutils-2.24/gas/as.c:649:44: error: ‘TARGET_CANONICAL’ undeclared (first use in this function)
fprintf (stderr, _("canonical = %s\n"), TARGET_CANONICAL);
^
../../../source/binutils-2.24/gas/as.c:650:43: error: ‘TARGET_CPU’ undeclared (first use in this function)
fprintf (stderr, _("cpu-type = %s\n"), TARGET_CPU);
^
make[4]: *** [as.o] 错误 1

-------------------------------

问题2: 编译gcc 4.9.1 出错

------------------------------
错误信息

perl ../../source/gcc-4.9.1/gcc/../contrib/texi2pod.pl ../../source/gcc-4.9.1/gcc/doc/include/gpl_v3.texi > gpl.pod
echo "@set BUGURL @uref{http://gcc.gnu.org/bugs.html}" >> gcc-vers.texiT; \
mv -f gcc-vers.texiT gcc-vers.texi
echo timestamp > s-mlib
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/build -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include \
-o build/genhooks.o ../../source/gcc-4.9.1/gcc/genhooks.c
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/build -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include \
-o build/genchecksum.o ../../source/gcc-4.9.1/gcc/genchecksum.c
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/build -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include \
-o build/genenums.o ../../source/gcc-4.9.1/gcc/genenums.c
In file included from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:0:
../../source/gcc-4.9.1/gcc/system.h:506:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
extern const char *strsignal (int);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
/usr/include/string.h:564:14: error: previous declaration ‘char* strsignal(int)’ here
extern char *strsignal (int __sig) __THROW;
^
g++ -c -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/lib/gcc/\" -DSTANDARD_LIBEXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/libexec/gcc/\" -DDEFAULT_TARGET_VERSION=\"4.9.1\" -DDEFAULT_TARGET_MACHINE=\"i686-w64-mingw32\" -DSTANDARD_BINDIR_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DCONFIGURE_SPECS="\"\"" -DTARGET_MACHINE=\"i686-w64-mingw32\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DPERSONALITY=\"nm\" -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/. -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/gmp/gmp-6.0.0a-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpfr/mpfr-3.1.2-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpc/mpc-1.0.2-x86_64/include -I../../source/gcc-4.9.1/gcc/../libdecnumber -I../../source/gcc-4.9.1/gcc/../libdecnumber/bid -I../libdecnumber -I../../source/gcc-4.9.1/gcc/../libbacktrace -DCLOOG_INT_GMP -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/cloog/cloog-0.18.1-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/isl/isl-0.12.2-x86_64/include -o gcc-nm.o -MT gcc-nm.o -MMD -MP -MF ./.deps/gcc-nm.TPo gcc-nm.c
g++ -c -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/lib/gcc/\" -DSTANDARD_LIBEXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/libexec/gcc/\" -DDEFAULT_TARGET_VERSION=\"4.9.1\" -DDEFAULT_TARGET_MACHINE=\"i686-w64-mingw32\" -DSTANDARD_BINDIR_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DCONFIGURE_SPECS="\"\"" -DTARGET_MACHINE=\"i686-w64-mingw32\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DPERSONALITY=\"ranlib\" -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/. -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/gmp/gmp-6.0.0a-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpfr/mpfr-3.1.2-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpc/mpc-1.0.2-x86_64/include -I../../source/gcc-4.9.1/gcc/../libdecnumber -I../../source/gcc-4.9.1/gcc/../libdecnumber/bid -I../libdecnumber -I../../source/gcc-4.9.1/gcc/../libbacktrace -DCLOOG_INT_GMP -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/cloog/cloog-0.18.1-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/isl/isl-0.12.2-x86_64/include -o gcc-ranlib.o -MT gcc-ranlib.o -MMD -MP -MF ./.deps/gcc-ranlib.TPo gcc-ranlib.c
In file included from ../../source/gcc-4.9.1/gcc/../include/hashtab.h:40:0,
from ../../source/gcc-4.9.1/gcc/../include/filenames.h:29,
from ../../source/gcc-4.9.1/gcc/system.h:630,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
../../source/gcc-4.9.1/gcc/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
^
../../source/gcc-4.9.1/gcc/../include/libiberty.h:110:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
/usr/include/string.h:601:26: error: ambiguates old declaration ‘const char* basename(const char*)’
extern "C++" const char *basename (const char *__filename)
^
In file included from ../../source/gcc-4.9.1/gcc/system.h:1064:0,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int clz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:244:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int ctz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:258:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int floor_log2(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:295:10: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT - 1 - clz_hwi (x);
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long int sext_hwi(long int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:328:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long unsigned int zext_hwi(long unsigned int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:342:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
../../source/gcc-4.9.1/gcc/gcc-ar.c: In function ‘int main(int, char**)’:
../../source/gcc-4.9.1/gcc/gcc-ar.c:139:39: error: ‘LTOPLUGINSONAME’ was not declared in this scope
plugin = find_a_file (&target_path, LTOPLUGINSONAME, R_OK);
^
In file included from ../../source/gcc-4.9.1/gcc/errors.c:29:0:
../../source/gcc-4.9.1/gcc/system.h:506:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
extern const char *strsignal (int);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
/usr/include/string.h:564:14: error: previous declaration ‘char* strsignal(int)’ here
extern char *strsignal (int __sig) __THROW;
^
../../source/gcc-4.9.1/gcc/gcc-ar.c:189:35: error: call of overloaded ‘strsignal(int&)’ is ambiguous
exe_name, sig, strsignal (sig),
^
../../source/gcc-4.9.1/gcc/gcc-ar.c:189:35: note: candidates are:
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
/usr/include/string.h:564:14: note: char* strsignal(int)
extern char *strsignal (int __sig) __THROW;
^
In file included from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:0:
../../source/gcc-4.9.1/gcc/system.h:506:20: note: const char* strsignal(int)
extern const char *strsignal (int);
^
make[1]: *** [gcc-ar.o] 错误 1
make[1]: *** 正在等待未完成的任务....
In file included from ../../source/gcc-4.9.1/gcc/../include/hashtab.h:40:0,
from ../../source/gcc-4.9.1/gcc/../include/filenames.h:29,
from ../../source/gcc-4.9.1/gcc/system.h:630,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
../../source/gcc-4.9.1/gcc/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
^
../../source/gcc-4.9.1/gcc/../include/libiberty.h:110:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
/usr/include/string.h:601:26: error: ambiguates old declaration ‘const char* basename(const char*)’
extern "C++" const char *basename (const char *__filename)
^
In file included from ../../source/gcc-4.9.1/gcc/system.h:1064:0,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int clz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:244:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int ctz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:258:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int floor_log2(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:295:10: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT - 1 - clz_hwi (x);
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long int sext_hwi(long int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:328:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long unsigned int zext_hwi(long unsigned int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:342:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
make[1]: *** [errors.o] 错误 1
../../source/gcc-4.9.1/gcc/genhooks.c: In function ‘void emit_documentation(const char*)’:
../../source/gcc-4.9.1/gcc/genhooks.c:140:31: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf (f, "%999s", buf);
^
../../source/gcc-4.9.1/gcc/genhooks.c:131:3: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
while (fscanf (f, "%*[^@]"), buf[0] = '\0',
^
../../source/gcc-4.9.1/gcc/genhooks.c:193:34: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf (f, "%5[^ \n]", buf);
^
../../source/gcc-4.9.1/gcc/genhooks.c:199:31: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf (f, "%999s", buf);
^
/bin/bash ../../source/gcc-4.9.1/gcc/../move-if-change tmp-optionlist optionlist
echo timestamp > s-options
make[1]:正在离开目录 `/home/shakin/work/build_ffmpeg_for_windows/pkgs/gcc/build/gcc'
make: *** [all-gcc] 错误 2
-------------------------------

碰到上面两个问题,请尝试一下以下方法,个人亲试:

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE
如果在/etc/profile 或者 ~/.bashrc中设置了ccache的话,也暂时去掉ccache的设置.

【编译32bit】 注意 一些路径要换成自己本机的路径

准备工作:

脚本获取:wget http://zeranoe.com/scripts/mingw_w64_build/mingw-w64-build-3.6.4 ,然后修改权限

ubuntu14.04情况下,执行:sudo apt-get install pax cvs flex bison texinfo

执行:bash ./mingw-w64-build-3.6.4 --build-type=multi --default-configure --disable-shared --enable-gendef

(1)ln -s "/usr/bin/pkg-config" /home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/bin/i686-w64-mingw32-pkg-config
 (2)编译 x264
./configure --enable-static --enable-win32thread --host=i686-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --cross-prefix=i686-w64-mingw32-
 (3)编译libfdk_aac
./configure --host=i686-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --enable-static --disable-shared

其他的外插件略,需要安装的官网也有详细步骤.

(4)编译ffmpeg
./configure --disable-static --enable-shared --enable-version3 --enable-gpl --enable-nonfree --disable-pthreads --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-libfdk-aac --enable-libx264 --enable-zlib --enable-cross-compile --target-os=mingw32 --arch=x86 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules/ffmpeg --cross-prefix=i686-w64-mingw32- --extra-cflags="-I/home/shakin/work/build_ffmpeg_for_windows/dist/modules/include" --extra-ldflags="-L/home/shakin/work/build_ffmpeg_for_windows/dist/modules/lib"

编译的 exe和 dll文件,就在/home/shakin/work/build_ffmpeg_for_windows/dist/modules/ffmpeg 路径下,另外,编译成64位版时,libx264,libfdk_aac等也要相应的变成64bit,

编译 x264
./configure --enable-static --enable-win32thread --host=x86_64-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --cross-prefix=x86_64-w64-mingw32-
 编译libfdk_aac
./configure --host=x86_64-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --enable-static --disable-shared

编译ffmpeg

./configure --disable-static --enable-shared --enable-version3 --enable-gpl --enable-nonfree --disable-pthreads --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-libfdk-aac --enable-libx264 --enable-zlib --enable-cross-compile --target-os=mingw32 --arch=x86 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules/ffmpeg --cross-prefix=x86_64-w64-mingw32- --extra-cflags="-I/home/shakin/work/build_ffmpeg_for_windows/dist/modules/include" --extra-ldflags="-L/home/shakin/work/build_ffmpeg_for_windows/dist/modules/lib"

使用zeranoe的自动化脚本mingw-w64-build-3.6.4在ubutun14.04_64bit上交叉编译ffmpeg 2.5的更多相关文章

  1. appium1.4+华为8.0执行自动化脚本,报启动session失败,原因是unicode_ime_apk\Uni codeIME-debug.apk在手机上已存在,再次安装失败,导致启动session失败,解决办法:换高版本的appium

    最开始做Android自动化测试时,通过执行脚本发现报,已安装UnicodeIME-debug.apk,再次安装失败,当时觉得这个apk对我来说没用,就把D:\Program Files (x86)\ ...

  2. 安卓8.0真机运行appium1.4遇到的问题:运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装?

    运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装? 这3个apk的目录分别是: D:\P ...

  3. java+selenium自动化脚本编写

    实训项目:创盟后台管理,页面自动化脚本编写 使用工具:java+selenium 1)java+selenium环境搭建文档 2)创盟项目后台管理系统链接 java+selenium环境搭建 一.Se ...

  4. 自动化脚本中click()或sendKeys()没有反应

    前提: 排除xpath引用错误或元素的xpath每次都不同的情形. 问题描述 自动化脚本中click()方法和sendKeys()方法报错, 返回异常InvocationTargetException ...

  5. appium-desktop录制脚本二次开发,生成我司自动化脚本

    目的 通过对appium-desktop脚本录制功能进行二次开发,使录制的java脚本符合我司自动化框架要求. 实现步骤 1.增加元素名称的输入框 由于ATK(我司自动化测试框架)脚本中元素是以“ap ...

  6. Jenkins构建自动化脚本执行无界面解决方法

    场景: jenkins构建selenium自动化用例的时候,会有jenkins自带服务后台运行自动化脚本,可无界面运行IE.Chrome.Firefox. 然而运行IE浏览器时候(IE比较特殊),Je ...

  7. 【Zabbix】Zabbix-agent自动化脚本

    zabbix-agent自动化脚本 作用:批量部署zabbix-agent.用于上百台虚拟机都可以被Zabbix监控. 脚本名:inst-agent.sh #!/bin/bash echo " ...

  8. PHP学习日记 Windows配置PHP+Nginx+自动化脚本

    Windows配置PHP+Nginx+自动化脚本 安装与配置 PHP 下载PHP:传送门 选择合适的版本下载 尽量选Thread Safe 配置PHP: 解压后在文件夹中找到php.ini-devel ...

  9. python_selenium之第一个自动化脚本

    python_selenium之第一个自动化脚本 上一节介绍了xpath的使用,接下来完成第一个自动化脚本 一.步骤: 1. 这里使用火狐浏览器,首先打开火狐浏览器 2. 使浏览器窗口最大化 3.输入 ...

随机推荐

  1. ASP.NET开发学习视频教程大全(共800集)

    ASP.NET是微软.NET平台的支柱之一,被广泛应用在WEB等互联网开发领域,因此它的强大性和适应性,可以使它运行在Web应用软件开发者的几乎全部的平台上.这里整理了最全的ASP.NET开发学习视频 ...

  2. Winform中子线程访问界面控件时被阻塞解决方案

    public partial class WebData_Import : Form { //声明用于访问主界面的委托类型 public delegate void deleGetOrderdata( ...

  3. Telnet运用and Sqlserver connection failed

    今天的工作中,需要远程访问服务器上的数据库.但是,连接错误,Error code is 1326.说句实话,关于SqlServer 不能远程访问这个问题,我遇到过N次.可是每次都不认真去研究到底是什么 ...

  4. 实战 Spring MVC接入支付宝即时到账 (部分代码)

    下面就拿我项目中的部分代码来实践一下. 支付请求 首先,是提交表单 fund.jsp(这里我表单只需要用户填交易金额,其他的订单号之类的全部后台生成) <form id="deposi ...

  5. UVA 11426 GCD - Extreme (II) (欧拉函数)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Problem JGCD Extreme (II)Input: Standard ...

  6. session问题和JSP

    session问题和JSP 07. 五 / J2EE / 没有评论   一.Session开发中遇到的问题1.内存中的Session非常多,怎么办?2.用户在购物中.服务器停掉了该web应用(或者重新 ...

  7. java版-JQuery上传插件Uploadify使用实例

    摘自:http://itindex.net/detail/47160-java-jquery-%E4%B8%8A%E4%BC%A0 运行效果: 包结构图: 后台JAVA逻辑: package com. ...

  8. 表单提交---前端页面模拟表单提交(form)

    有些时候我们的前端页面总没有<form></form>表单,但是具体的业务时,我们又必须用表单提交才能达到我们想要的结果,LZ最近做了一些关于导出的一些功能,需要调用浏览器默认 ...

  9. js倒计时 重发 效果

    <script type="text/javascript"> window.onload = function() { var wait = 60; function ...

  10. 居然因为交换错了好几把。。。。,还有坑点是num1可以大于num2

    完数 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...