Trying to build Telegram (Desktop) from source - c++

I'm trying to built the Telegram Desktop client from source using the instructions on Github. I'm up to this point:
Tools > Options > Build & Run > Kits tab > Desktop (default) > change
Qt version to Qt 5.4.0 (Qt-5.4.0) > Apply Open MetaStyle.pro,
configure project with paths
/home/user/TBuild/tdesktop/Linux/DebugIntermediateStyle and
/home/user/TBuild/tdesktop/Linux/ReleaseIntermediateStyle and build
for Debug
I can open MetaStyle.pro, but I don't know what the instructions mean by "configure project with paths...".
Does it mean I have to add those directories to the INCLUDEPATH? The OBJECTS_DIR?

When you open a project file with Qt Creator, it first prompts you to configure the project. If it doesn't, select the "Projects" button at the left side of QtCreator and click the "Build & Run" tab.
Under the Build Settings header, choose which build configuration you want to change ("Edit build configuration: " Debug/Release).
For the Debug configuration, set the debug "Build Directory" as
/home/user/TBuild/tdesktop/Linux/DebugIntermediateStyle
If the field is grayed out, check the "Shadow Build" box.
For the Release configuration, set the release directory as
/home/user/TBuild/tdesktop/Linux/ReleaseIntermediateStyle

Related

Trying to load an existing Makefile-based C ++ application into Eclipse fails to load

I have build a C++ application that consists of two source code files and the Makefile:
myexample.h
myexample.c
Makefile
It compiles perfectly in linux Debian, executing in the terminal:
make
The application is compiled with gnu g ++ (originally it was a C application, but now I compile
it as a C ++ application, without errors).
These files are in the directory
/home/myuser/example1/src/
However, now I want this application to be compiled and edited from Eclipse.
The version of Eclipse that I use is:
Eclipse IDE for C/C++ Developers
Version: 2019-09 R (4.13.0)
I try to load the application that I already have in Eclipse following this procedure:
I start Eclipse and the "Eclipse IDE Launcher" window appears.
In the "Workspace" box I write /home/myuser/example1
I click the "Launch" button.
The "Welcome" screen is displayed in Eclipse, I close it.
I select the menu option
File --> New -> Makefile Project with Existing Code
In the "New Project" window, which is now displayed, I fill in the following fields:
"Project Name": example1
"Existing Code Location": /home/myuser/example1/src
"Toolchain for indexer Setings": Linux GCC
I click the "Finish" button.
After doing this, no files are shown in "Project Explorer".
If I click "Build" it does nothing.
That is, it seems that Eclipse has not recognized or loaded my example correctly,
which however does compile manually with make and the executable works.
Any help or comment is appreciated.

Eclipse CDT, CMAKE project: No C/C++ Build Menu Item

Thanks in advance for the help.
This is on Windows/MSYS2 (mingw64) Eclipse CDT Version: 2019-09 R (4.13.0) Build id: 20190917-1200.
I have figured out how to run cmake in order to create an Eclipse compatible project file. I then got the project into Eclipse via I got this File->Open Project from File System. I can then make/build that file and create my executables. I do get a couple warnings regarding improper project path but the code all compiles without error.
However, I need to "connect" the cmake build directory (i.e. the project in Kicad) to my source code in order to edit and/or debug the changes I wish to make. Based on my research I believe I have to do this via the Project Properties C/C++ Build menu, however, this menu is not present. I believe I access this menu by selecting the project on the left and right clicking or alt-enter or from the top menu Project->Properties.
For some reason I can't do a screen grab on Eclipse but I pulled the image attached from the online help file: (https://help.eclipse.org/2019-06/index.jsp)
.
My "Project->Properties" menu looks similar in that it shows Resource, Builders, plus more things but there is no C/C++ Build entry: it just goes from Builders to C/C++ General.
I found this "solution" https://bugs.eclipse.org/bugs/show_bug.cgi?id=508319 which seemed appropriate as I had installed the standalone debugger, however, uninstalling it had no effect.
Any suggestions?
Thanks

Chromium debugging on Windows environment

How can I debug chrome itself on Windows platform, I am familiar with Visual Studio and c# debugging.
This is the code part what I am interested in.
Should I build from source? or it is possible to log all of the necessary data without messing with the source code?
I looked around online but I am not familiar with robust C++ projects. (like symbol tables etc, …)
So my question is:
What is the easiest way to debug step by step that method what is it in the link?
step by step instructions for debugging chrome via vs 2017
in my example I am going to use "c:\Files\Work\chromium\" folder
Installs:
install VS2017 with "Desktop development with c++" from: https://www.visualstudio.com/downloads/
step install python 2.x with PATH from: https://www.python.org/downloads/
get depot_tools from: https://storage.googleapis.com/chrome-infra/depot_tools.zip
unzip it into "c:\Files\Work\chromium\" Use right click "Extract All..." because of the hidden files
open powerhsell
Change folder:
cd c:\Files\Work\chromium\
check python installed correctly:
python --version
Python 2.7.13
setup environment variable:
$env:DEPOT_TOOLS_WIN_TOOLCHAIN=0
$env:GYP_MSVS_VERSION=2017
$env:path = $env:path + ";c:\Files\Work\chromium\depot_tools\"
Create folder for chromium srouce code:
mkdir chromium && cd chromium
Download the source code (20gb it takes for a while)
fetch chromium
gclient sync
Switch to src folder:
cd src
generate vs2017 project file:
gn gen --ide=vs2017 --filter//chrome/* --args="is_component_build = true is_debug = true remove_webcore_debug_symbols = true" out\Default
Open Visual Studio 2017:
Enable source server:
Tools-> Options-> Debugging-> General-> "Enable source server support"
with "Print Source server diagnostic messages..."
Add Symbols:
Tools-> Options-> Debugging-> Symbols
add
https://chromium-browser-symsrv.commondatastorage.googleapis.com
and
http://msdl.microsoft.com/download/symbols
with cache
restart VS2017
open chromium project (it takes for a while)
c:\Files\Work\chromium\chromium\src\out\Default\all.sln project
Start Debugging:
Debug -> Attach to Process
Set it to Attach to Native code:
When you need to debug chrome attach to main chrome process when you need to debug renderer attach to tab use Chrome Task Manager to figure out Process ID to open Task manager use: shift+esc
To Set Up break points:
Put breakpoint, right click -> conditions
and Check "Allow the source code to be different from the original"
If VS asking to checkout for the source press ok.
If you have the whole source code, it would be easy for you to debug your app.
Like this issue here:
Visual Studio: Debugging Chrome with Source?
If you really want to debug the Chrome browser, you could really run it in your VS. Of you could get the symbols files for it, and then get some debugging information from the PDB file directly.

How to switch between debug and release Makefiles in Eclipse CDT?

For example I have 2 Makefiles: Makefile.Debug and Makefile.Release.
I can switch between them by setting different commands in:
C/C++ Build -> Builder Settings -> build command : make -f Makefile.Debug -j4 or make -f Makefile.Release -j4, but how can I switch between two makefiles in Eclipse GUI (Like in Visual Studio debug/release configurations)?
Create two Build configurations in Eclipse, each with a different make command.
Then, you can click the down arrow near the hammer in Eclipse's top bar to switch configuration.
Detailed steps:
Right click on Project, click Properties
Left sidebar, click C/C++ Build
Top right corner, "Manage Configurations..."
Add
Set "Name" and select "Existing configuration: xxxxx"
Ok
Ok
Switch between the configurations setting what's required (in your case, under the C/C++ Build section, in the "Builder Settings" tab, select "External builder" type in the "Builder type" combo, then deselect "Use default build command" and enter yours in the "Build command" field
Confirm with OK
Use the hammer
(I haven't a copy of Eclipse on this PC right now so I can't send screenshots, sorry.)

Change default working directory in Qt Creator

Is it possible to change the default Working directory in Qt Creator to specified path?
Or is it possible to set Working directory in .pro file?
PS: I know about QDir::setCurrent, but searching for other ways
go to the projects tab and look in "build and run" for the run tab in the kit you are using
you will see the option there under "run"
Old question but, as there is no accepted answer and I recently found this question while looking:
Tools > Options > Build & Run > General > enter the desired Projects Directory location in the provided text box, or use Browse to locate it.
Note: assuming Qt Creator 4.3.1 based on Qt 5.9.1, Linux x86-64
Qt Creator Online Doc: Specifying Run Settings