****************************************************************************************************************************************************
C/C++:
mac下
打开终端:输入:$ gcc- v
Using built-in specs.
得到类似的:
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~108/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~108/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
很容易就看到你当前使用的版本了。
启动Eclipse.进入:Windows-->Preferences-->C/C++找到Environment。增加两个变量:
CPLUS_INCLUDE_PATH: /usr/include/c++/4.2.1(我的gcc版本)
C_INCLUDE_PATH: /usr/include
C/C++的代码提示只在.和->下触发,虽然没有Java下这么强大,不过也够了。因为这里是代码提示最容易发挥威力的地方。
===========================================================================================
补充:
alt+/ 也能提示
不知道 Ctrl+Space 在mac 下怎么操作,因这这个组合键默认是被搜索功能占用了,commanc+space 被切换输入法占用了,不过alt+/ 能用也不错了 ;
先编译下,编译后编辑代码就有提示
,如图,自己写了个结构体,编译后就能提示变量。