Refactring in CLion isn't working - c++

I have problem with refactoring, e.g. renaming classes in CLion. CLion shows me the refactoring windows, but doesn't find anything to refactor. Screenshots are appended. I also tried to add header files into CMakeLists, but without success. Do you have any idea what I should do?
Thank you.
Edit: I am using Debian 8.2 x64 with Cinnamon

I just added all .h files into CMakeLists.txt into set(SOURCE_FILES ....) and now its work fine.
Thanks to V-R.

If renaming doesn't work, it could be because your project does not successfully build. Try it with a simplest project, e.g. create a completely new Hello World program. I'm sure if it builds successfully, refactoring will work as well. Worked for me in CLion 1.2.4 on OS X 10.9.4.
Concerning CMakeLists.txt, it is a standard file that is created automatically by CLion if you create a new project. If you have an existing project, you will find CMakeLists.txt if you open the menu View->Tool Windows->Project.
My advice is to experiment by closing your existing project (File->Close Project), creating a New Project and playing around with the CLion features. Here is a nice Quick Start Guide for CLion

Related

How to run makefile projects on clion

If I have a C++ project which uses a makefile to run the code (via the terminal), how can I make a simple to run/debug(!) project in clion? Up to this point I have been using VSCode, but it seems that the Clion interface is much more intuitive (especially coming from pycharm and intellij). But I am having trouble understanding what should I put in the configurations of the project. I am open to changing it to cmake, but I have no idea how to do that too (other than opening a c++ executable new project and copying all contents of my main project).
Really confused here, any help will be appreciated

How can I get "go to definition" working in a JUCE project?

I'm trying to get "go to definition" working for a JUCE project created with Projucer. I've tried both CLion and Visual Studio Code, but they can't seem to find definitions that live in the JUCE libraries.
I'm on Ubuntu. Is there a blessed path for this? I'm normally a vim user, but I'm willing to try any IDE.
I've just figured this out!
In VS Code go View and Command Palette and type C/C++: Edit Configurations (UI) which will take to the IntelliSense Configurations page. Under Include path, on a new line, specify the path to JUCE e.g. ~/JUCE/**.
Note: The two stars are needed to tell VS Code to look through subdirectories.
This will create a hidden folder .vscode in your project folder with this configuration.
You will need to repeat these steps for each project you make.
Definitions and code completion should now work.
To compile your code, in your project folder go Builds then LinuxMakefile and in a terminal run the command make. Finally, go to the builds folder and run your project ./exampleProject.
You need to add the JUCE/modules folder to your search path, not the top-level JUCE/ folder!
If you're using the Projucer, you'll also need to add the JuceLibrarySource/ folder to your search path.
What I ended up doing was using FRUT to convert my project from a Projucer project to a CMake project. CLion was able to understand the CMake project, and thus, the "go to definition" and autocomplete features started working.

Adding files to a Netbeans C++ project

Background
I was working on a C++ project on a Windows machine, building using a makefile, and editing with Notepad++. I then decided to switch to a modern IDE, partly so that I wouldn't have to keep editing the makefile, so I installed Netbeans (first time I have used this IDE). When I created the project, I specified my existing makefile. All is well, and I can edit and build my project.
There were a couple of source files in the directory which were not mentioned in the makefile. However, they do show up in the file list in grey:
Problem
I can't for the life of me figure out how to add those grey files to the build. Do I still have to edit the makefile? Isn't the IDE supposed to manage this kind of thing?
No, Netbeans won't change your custom Makefile. If I were in your shoes, I'd start a new project and add the source files manually, and after that write any custom build steps you might require.

Porting Qt4 to Qt5: unresolved external symbols

Qt5 is the new generation of Qt and it has some changes.
I have a project building well with Qt4. I've downloaded Qt5-VisualStudio2010 package and I'm trying to port my project from Qt4 to Qt5. Problems arise.
All 'include' paths have been fixed well. However, the compiler now reports hundreds of 'unresolved external symbols' (almost all function calls, sounds like the compiler can't find any .lib file). I even tried to add all .lib files found in the Qt SDK folder, but useless. The most basic class and method: QApplication::exec(...) also reported as 'unresolved symbol'.
The project file has been changed to fit Qt5 packaging:
myproject.pro file:
QT += widgets
Anyone have got similar experience with this new release of Qt?
From 'qt_newbie89' (http://qt-project.org/forums/viewthread/23200):
I have “accidentally” solved the problem. I rightclicked on the
project folder in the Project windows and choose qmake. After that,
choose Run and all the errors disappeared. I don’t know why that works
by the way.
From 'ChrisW67' (http://qt-project.org/forums/viewthread/23253/):
The Makefile file did not “become corrupted”: it was exactly as you
left it, full of commands and paths suitable for the previous Qt 4
installation. When Qt Creator ran nmake to build the project nmake did
not automatically re-run qmake to generate the Makefile because the
(untouched) Makefile was newer than the pro file that generated it.
This is normal and correct make behaviour, but it resulted in a
mismatch between your Qt5 in stall and expected Qt4 install.
My saying:
Yeah, that really solves the linking problem! The problem was actually that, when the project was created with Qt4, the 'make' file was also created along with the project nicely. When I removed Qt4, installed Qt5 and imported the old project by Qt5 (with new Qt Creator), possibly the 'make' file became corrupted.
I suspected that you would not be the only one who had this problem. Have you looked at: this yet? It talks about a PERL script in qt/base/bin called: fixqt4headers.pl. This is designed to fix the headers. I noticed another link which might help if that doesn't fix you up, try this, it looks to be fairly well thought out. And, no I haven't tried it. I haven't actually upgraded to Qt 5 yet. CHEERS!
This happened to me as well and I did following.
Additionally linked Qt5Widgetsd.lib
Changed the project property 'Treat Wchar_t as buil in' to true (at C++ -> Language section).

C++ eclipse building error

I'm programming with Galileo on Ubuntu.
My project is compiled through the terminal fine. But for the nice features of eclipse I decided to use eclipse. So I copied and pasted everything inside an eclipse project directory. Then I refreshed the project in the project explorer and everything was found by eclipse. (EDITED) But a red mark (the error mark) is shown on the project icon and when I build the project no binary file is created.
And the last thing is that all the files inside the project have no errors!
what's the problem?
Presumably it is a makefile project. Have you set up the Eclipse IDE to use make with the correct make arguments?
Have you set up the path for the include and lib directories that you need?
Right click on the project in the tree viewer and bring up the preferences dialog and make sure.
There is a console output tab on the Eclipse IDE. What does that say?
There is also a Problems tab that sorts the compiler output. What is on this?
There could well be a problem with building it a a whole project, maybe a link error? More likely it has not been set up properly for eclipse.
Are you using helios? Autotools?