How to integrate chromium browser project in Qt Creator in Ubuntu - c++

I have managed to understand the structure of chromium browser and now I would like to use an IDE in order to make some changes for a personal project on a Ubuntu Trusty machine ( 14.04 ).
It is already compiled and I just want to use an IDE to make my life easier.
I have tried to add chromium to Qt Creator by using the option open project but without any luck.
Could you please guide me to have this achieved ? Some steps would be really helpful. More, it would be possible to compile / build chromium from Qt Creator ? ( avoid typting in console ninja -C out/Debug chrome chrome_sandbox and out/Debug/chrome every time)
If you guys can suggest me another IDE that you're used to, please, guide me and I will change the title of the post.
//UPDATE 1
I tried to make those configurations for Build / Run as it follows:
Build:
Run
I get the following error:
:-1: error: No rule to make targetall'. Stop.`
//UPDATE 2:
The error from Compile output section

You can edit any code project in Qt creator, but you can't use Open project, when it isn't a Qt project. Instead use Import project -> Import existing project in the New project dialog.
When you have an existing project, you can define new build steps in the Projects tab. Under Build steps just choose Add Build step -> Custom Process step.
Here you can fill in your command using the fields Command, Arguments and Working Directory.
In your case, you would for example fill in ninja, -C out/Debug chrome chrome_sandbox and %{buildDir} for the first command.
Similarely, you can click on Run (on the top of this tab) to change how the your project is executed after successful compilation.

Just run in src folder:
gn gen out/Default --ide=qtcreator
And open in QtCreator src/out/Default/qtcreator_project/all.creator

Related

How to build&run Unreal C++ project on Linux?

I'm trying to build my first Unreal C++ project on Linux.
I built the engine from source in accordance with "Linux Quick Start" guide. Then I installed Qt Creator and followed the "How to Set up Qt Creator for UE4" guide.
I successfully set up and ran UE4Editor, and created a new C++ project. Unfortunately when I try running the project it complains:
And when I press "yes" this error message is shown:
Here's the error message from the logs:
ERROR: Building would modify the following engine files:
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Android/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Plugins/2D/Paper2D/Binaries/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Plugins/AI/AISupport/Binaries/Linux/UE4Editor.modules
... many more
I tried rebuilding UE4 from IDE, then building again - but the error still persists. Same thing happens if I try starting UE4Editor from the engine files and opening the project from there.
What could cause this error? Why does it even try to rebuild the engine when I'm tring run a project?
I have the following script to add the paths to the engine scripts and binaries to my PATH:
UNREAL_HOME="/path/to/source/of/UnrealEngine"
UNREAL_SCRIPTS="${UNREAL_HOME}/Engine/Build/BatchFiles"
UNREAL_SCRIPTS_LINUX="${UNREAL_HOME}/Engine/Build/BatchFiles/Linux"
UNREAL_BINS="${UNREAL_HOME}/Engine/Binaries/Linux"
PATH="${PATH}:${UNREAL_BINS}:${UNREAL_SCRIPTS}:${UNREAL_SCRIPTS_LINUX}"
export PATH
Then I run UE4Editor '/absolute/path/to/project.uproject' from within the directory of my project.
I never create a project inside the source tree of the engine. Paths should absolutely be different.
I use VS-Code as the IDE. This is what works best from my experience. QT-Creator will work only if you create an include files with lots of #define that are missing from the .pro files created by unreal.
You can configure VS-Code to have an intelli-sense like completion by installing the C# and C/C++ extensions. I had to install mono in order to get OmniSharp working (this is the server than handles the autocompletion for VS-Code). Here is an extract of my VS-Code settings.json file:
"omnisharp.path": "/home/myuser/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/OmniSharp.exe",
"omnisharp.monoPath": "/usr/bin/mono",
You can also install the C++ Helper extensions which is usefull for creating methods, classes, and so on.
In the directory of your project run 'make YOURPROJECTNAMEEditor', then you can run 'open YOURPROJECTNAME.uproject' and it should open.

Via Windows command line, how can we compile a Netbeans C/C++ application?

Let's take this simple C/C++ application Netbeans project folder.
In Netbeans IDE, we just hit build button on the toolbar to build the application.
I want to do that automatically via Windows command line, how can I do that?
I did google, and found some related posts though not very helpful for me except telling me to call ant dist - though I don't have the build.xml in my Netbeans 8 project.
p.s. I have hundreds of student submissions and need to verify which one is compilable.
I also post on Netbeans forum here.
I want to do that automatically via Windows command line, how can I do that?
NetBeans uses Makefile-based projects as default for C/C++ projects, so you can use make to build your project:
cd <Project dir>
make
It's also possible to build other make-targets (eg. make all or make test (builds / runs tests)).
Note: The Cygwin bin dir (CYGWIN_HOME\bin) must be in system PATH - same applies to other environments (MinGW, Gcc etc).

Eclipse CDT C++ - [Main] program not specified

Hi This is my first time working with C++ on eclipse. I'm using cygwin.
I'm just trying to create a simple hello world program. The build is successful but when I try to run, it says "launch failed. binary not found".
In settings which I check the run configuration, there's nothing listed on clicking "search project..". Am I doing something wrong?
Would really appreciate any help on this. Thanks!
You probably found your solution, but here's for anyone else who might have the same problem:
If you want to use cygwin toolchain then you'll have to build a makefile first, and then build your project. You can follow the official guide here: http://help.eclipse.org/indigo/index.jsp (C/C++ Development User Guide >> Getting Started >> Creating a Makefile project)
If you don't mind changing the cygwin toolchain: The fastest way to build and run a C/C++ project would be to create another project, this time un-ticking the show project types and choose as MINGW GCC toolchain (check 1st image below). After you create your project, you just right click on project and choose the rebuild option (check 2nd image below).

Launch Failed. Binary not found. CDT on Eclipse Helios

I'm using Eclipse Helios on Ubuntu 10.04, and I'm trying to install CDT plugin on it. I download it from here here.
And then I go to Install New Software and select the zip file (I don't extract it, just select the zip file). And its ok, it installs, everything works fine, it shows optional features, blah blah blah.
And then I create a new HelloWorld project. And when I try to run it, it shows an error and says:
Launch failed. Binary not found.
Can anyone explain me how to fix it?
Thanks.
You must build an executable file before you can run it. So if you don't “BUILD” your file, then it will not be able to link and load that object file, and hence it does not have the required binary numbers to execute.
So basically right click on the Project -> Build Project -> Run As Local C/C++ Application should do the trick
First you need to make sure that the project has been built. You can build a project with the hammer icon in the toolbar. You can choose to build either a Debug or Release version. If you cannot build the project then the problem is that you either don't have a compiler installed or that the IDE does not find the compiler.
To see if you have a compiler installed in a Mac you can run the following command from the command line:
g++ --version
If you have it already installed (it gets installed when you install the XCode tools) you can see its location running:
which g++
If you were able to build the project but you still get the "binary not found" message then the issue might be that a default launch configuration is not being created for the project. In that case do this:
Right click project > Run As > Run Configurations... >
Then create a new configuration under the "C/C++ Application" section > Enter the full path to the executable file (the file that was created in the build step and that will exist in either the Debug or Release folder). Your launch configuration should look like this:
Go to the Run->Run Configuration-> now
Under C/C++ Application you will see the name of your executable + Debug (if not, click over C/C++ Application a couple of times). Select the name (in this case projectTitle+Debug).
Under this in main Tab -> C/C++ application -> Search your project -> in binaries select your binary titled by your project....
You must "build" before "run", otherwise "Binary not found". You can set up "Auto build", so that it will build and run. Check this post to set up "Auto build" http://situee.blogspot.com/2012/08/how-to-set-eclipse-cdt-auto-build.html
I had this problem for a long while and I couldn't figure out the answer. I had added all the paths, built everything and pretty much followed what everyone on here had suggested, but no luck.
Finally I read the comments and saw that there were some compilation errors that were aborting the procedure before the binaries and exe file was generated.
Bottom line: Do a code review and make sure that there are no errors in your code because sometimes eclipse will not always catch everything.
If you can run a basic hello world but not your code then obviously something is wrong with your code. I learned the hard way.
If you still have an error even after building the project then try to do this:
click on Binaries in Project Explorer with the left button
click on green "Play" button (Run Debug)
I was having this same problem and found the solution in the anwser to another question:
https://stackoverflow.com/a/1951132/425749
Basically, installing CDT does not install a compiler, and Eclipse's error messages are not explicit about this.
I faced the same problem. I have Eclipse Indigo and Eclipse Luna on Ubuntu. I tried many solutions, but none worked. Here's how you can try :)
Try it in order :)
Either do Build All and then compile :)
Install G++ Compiler
Windows->Preferences->NEW CDT PRoject-> Makefile-> Binary Parsers-> Choose Cywin or Window PE depending on your Os :)
Change your toolchain to cywin gcc
Project->Properties->Environment-> Release Active
After 1,2, 3, and 4, I tried changing paths, and other stuff, but nothing worked. In the end, I noticed that it mentioned Debug Active was not configured. So when I changed it to Release Active, it worked. Do note that change in environment and path is not required.
I faced the same problem while installing Eclipse for c/c++ applications .I downloaded Mingw GCC ,put its bin folder in your path ,used it in toolchains while making new C++ project in Eclipse and build which solved my problem.
Referred to this video
Seems like having "Build Automatically" under the Project menu ought to take care of all of this. It does for Java.
make sure you have GDB installed on your system...
If your using Linux based OS simply in a terminal type:
sudo apt-get install gdt
when finished downloading extract the file and install.
close your IDE (in this case eclipse and open it again and run your project.
Adding the compiler to the PATH fixed the problem for me...
export PATH="$HOME/opt/cross/bin:$PATH"
My problem was the same as one commenter above. I had to change the binary parser to the correct one (PE for windows, ELF for Linux, mach for mac)

Android-ndk with eclipse: How to force reinstallation of apk

I'm developing a library in c++ using the android NDK. Actually i created my project in android with both java and c++ sources. I can compile and run my project and all works fine.
Now i would like to force eclipse to reinstall the apk on the phone even if the java code is unchanged but something changed on the c++ side. Infact if i just change my c++ code and i launch the application the new library is not uploaded on the phone.
Do you know how i could achieve the result?
Thanks a lot!
I have encountered this problem too.
To solve this, you could touch a random java file in your project each time you compile the NDK project (easiest is to add it to the NDK makefile).
This way Eclipse is "fooled" into re-creating the APK.
Open the Eclipse Workspace containing your project and then enable Window | Preferences | General | Workspace | Refresh automatically. Otherwise, you may need to refresh the Workspace manually (F5) before Eclipse will detect the changed file(s) and rebuild the APK.
Rather than touching a source file, I prefer deleting the apk file. With the "Refresh Automaticaly" option enabled, I found that it immediatly rebuilds the apk.
So I added that to my build. Here's my build alias:
alias b='ndk-build; rm -v ./bin/*.apk'