Here is the version of cedet I am using
CEDET Version: 1.0
Requested File Loaded
Package Version Version Version
----------------------------------------------------------
cedet: 1.0 nil ok
eieio: 1.3 nil ok
semantic: 2.0 nil ok
srecode: 1.0 nil Not Loaded
ede: 1.0 nil ok
speedbar: 1.0 nil ok
emacs version 23.3.1
When I run "M-x semantic-ia-fast-jump", I got the error:
Wrong type argument: stringp, (((0) "ptrdiff_t"))
Anybody knows why? It's definitely not because the data type of the variable is "ptrdiff_t".
for version 23.x it still better to use version from BZR as it incorporates more fixes for C++, plus many other improvements... Details on installation & customization you can find in this article.
Related
Good old disconnect between what the compiler deems valid and what the IDE thinks... Before you introduce duplicate questions / answers, I must stress that everything available on the issue here and elsewhere I have already tried and distilled to this setup:
install latest eclipse CDT - Oxygen 4.7.2 / build id 20171218-0600
gcc 6.1 only compiler visible in system path - defaults to c++14 standard without the need for explicit -std flag
Checking the log for compiler settings discovery, it's configured correctly for C++14:
03:51:39 **** Running scanner discovery: CDT GCC Built-in Compiler Settings MinGW ****
g++ -E -P -v -dD C:/dev/eclipse-oxy-cpp/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-6.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw610/x86_64-610-posix-seh-rt_v5/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes --disable-isl-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw610/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw610/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw610/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw610/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw610/x86_64-610-posix-seh-rt_v5/mingw64/opt/include -I/c/mingw610/prerequisites/x86_64-zlib-static/include -I/c/mingw610/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw610/x86_64-610-posix-seh-rt_v5/mingw64/opt/include -I/c/mingw610/prerequisites/x86_64-zlib-static/include -I/c/mingw610/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw610/x86_64-610-posix-seh-rt_v5/mingw64/opt/lib -L/c/mingw610/prerequisites/x86_64-zlib-static/lib -L/c/mingw610/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 6.1.0 (x86_64-posix-seh, Built by MinGW-W64 project)
COLLECT_GCC_OPTIONS='-E' '-P' '-v' '-dD' '-shared-libgcc' '-mtune=core2' '-march=nocona'
C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/6.1.0/cc1plus.exe -E -quiet -v -P -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/ -D_REENTRANT C:/dev/eclipse-oxy-cpp/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C -mtune=core2 -march=nocona -dD
#define __STDC__ 1
#define __cplusplus 201402L
(etc)
The following snippet compiles (with unused variable warning but nonetheless), but eclipse highlights issues with resolving test in int main:
auto test (auto N) {return N;}
int main () {
auto z = test( 3U );
return 0;
}
The parser log gives:
Unresolved names:
Attempt to use symbol failed: test in file ...
The IDE shows this in problems:
Invalid arguments '
Candidates are:
? test(?)
'
For all intents and purposes eclipse is in fact seeing the correct gcc binary, and is using the correct c++ standard, but still not conforming to the compiler per evidence above (unless I missed something?).
Any ideas how to make eclipse behave with syntax parsing given it's already got the right c++ standard version?
I get the feeling it's an issue with the indexer rather than the parser, since it has no trouble figuring out the number of arguments or the declaration but can't seem to make sense of functions with auto return type that depends on an auto-typed argument.
UPDATE
It may be related to this bug (looks to be fixed) and this followup bug (still ongoing, test case given is similar to mine).
However, this version of test does not give me problems, so I'm unsure if it's the same bug or something else...
template< typename T > auto test (T N) {return N;}
auto in the parameter type of a function (as opposed to a lambda) is not standard C++14.
It's supported by the Concepts TS (which is supported by GCC >= 6 with the -fconcepts flag), and accepted by GCC >= 4.9 even without -fconcepts as an extension, but it's not standard. (It may become standard in C++20, along with some other parts of the Concepts TS.)
For example, here's what Clang (which does not support this extension) says about your code in C++14 mode:
test.cpp:1:12: error: 'auto' not allowed in function prototype
auto test (auto N) {return N;}
^~~~
Eclipse CDT does not currently implement this extension either. I filed bug 532085 to track adding support for it; contributions are welcome!
I wanted to try and see how good Ensime's type checking capabilities were, and while they seemed to work fine at first, it appears it keeps referencing bits of code that no longer exist: (larger version here)
It says it couldn't find the value asdfadsfasdf which was correct, back when I wrote it as random garbage to test the type checker; however it's not there anymore and Ensime keeps complaining about it, rather than spotting the missing : and wrong type name in the when function.
Add to that the fact that despite it having access to the Ensime server, it still won't run autocomplete..
Specs:
Emacs version: 24.3.1
Sbt version: 0.13.5
System: Mac OS X version 10.9.5 "Mavericks"
Excerpt from .emacs that relates to Ensime and Scala:
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
What do I do to get it working correctly?
I have setup my Emacs(v 23.3) with CEDET 1.1 using info found in http://cedet.sourceforge.net/ and the article by Alex Ott (http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html)
I've got most of the kinks worked out to my linking with respect to my init.el file.
Now for the problem. I build TAGS myself, so there is a TAGS file in the root of my project.
However semantic doesn't seem to want to use that file and barfs with the following errors:
Source file `/users/lshvarts/.emacs.d/cedet-1.1/semantic/ctags/semantic-ectag-util.el' newer than byte-compiled file
Exuberent CTags not found. Found ctags that comes with Emacs
semantic-ectag-test-version: Exuberent CTags not found. Use M-x semantic-ectag-version RET
Exuberent CTags not found. Use M-x semantic-ectag-version RET
Exuberent CTags not found. Found ctags that comes with Emacs
Etags that I have might not be the newest version, but I am puzzled why it plainly refuses to work with it.
boxy:92> etags --version
etags (GNU Emacs 20.7)
Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold
This program is distributed under the same terms as Emacs
boxy:93>
Any help/insight is appreciated.
you need not the etags, but Exuberent CTags! You can install it from your linux/mac repository (usually it has name ectags, or exuberant-ctags on Debian), or from it's site.
This is not exactly related to the problem you had, but I got the same error (Exuberent CTags not found. Use M-x semantic-ectag-version RET) after upgrading to ubuntu 12.04.
The problem was that ctags-exuberant --version returned a non numerical version:
Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Nov 9 2011, 17:40:39
Addresses: <dhiebert#users.sourceforge.net>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex
Just replace regex
"Exuberant Ctags \\([0-9.]+\\),"
by
"Exuberant Ctags \\([0-9.]+\\)[~,]"
in semantic-ectag-version (in semantic-ectag-util.el) and recompile the file.
I've been trying to get the CEDET working with a simple project for the last little while. I have the following project file:
(ede-cpp-root-project "aesalon-project"
:name "aesalon-name"
:file "~/projects/aesalon/SConstruct"
:include-path '("/"
"/include/"))
I've been loading the above into a buffer and executing the buffer contents. The problem is not with the project not loading correctly -- it seems to bet set up properly; I can change the settings etc. using the menubar. When I try to rescan the project's files, however, I get the following error:
Debugger entered--Lisp error: (wrong-type-argument class-p ede-cpp-root)
signal(wrong-type-argument (class-p ede-cpp-root))
child-of-class-p(ede-cpp-root-project ede-cpp-root)
object-of-class-p([object ede-cpp-root-project "aesalon-project" nil "aesalon-name" "1.0" "/home/ethereal/projects/aesalon/" 3546321 "/home/ethereal/projects/aesalon/SConstruct" nil nil nil unbound unbound "" "" "" "" "" "" ("debug" "release") "debug" nil ("/" "/include/") nil nil nil "\\.\\(h\\(h\\|xx\\|pp\\|\\+\\+\\)?\\|H\\)$\\|\\<\\w+$" nil] ede-cpp-root)
ede-toplevel-project("~/projects/aesalon/")
ede-rescan-toplevel()
call-interactively(ede-rescan-toplevel nil nil)
I find this somewhat odd, as when I look at the documentation for ede-cpp-root-project I see that it has ede-project as its parent, not ede-cpp-root? Or am I misunderstanding the trace? I'm not very familiar with Emacs Lisp.
Here's my output from cedet-version:
CEDET Version: 1.0
Requested File Loaded
Package Version Version Version
----------------------------------------------------------
cedet: 1.0 ok ok
eieio: 1.3 ok ok
semantic: 2.0 ok ok
srecode: 1.0 ok ok
ede: 1.0 ok ok
speedbar: 1.0.3 ok ok
cogre: 1.0 ok Not Loaded
cedet-contrib: 1.0 ok Not Loaded
C-h f cedet-version RET
for details on output format.
And my emacs version: (latest from Arch Linux repositories)
GNU Emacs 23.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.9) of 2012-02-01 on shirley.hoetzel.info
Does anyone have any suggestions on how I could go about fixing this issue? Is it a problem with my project? My CEDET environment? Version of emacs?
Apparently the problem is inconsistencies in EDE and CEDET. As best I can tell, the version of the CEDET that I was using was relying on an old architecture of EDE that has since been changed.
Compiling the CEDET from the latest source tree instead of the (older) snapshot I was using fixed the problem.
I'm trying to compile CEDET from CVS for Emacs 23.1.50 on Windows and I've got error on "Step 6: Turning on EDE...": "defvar: Symbol's value as variable is void: cedet-menu-map". Compilation of CEDET 1.0pre6 raises the same error.
CEDET has been integrated into Emacs after 23 was released. As such, you don't need to compile CEDET for your Emacs, you just need to turn it on. In such a version of Emacs, the only difference from the install instructions from CEDET is that you don't need to load cedet.el, and you do need to turn on (semantic-mode 1) to do what cedet.el used to do.