Do you have to create 2 separate projects for debug and release in kdevelop? - kdevelop

For some reason it asks me if I want a debug or release kind of project when I create it, so I can't just switch between those 2 in one project. Do need to have 2 separate projects for debug and release?

This stems from the way how CMake works (to be precise, how CMake works with Makefile generator): it requires separate build directory for each build type.
I'm not sure what you mean by "having 2 separate projects", but intended way to do this is to select Project -> Open Configuration... menu for your project, go to CMake tab, and then click + button to add another build dir. Then you configure new build dir with the build type you want.

Related

How do I make my Setup project produce an executable?

I've built a small desktop application with which I am trying to use a Setup project to allow other users to install it. But whenever I run this installer, it does not produce an executable file. This is my first time making a setup project.
My solution contains two projects. One is the setup project which installs the primary output from the other project. The other project is a WPF App that consists of two xaml files, a xaml.cs file for each, an App.config file, and an icon. It also has a few dependencies including one Assembly, two Frameworks, and a handful of Packages. The app works exactly as intended whenever I start a Visual Studio debugging instance on either Debug or Release configurations.
I followed these instructions to build my Setup and deploy my app.
Whenever I ran the resulting Setup, it installed an XML configuration file, a JSON file, a main application dll file, and a bunch of dll files for my assemblies. I looked into some resources on how to run the main dll file properly, only (A) I'm completely stumped by everything I find on that topic, and (B) I would rather just produce an executable file anyway, since I intend for this Setup project to be used by other people and it would be inconvenient to ask said others to jump through the same hoops just to run it.
Why does my Setup project not produce a .exe file? I see that a .exe file is produced in my bin folder whenever I build my project (and this .exe works), so I would think the setup project should also produce one of those, but it doesn't. What am I doing wrong with my Setup project or anything else?
The setup.exe is a bootstrapper over the setup.msi. We can install the content using .msi or by running .exe which inturn runs /gets the data from the msi. To enable setup.exe building, go to solution explorer -> project -> properties -> prerequisites. check the check box on the top "Create setup program to install prerequisite components". apply and rebuld the project. A setup.exe bootstrapper will be created allong with msi.
Switch to Release mode, then rebuild your setup project. If everything went well (check the output console), you'll find an MSI file inside {setup project folder}/bin/Release
In "system file" from your proyect installer, you shoud to add in "Application Folder" the next source = PublishItemsOutpuGroup. In my case functions well.

Preprocessor Include Paths, Macros etc. entry not available

I can't navigate through a project in Eclipse (Oxygen.3a Release (4.7.3a) with CDT version 9.4.3.201802261533). The project is built successfully but I can't trace back many functions using ctrl+LMclick.
I tried fixing the problem from online resources, but many suggested modifying the entry of Preprocessor Include Paths, Macros etc, which my project does not even have. What is the reason behind this and how do I fix it?
For some reason, the next entry (C/C++ Include Paths and Symbols) shows that |Include path not found"
When I try to trace a function, I get the "Could not find symbol "xyz" in index". I have already tried rebuilding the indexer but it did not work for me.
In my experience, the absence of the Preprocessor Include Paths, Macros etc. preference page happens in newer versions of CDT when you select the new Makefile Project option in the new project wizard, whose description is
(Experimental) Create a new project that builds with the 'make' build
tool using CDT's new Core Build System.
I would avoid using this as it's experimental, and would select instead C Managed Build (or C++ Managed Build). On the next wizard page you can still make it a makefile project if you want.
I ran into this problem trying to use cmake4eclipse. I forgot to heed the warning in the help file, which explicitly state:
"Do not choose the New C/C++ project wizard, as that will take you down the road of CDT`s new project type (which has poor cmake support)."
What this means is that, for the entry to appear in an executable / library -type project (not Makefile project), you have to do this now:
File --> New --> Other...
Choose "C++ Project" (not "C/C++
Project") under the C/C++ category:
P.S. Also, I had to remake the folder and copy all the sources there, i.e. when I tried the old wizard on top of a "deleted" project, something didn't override correctly and I was still missing "Preprocessor Include Paths, ...". Deleting .cproject and .project files within the folder before recreating works too.
Depending on your project, you may need to include the path of the toolchain manually. It wasn't for me. So for my project I did the following:
Go to Project – Properties – C/C++ Include Paths and add there “C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\arm-none-eabi\include” (change to fit your installation). Then refresh, clean and build the project. Finally, rebuild the indexer and this should work.

Building a multi module C project (i.e. solution) with Eclipse CDT

I am moving from Netbeans to Eclipse (on Ubuntu 12.0.4). I have a C application that consists of several sub projects which are libraries (shared and static), as well as stand alone executables.
I can't figure out how to create a 'parent' project foo, which contains component projects
foobar
foofoo
barfoo
barbar
Ideally, I want all the 'component projects' to be created under the folder foo, so that I have a directory structure like this:
/path/to/foo/foobar/ (contains foobar project files)
/path/to/foo/foofoo/ (contains foofoo project files)
/path/to/foo/barfoo/ (contains barfoo project files)
/path/to/foo/barbar/ (contains barbar project files)
Does anyone know how I can achieve this structure using Eclipse as IDE (with CDT)?
Last but not the least, I intend to create my C modules using the Autotools option. Will the generated files for Autotools be automatically updated as I add new header/source to a module - or do I need to manually maintain the Autotool files?
Friend,
I think there is no the "parent" C project. You can create a normal C project in IDE and add all dependencies into sub-folders. Then tell compiler your build procedure via Makefile. I think it's easy way as you have had experience on C application.
About autotools, once you update/add/remove your project file, I think you need to modify your Makefile to reflect your change and do clean and rebuild your project.
For other C build tools, you can use buildroot if you'd like.
The best way I can think to do this in eclipse is to create a separate workspace for the project e.g. foo, and then add the sub-projects (foobar, foofoo, etc...) as projects. This is generally a better approach to take with eclipse, instead of a single monolithic workspace. I don't know what the specific dependency structure for the sub-projects looks like, but you should be able to express it simply by using eclipse project properties. This can include a rollup executable sub-project that depends on the libraries.
Unfortunately, I'm not sure if eclipse cdt will maintain autotools files. However if not, it should be relatively easy to integrate and use some of the autotools binaries such as autoscan, and autoheader into the eclipse build commands.
At first you need to a working directory, Then you should new project, Then per file or per class (according to C++ or C ) append your files, it's much safe way. another way is not clean, i have experience. don't use them.

How to run scripts from within eclipse

I have a project that doesn't use autotools, but has a Makefile which I run to build the code. This make file is run from within in a shell script. I have imported the project in eclipse, but I can't seem to run the shell script (Something like Ctrl + B to Make or add one of the Make targets viz., make all or make install).
Is there a way I can do this?
You can specify a script to build your project in Project Properties -> C/C++ Build -> Build Command -> Builder Settings.
You can uncheck Use default build command and specify yours (e.g. make all, make install or bash make_all.sh). Or you can leave the default build command (it must be make) and in tab Behaviour specify targets.
But before you should have imported your project Makefile Project with Existing Code.
Don't use Eclipse if you are using Make tools in the same project. Eclipse brings you some tools for project compiling, etc. that you already have with Make/Automake.

Converting a non-GUI Makefile (make) project to KDevelop

I have a rather simple C project I compile with make that I would like to run and debug in KDevelop, but I can't get this to work. I have installed cmake and tried both to import an existing project and start a new (which insists on creating a main.ccp file), but no matter what I do all the menu options to run the program are greyed out.
How can I move this project to KDevelop?
Hiya, once you have created the new project by importing the custom makefile,
go to the Run Menu, Launch Configurations, then select the Global tag, then press the green plus sign +.
This will create a new launch configuration that you need to fill out with all of the correct executable paths and arguments and whatnot.
Once these are set, then the execute/debug options will ungrey out.
I had to figure this out today, was not obvious at all.

Resources