how to debug source code from Google code repository - c++

I want to debug the following source code from google code repository,
http://code.google.com/p/rx/
My problem is, I am unable to find a suitable ide which can consider all the sub-folders in the source code as one complete project. I have tried netbeans C++, codeblocks, eclipse C++,etc. The problem with all of them while opening the project is that they consider all the subfolders within the main project as different projects.
Is there any ide which can be used for debugging the source code from google code repository. OR IS THERE ANY WAY OF DEBUGGING THESE PROJECTS?
Operating System: Ubuntu or Windows

You can create a dummy makefile :
all:
g++ code_dir/*/*.?pp -o fake
and then import project using Makefiles. This is possible to do for kdevelop and eclipse (not sure for other IDEs).
Take a note that the above makefile imports all files with a *.?pp template from all directories in the code_dir directory.

You can create a new project with your favorite IDE and then import the sources manually.
You might also consider using a decent editor. Personally, I prefer vim and don't see any appealing reason to use an editor 10 times the size of the actual project.

Related

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.

How to create a C++ project in Eclipse CDT using existing source files and an existing CMakeLists.txt?

The title says it all: I have source files and a CMakeLists.txt for an existing C++ project. Now I want to create a project in Eclipse CDT using those files.
I want to be able to build the project with the "build" button from within Eclipse once I'm done, and I want to be able to use GDB.
I've used the CMake option to create Eclipse projects before, but it didn't always work flawlessly and I was told the CMake generator for Eclipse is supposedly outdated.
I know I could just create an empty project and then copy the source files into it, but what about the CMakeLists.txt? I want Eclipse to know how to build the project.
I'm new to Eclipse and there are like fifty ways to start a new project with or without existing source files, so some guidance would be greatly appreciated.

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.

Eclipse CDT Kepler Importing Makefile project

I would love to import a Makefile project from Eclipse, and have all the different includes path that the compiler uses to create correctly my Eclipse project.
Unfortunately, those path, specified on the command line by a "-I" don't show up in Project Explorer and I have to add them by hand.
I am currently importing the project using the standard "Import project from Makefile" built in Eclipse.
If I'm not wrong there was an autodiscovery option in older versions of Eclipse, but it's not there anymore.
How do you do for having all your include paths set up without too much hassle?
The trick is NOT to use
File->New->Makefile Project with Existing Code
but to use
File->New->C++ Project
and then to select
Makefile project->Empty project.
After you set up such a dummy project, you simply copy your existing source to that project directory, hit F5 (i.e. Refresh) and change the build command to use your Makefile.
I was able to get this to work using Luna. I imported using File->New->C++->Makefile Project with Existing Code.
Prior to launching eclipse, you have to be sure to source any files that set required environment variables.
I did have some build options which were not the standard all and clean, so I had to add those configurations individually.
source files to setup your environment.
Launch Eclipse
Import C++ Makefile project
Setup Build options.
Click the hammer.

More with eclipse cdt

What is done when we import an existing project(maybe a visual studio project)?
Which files are used for configuration?
Try this one, you may get some information.
Migrate Visual Studio C and C++ projects to Eclipse CDT
Eclipse manages files completely differently than Visual Studio, files are managed by Eclipse and placed into the project workspace. Adding existing files has the aggravating effect of copying the files from their location into the workspace. There are workarounds for this (adding a link to existing file, makefile-only projects) but the default is to copy files around.
This is great if your project is managed by Eclipse alone, not great if you want a VS project AND an Eclipse project for the same codebase.
I'm don't think you can import a VS project into Eclipse CDT, at least not the way you're thinking.
The files used for configuration are stored in (path to workspace)/.metadata, there are a LOT of files that change constantly and can contain absolute paths. Caveat emptor.
There is no explicit wizard for importing visual studio project files. What you import is a directory tree full of source code files. Basic information about this is worked out and stored in a file called .project, which contains the settings from Project/properties.
If, when you create or import the project, 'use default location' is specified, the tree is copied into a workspace directory. If not, it is left where it is.
If the project type is 'makefile project', the only real assumption is that there is some external command to be run to build the software. Project properties/C++ build can be used to specify this command - by default, it is 'make'.
DevStudio can export a makefile for one of it's projects - from the Project menu, select 'Export Makefile'. Or you can just write one by hand, or use some other build tool such as ant.
If all else fails, set the build command to 'cat' (e.g. from cygwin) and the build argument to the name of a file that contains the output log from however the software was built.
Eclipse itself has two kinds of projects - those with makefiles, and those that it manages itself.
Makefile projects have a separate make file that you generally write on your own.
Eclipse managed projects have a .project file that is used by the IDE to create make files on the fly, when you build your project.
Are you asking specifically for visual studio projects, or is that just an example?