Tk / Tcl扩展:编译BLT时出错

时间:2016-11-22 13:52:14

标签: tcl tk

我在OS X 10.10.5下编译BLT,而在make之后我./configure,这里发生了一些错误:

FDSM_lhn@Nirvana:~/Downloads/blt2.4z$ sudo make -I/opt/X11/include
Password:
(cd src; /Applications/Xcode.app/Contents/Developer/usr/bin/make all)
gcc -c -Wall -O6   -I. -I.  bltAlloc.c
warning: optimization level '-O6' is not supported; using '-O3' instead
In file included from bltAlloc.c:1:
In file included from ./bltInt.h:80:
./bltNsUtil.h:50:20: error: conflicting types for 'Tcl_FindCommand'
EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp *interp,
                   ^
/usr/local/include/tclDecls.h:1486:20: note: previous declaration is here
EXTERN Tcl_Command      Tcl_FindCommand(Tcl_Interp *interp, const char *name,
                        ^
In file included from bltAlloc.c:1:
In file included from ./bltInt.h:80:
./bltNsUtil.h:67:23: error: conflicting types for 'Tcl_CreateNamespace'
EXTERN Tcl_Namespace *Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
                      ^
/usr/local/include/tclDecls.h:1460:24: note: previous declaration is here
EXTERN Tcl_Namespace *  Tcl_CreateNamespace(Tcl_Interp *interp,
                        ^
In file included from bltAlloc.c:1:
In file included from ./bltInt.h:80:
./bltNsUtil.h:72:23: error: conflicting types for 'Tcl_FindNamespace'
EXTERN Tcl_Namespace *Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp *interp,
                      ^
/usr/local/include/tclDecls.h:1482:24: note: previous declaration is here
EXTERN Tcl_Namespace *  Tcl_FindNamespace(Tcl_Interp *interp,
                        ^
In file included from bltAlloc.c:1:
In file included from ./bltInt.h:80:
./bltNsUtil.h:75:12: error: conflicting types for 'Tcl_Export'
EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr,
           ^
/usr/local/include/tclDecls.h:1469:13: note: previous declaration is here
EXTERN int              Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
                        ^
1 warning and 4 errors generated.
make[1]: *** [bltAlloc.o] Error 1
make: *** [all] Error 2

我应该怎么做才能避免这种情况?

1 个答案:

答案 0 :(得分:0)

您正在使用老年代码库,因此需要进行一些手术。唉。

由于Tcl现在正确地声明它们,因此需要删除bltNsUtil.h中的四个违规声明; Tcl_FindCommandTcl_CreateNamespaceTcl_FindNamespaceTcl_Export是Tcl公共API的一部分,并且已存在多年。 (问题声明在第50,67,72和75行,在每种情况下可能还有一两行。)

此外,建议您在进行构建时不要使用sudo,而是在之后进行安装时使用module.exports.bootstrap = function(cb) { // handle connect socket first event executes after logged in sails.io.on('connect', function (socket){ // store facebook token here }); // handle custom listener for other stuff sails.io.on('doSomeStuff', function (socket){ // check facebook token match with requested token }); cb(); }; 。仅仅编译代码不应该需要提升权限。