I am working with twisted and...well these two methods keep coming up in Eclipse as undefined. Cannot find any reference to this.
I tried ##UndefinedVariable (which solved the reactor.run() issue I had but it does not work in this case.
Running Eclipse Kepler on Mac Yosemite with twisted-15.2.1 zope.interface-4.1.2.
Python data structures can change at runtime, so Eclipse can only guess what methods are available. In the case of twisted.internet.reactor, it is a singleton whose type may change depending on how things are initialized, so it appears to Eclipse as a blank module.
Since PyDev for Eclipse does not provide a way for libraries to tell it that it's wrong about what methods it has detected, if your Python code does not match the subset of Python it can guess correctly about, then you get spurious errors like this. Sorry! If PyDev ever adds a way to override its built-in guessing logic, we will distribute something that says what methods twisted.internet.reactor likely provides. Please file a bug against PyDev for this.
Related
I am confused as to how is one supposed to debug STL containers in eclipse. The Variables window just shows the container internal variables, not the collection of objects, that I am storing in it. From there, I can only expand m_start pointer to see the first element. And that's it.
Currently, I am solving this problem by accessing gdb directly from the console: p myvect[0]#10 will print the first 10 elements of a vector.
There is this article, urging students in some university to download some python script. My issues with the article are 1) My Eclipse Luna lacks the exact menus they explain about 2) this sentence: "According to its official documentations, there exists a unresolved bug and you should revise it by yourself in the source file."
I heard Visul Studio presents something called "Raw view".
To me, it sounds quite simple and very important to have built-in STL container debugging capabilities for Eclipse CDT. Do they exist? If no, why were they not implemented?
You don't mention your platform.
On "recent" (at least the last couple of years, probably longer) Linux distros, everything is set up to "just work". Of course there's a lot of machinery backing this, and all the bits must be in place:
Your gdb must be Python-enabled
The pretty-printers for libstdc++ must be installed in a way that causes them to automatically activate when debugging
Your Eclipse must tell gdb that it understands pretty-printing
As I said, in a recent environment all of this works. You can try it out by hand using gdb in the terminal and printing some STL data structure; even just a string will do. If you get incomprehensible goo, then something isn't set up properly.
If you aren't on a Linux distro you can try to set this stuff up by hand. It's a bit more involved to do so, but there are some instructions on the gdb wiki that are reasonable enough.
I migrated a project from Qt4 to Qt5, and it compiles and everything but the application crashes before it even reaches the main function. I know there is a null value that fucks up something at some point, maybe a file that cant find or something, but there are so many .cpps and .h and libraries that its pretty hard to locate the source of the error plus I cant set any breakpoints. I have a lot of debugging data so maybe any of you can guide me in the right direction. I dont know what I would be doing without stack overflow honestly, so thankyou in advance.
When debugging I get different crashes:
The stack in each case shows different crashes, but all of them have something in common, which is this __do_global_ctors thingy, I have researched and apparently it has to do with constructors, but I have no idea what I should be looking for.
if I missed any info please do ask. I hope someone can enlighten me, I am so so close to get this working.
The __do_global_ctors() is called before your main(), as the framework needs to instantiate all of the global objects that main() might use.
This method will call the constructors for all static objects, and their component objects. I.e. all static constructors.
From the look of the stack trace, it appears that the segfault occurs during the construction of a QGlobalStatic<QMutex, [incomlpete types - see trace for details]> object, which makes sense. This is being constructed by qRegisterResourceData as part of qInitResources_mimetypes.
Try placing a breakpoint in this function in qrc_mimetypes.cpp (if you have the source) and see where that gets you. Or look at the Qt documentation for mimetypes initialisation and make sure you've specified your application's resources correctly.
I managed to solve the issue by thoughtfully re-compiling all the libraries to Qt5 and making sure all the cpps that the program refered were Qt5 too. Also double-checked the linkings. I thought I had done it but apparently I missed one library.
Mind that some libraries need to be migrated and there are others that you can download and compile directly with Qt5. If you are having this same problem make sure that there are no Qt5 versions of that library before migrating them yourself.
I usually develop using emacs in a linux environment (ubuntu) because I love the editor. I've been also using eclipse from time to time but I find it slow.
Since I want IDE-like features, I tried to setup cedet and it seems to be sort of doing the work.
I find that cedet never finds base class members. For example, std::vector in gcc has std::vector::size in its base class and it cannot find it.
Seems inaccurate: If I do something like "myvector." it will give me completions like size_type.
Cannot use auto from c++11, it seems not to work.
srecode-getset gives me errors even for basic usage.
My configuration does not give any error and is based in alexott cedet config.
My questions are:
The completion is that inaccurate still? (Think of "vector." giving things like "size_type".
What is the status of cedet for c++/c++11? Should auto be working? I'm doing anything wrong?
I tried to use both bundled ubuntu version and last version from bzr repository. CEDET seems an extremely useful tool, but I wonder if it needs more work.
Thanks in advance.
Instead of relying on CEDET for completion, you might want to consider an alternative completion provider in Emacs.
Auto-complete-clang and auto-complete-clang-async both work with clang to get completions and with the auto-complete package to display them. Company-clang is similar, but uses the company package to display completions.
There is another minor mode for C, C++, and ObjC called irony that uses clang to get completions and can use multiple front-ends to display completions. This might have the best documentation for getting it set up.
All of these are available on Marmalade for use with the package manager in Emacs 24.
I know that this may be a less-than-sufficient answer (and I'd prefer to mention this in the comments but I'm shy on points), but there is an Eclipse plugin for emacs functionality called emacs+. This link should be friendly to your Eclipse install manager (on Indigo I can copy and paste it into Help->Install New Software->Work With). Because Eclipse was otherwise attractive to you and therefore this can indirectly alleviate your problem...
size_type is actually a member type of vector, so that's not as crazy as it sounds. Of course, the syntax is myvector::size_type, not with a period.
Previosly i used turboc++, but recently shifted to codeblocks and sometimes i also use notepad (i compile code using gcc via command promt, though possible in codeblocks). Now previously, in turbo c++ i used ctrl+F1 to get help for particular function or keywords or headerfiles etc, by keeping the cursor line on the keywords, the help is regarding the description of what the function does, whatever etc. Now in gcc(or in code::blocks) i want to know is it possible to get the help for, lets say for a perticular keyword, using some commands in gcc under command prompt?
(not sure, but i heard it is possible in clang).
What you're looking for is an IDE.
There are many, many choices. I'd strong recommend looking at Eclipse CDT:
http://www.eclipse.org/cdt/
http://www.ibm.com/developerworks/library/os-eclipse-stlcdt/
PS:
The "C:B" referred to above is "Code Blocks". That might also be a good choice for you - check it out, too:
http://www.codeblocks.org/
This is basically a duplicate of:
Netbeans or Eclipse for C++?
But, that question as 3+ years old, and a lot has changed since then.
I have a large code base with a custom (but Makefile based) build system. The areas I am specifically wondering about include:
Syntax highlighting
Code navigation.
Code hints.
"ReSharper style" code helpers.
Documentation integration.
Debugger UI and features.
Has anyone had the chance to evaluate both Netbeans and Eclipse?
EDIT: As a followup question, are any of the Netbeans users here concerned with its future given Oracle's recent bad history with "open" efforts? (Open Solaris, MySQL, Open Office)
Thank you
I cannot comment on eclipse, but on netbeans 7 I will say things that are very important for me and that work fine so far:
code completion, go to declarations
pkg-config automatic include management for parsing
stuff that sometimes works and sometimes don't
find usages, sometimes it might fail to find usages in other open projects
debugger sometimes gets confused with unittest-cpp macros and it will not go on the appropiate line
stuff that are not yet working and i care deeply:
C++0x syntax highlighting (auto, lambdas, enum class, variadic templates, none of them are recognized by the built-in parser)
stuff that is not quite working but i could not care less:
git integration. I enjoy using git from command-line so this is a non-issue
in all, the IDE is very usable. I hope to have a chance to try out latest cdt on Indigo Eclipse, but so far i haven't that much of a real reason to investigate
I cannot comment on Netbeans, but I can offer you information on Eclipse. I work with C++ on UNIX systems, and I have started to use Eclipse when exploring large code bases that I know little about. I don't use it to build, but it would be easy to integrate our build system with it as one only needs commands.
Eclipse has most of what you are looking for: (I'm speaking of Eclipse/CDT)
Not only can you completely customize your syntax highlighting, you can also have it format the code with templates. My company has a code standard for spacing, tabs and formatting of functions and conditional code, and with little effort I was able to modify an existing template to meet our code standards.
The navigation is not bad, if you highlight and hover over a variable, it shows you the definition in a small pop-up bubble. If you do the same for a type, it will you show you where the type is defined. For functions, it will show the first few lines of the implementation of the function, with an option to expand it and see the whole function. I find all of these nice for code discovery and navigation. You can also highlight a variable, and use a right-click menu option to jump to its declaration.
I suppose by code hints you are referring to something like intellisense? This is the main reason why I use Eclipse when looking over a large code base. Just hit the '.' or '->' and a second later you get your options.
The debugger UI is quite capable. You can launch gdb within the tool and it allows you to graphically move through your code just as you would in a tool like ddd or Visual C++. It offers standard features like viewing registers, memory, watching variables, etc.
That being said, I have found some weaknesses. The first is that it doesn't really strongly support revision control systems outside of CVS and SVN very easily (integrated into the GUI). I found a plug-in for the system we use at my company, but it spews XML and Unicode garbage. It was easier to just use the revision control on the command line. I suspect this is the plug-in's issue and not Eclipse. I wish there were better tool integration though.
The second complaint is that for each project I have to manually setup the include directories and library paths. Perhaps with an environment variable this could be circumvented? Or I may just do not know how to set things up correctly. Then again if it is not obvious to a developer how to do this, I consider that a weakness of the tool.
All in all I like working with Eclipse. It is not my main editing environment, but I appreciate it for working on large code bases.
I'm a huge fan of Netbeans. I am in a similar situation to yours, but creating the project was very easy. Just point Netbeans at where the code is checked out and it figures out most things for itself. I rarely have to do any configuration. One thing to note though, if your tree is very large, it can take some time to fully index - and while it does, memory and cpu will be hosed on the box.
The integration with cvs is awesome, and the Hudson integration is very cool for CB. I've not used Git myself, though I should imagine it's a no-brainer.
One thing that does irritate me no end is that it does not behave very well with code relying heavily on templates. i.e. shows lots of warnings and errors about types not being found etc.
I have not used the latest version of Eclipse, I tried the major release before the current one and gave up because it did not have the same smooth project integration with the makefiles etc. I find it's not as nice if you don't want to use it's make system - though I could be wrong.
I don't use any of the code formatting provided, I instead prefer something like AStyle instead. I know that NetBeans does a good job with Java - but have not used it for C++. CDT I seem to remember doing some odd stuff with indentation when formatting C++ code - esp. if templates are involved - but that was atleast two years ago.
Hope some of it helps - the best way to do this is to download and try for yourself and see what works for you. Anything we tell you is purely subjective.
I used to work with Netbeans with MinGW, I Just tried 7.0.1.
I currently use Eclipse Indigo with CDT and MinGW - It's better performance wise (less CPU & Memory).
Netbeans creates a makefile to compile all the time,
In Eclipse you can build directly with the CDT-Toolchain or use Makefile - Eclipse is more flexible.
Debugging: Netbeans might be better in Solaris/Linux.
I Personally rather eclipse over Netbeans, I think eclipse is more professional.
One particular issue that causes me quite a lot of grief with Netbeans 7.0 is that it tends to want to work with utf8 files, and not all of out c++ projects are utf8. It will issue a warning about opening such a file, and if you do open it, will corrupt said file, which is a pain.
I've not found out how to properly make netbeans handle this. Apparently the encoding can be changed, but for the entire project. So presumably changing it to us-acii would stop this problem, although non ascii characters wouldn't display properly.