Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't understand myoptdir variable #2

Closed
csfreebird opened this issue Jun 23, 2011 · 4 comments
Closed

Don't understand myoptdir variable #2

csfreebird opened this issue Jun 23, 2011 · 4 comments

Comments

@csfreebird
Copy link

Hello,
I read the article from here:
http://felipetonello.com/blog/2011/06/07/awesome-c-cpp-auto-completion-in-emacs/
And jumped to your site.
https://github.com/brianjcj/auto-complete-clang#readme

I tried your configuration on github.com,but got the following error message:
Warning (initialization): An error occurred while loading `/home/chenshu/.emacs':
Symbol's value as variable is void: myoptdir

I don't know what myoptdir variable is for?

@brianjcj
Copy link
Owner

It is defined in my own .emacs, It is only used in here:

(add-to-list 'load-path (concat myoptdir "AC"))
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories (concat myoptdir "AC/ac-dict"))

You can just replace it with the dir string where your AutoComplete plugin installed.
e.g., if your install AC in dir /home/chenshu/foo/bar/AC, then you can change it to:

(add-to-list 'load-path "/home/chenshu/foo/bar/AC")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "/home/chenshu/foo/bar/AC/ac-dict")

@csfreebird
Copy link
Author

Thanks.I changed it,it worked,no error. But I can't see the correct member functions listed by auto-complete-clang.
I set my header like so:
(defun my-ac-config ()
(setq ac-clang-flags (split-string "-I/usr/include/c++/4.5")) //only add this line
(setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))

my test c++ application only has one main.cpp file.
#include
using namespace std;

int main()
{
printf("Hello World2 from Main!\n");
string str;
str.
return 0;
}

The string class(basic_string)'s member functions are not listed,but some global functions are listed,e.g.
_Tp const& min(_Tp const &__a, _Tp const &__b)

Any idea?

@csfreebird
Copy link
Author

sudo ln -s /usr/include/c++/4.5/uname -m-linux-gnu/bits/* /usr/include/c++/4.5/bits
I found the above command from your article.Thanks,it works.

@brianjcj
Copy link
Owner

Good!

On Fri, Jun 24, 2011 at 1:49 PM, csfreebird <
reply@reply.github.com>wrote:

sudo ln -s /usr/include/c++/4.5/uname -m-linux-gnu/bits/*
/usr/include/c++/4.5/bits
I found the above command from your article.Thanks,it works.

Reply to this email directly or view it on GitHub:

#2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants