我将 CEDET 配置为为 MinGW gcc 自动完成,它工作得很好,但是我无法让 g++ 工作来完成 STL 库的成员。例如,我无法自动完成 std::string 变量以获取 c_str() 或其他函数:
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
string s;
s. // no pop up member functions here
return 0;
}
这是我的 .emacs 的配置部分:
;; setting up for semantic-mode
(semantic-mode 1)
(require 'semantic/bovine/c)
(setq MinGW-64-base-dir
"D:/MinGW/x86_64-w64-mingw32/include")
(add-to-list 'semantic-lex-c-preprocessor-symbol-file
(concat MinGW-64-base-dir "/crtdefs.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file
(concat MinGW-64-base-dir "/yvals.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file
(concat MinGW-64-base-dir "/vadefs.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file
(concat MinGW-64-base-dir "/comdefsp.h"))
(semantic-c-reset-preprocessor-symbol-map)
(defconst user-include-dirs
(list ".." "../include" "../inc" "../common" "../public"
"../.." "../../include" "../../inc" "../../common" "../../public"))
(defconst win32-include-dirs
(list "D:/MinGW/include"
"D:/MinGW/x86_64-w64-mingw32/include"
"D:/MinGW/lib/gcc/x86_64-w64-mingw32/4.7.2/include"
"D:/MinGW/lib/gcc/x86_64-w64-mingw32/4.7.2/include/c++"
"D:/MinGW/lib/gcc/x86_64-w64-mingw32/4.7.2/include-fixed"
))
(let ((include-dirs user-include-dirs))
(when (eq system-type 'windows-nt)
(setq include-dirs (append include-dirs win32-include-dirs)))
(mapc (lambda (dir)
(semantic-add-system-include dir 'c++-mode)
(semantic-add-system-include dir 'c-mode))
include-dirs))
我的配置有问题吗?需要对 MinGW g++ 进行正确配置。