How to build google google-breakpad for windows? - build

I am trying to build google breakpad for windows. I don't get it. I tried installed autoconf and m4 for Windows which seems to work. But running
m4 CXXFLAGS=-m32 CFLAGS=-m32 CPPFLAGS=-m32 ./configure
results in
func_dirname ()
{
# Extract subdirectory from the argument.
func_dirname_result=NONE:0: m4: ERROR: EOF in string
after some seconds of executing scripts.
I searched form visual studio solution files, but they have been removed since revision 581.
So i found the related post
How to build google breakpad.
But how do i install gyp? What prerequisites does it require?
Or does anybody have a working (VC2005) sln file for all parts of google-breakpad ?
Can anybody give me a step by step description on how to build it?

This is really poorly explained in the documentation, but actually gyp is already present if you've done an ordinary checkout of breakpad. Open a command prompt and place yourself in the root ( google-breakpad-read-only if you're going by the instructions ). Then just do:
src\tools\gyp\gyp.bat src\client\windows\breakpad_client.gyp
This will generate visual studio sln files for you.

The latest master of breakpad (March 15th 2016) does not include gyp, which is used to generate the solution files. The best thing to do would be to simply check it out and install it; gyp does, however, require Python 2.7 so make sure Python is accessible in the path.
git clone https://chromium.googlesource.com/external/gyp
cd gyp
python setup.py install
Now your gyp installation will work; simply invoke gyp.bat on src\client\windows\breakpad_client.gyp. (gyp is checked out one directory below breakpad in my case; change it accordingly to your setup)
..\gyp\gyp.bat src\client\windows\breakpad_client.gyp --no-circular-check
The solution files should now be present.

Related

vcpkg setup errors on command line

I am trying to compile dlib 19.4 using the vcpkg tool
since I am having trouble compiling CMAKE and working with Boost.Python
to fix compiler issues for dlib.
Though I am having problems even running the basic steps
to get the vcpkg package to work:
(I also downloaded Visual Studio 2017 for this tool)
Looking at executed command (git init), you initialized empty git repository for vcpkg - that is likely wrong. This bootstrap.ps1 script fails internally when trying to fetch existing revisions. vcpkg doesn't want to reside in just any git repository, it wants "its" git repository. vcpkg uses git as a distribution platform and later to perform updates.
So instead, you should clone vcpkg repository to some directory, e.g.:
C:\test>git clone https://github.com/Microsoft/vcpkg.git vcpkg_test
Cloning into 'vcpkg_test'...
...
Checking out files: 100% (876/876), done.
C:\test>cd vcpkg_test
C:\test\vcpkg_test>powershell -exec bypass scripts\bootstrap.ps1
https://github.com/Microsoft/vcpkg/
Additionally I see errors regarding VS2017 C++ support. VS2017 is an IDE with multiple optionally supported languages (i.e. you could have only C# support installed). Please make sure you have "Desktop development with C++" workload installed - as vcpkg is for C++. You can update the installation at any time by running installer again (Modify).
https://learn.microsoft.com/en-us/visualstudio/install/install-visual-studio

How do you compile V8 with Visual Studio?

I've been trying to compile V8. I've obtained a copy of the v8-master folder from GitHub, but I can't figure out how to compile it. A lot of the documentation I could find online are conflicting.
From what I've gathered, it appears as if my best chance of getting it to compile (out of the various methods I've found, though I couldn't get any of them to work) is to create the project files by calling the gyp_v8 script (located in the build folder of v8-master). But it simply gives me File "gyp_v8", line 86 print 'Error running GYP' SyntaxError: Missing parentheses in call to 'print'. From there, I tried to install Gyp (since according to the documentation, I'm led to believe that's what's causing the error). That required me to install depot_tools and do gclient sync. That failed with the error Error: client not configured; see 'gclient config'. And gclient config fails with the erropr gclient.py: error: Inconsistency arguments. Use either --spec or one or 2 args.
Honestly, I'm lost at this point. Is there any way I could just use CMake or something? Or at least a build tutorial that doesn't assume you have a bunch of Google-specific build tools involved?
Confirm Git is installed. git 2.2.1+ recommended.
Temporarily, disable Windows Indexing.
Install "Microsoft Visual C++ 2008 Redistributable Package"
Run bat file as administrator
Bat file:
#echo on
CD /D %~dp0
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
SET DEPOT_TOOLS=%CD%/depot_tools
SET PYTHONHOME=%DEPOT_TOOLS%/python276_bin
SET PYTHONPATH=%CD%/v8/build/gyp
SET PATH=%DEPOT_TOOLS%;%PYTHONHOME%;%PATH%
SET GYP_DEFINES=target_arch=x64
REM SET GYP_DEFINES=target_arch=x64 component=shared_library v8_use_snapshot=false
REM About GYP_DEFINES: https://github.com/v8/v8/wiki/Building-with-Gyp
IF EXIST %DEPOT_TOOLS% (
ECHO Updating depot_tools
CD %DEPOT_TOOLS%
CALL git pull
CD ..
) ELSE (
ECHO Getting depot_tools
CALL git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
)
CALL gclient
CALL gclient config https://chromium.googlesource.com/v8/v8.git
CALL gclient sync
I've previously built V8 from source for Visual Studio 2010 and then for Visual Studio 2013. Very time consuming tasks in both cases. However for Visual Studio 2017 I found that the headers and prebuilt libraries are available from NuGet. I no longer needed to build from source.

Cannot open include file 'getopt.h'

Firstly, I know nothing about C/C++, but I am trying to compile LCI https://github.com/justinmeza/lci under Windows 10 with Visual Studio 2015, but I'm getting the following error:
Cannot open include file: 'getopt.h': No such file or directory.
I see that getopt is not part of Visual C so people are saying you have to implement your own. It looks like this is what I need:
https://github.com/skandhurkat/Getopt-for-Visual-Studio/blob/master/getopt.h
Problem is, I don't really know what to do with this file. I've been reading a fair bit and messing around for ages just to compile lci.exe!
Already emailed the OP about this, but here's the steps I followed in order to build lci successfully. The missing step seemed to be that Justin Meza neglected to mention that you need to install CMake as well in order for the install script to work. CMake will allow you to build C code against the glibc headers.
Install MinGW
Install Python 3.5.1 (or latest Windows version)
Install Git for Windows (if you haven't already)
Make sure to enable Git for the Windows command prompt
Install CMake
Add MinGW and Python to your PATH environment variable. I'd double check that your paths to the executables are correct, mine looked like this:
C:\Program Files\mingw-w64\mingw64\bin
C:\Users{username}\AppData\Local\Programs\Python\Python35-32
Run a command prompt as administrator, and go to your Documents folder and clone the lci repository (if you haven't already):
git clone https://github.com/justinmeza/lci.git
Go into the lci directory, and run:
install.py --prefix="C:/Program Files/lci"
Add lci to you PATH, if using the default location add this to the end of your PATH:
C:\Program Files\lci\bin
I would have included some links to the various programs above in steps 1-4 but apparently I don't have enough reputation on StackOverflow for that...you should be able to find them easily enough in a quick Google search.
You should now be able to run lci from any command prompt. A good test would be to run the "HAI WORLD" code at lolcode.org.
Just copy getopt.h to the directory where .c files are, so the compiler can find it.
Based on the linked source code and it's contents, the project you're trying to build appears to be written for Linux. It might be possible to sufficiently rewrite it to be able to compile under Microsoft Windows, and Microsoft's compiler; or perhaps install something like MinGW.
However, given your stated lack of development experience, this does not appear to be something that you could easily handle on your own.

How to build cmake-project with atom text editor?

I've installed packages build and build-make, and it's not obvious what to do next.
Build-tools package is bugged and impossible to install now.
I have cmake project, sucsessfully build in different IDE: QTCreator, VisualStudio, via bash. So i want to make it with atom, and there is no instruction how to use it's build-make package. Documentation to this package is empty.
in bash i call: cmake ../src from my build dir.
So in .atom-build.json i put this command and point directory as working - and nothing happens, on f9 i've god "Cannot read peoperty "exec" or undefined"
Actually, there is a cmake package for Atom.
Here you go:
https://atom.io/packages/build-cmake
Firstly, CMake and make are two different things.
What you are looking for is a CMake plugin for Atom, of which there are currently none. (Some for syntax highlighting but none for running graphically...)
If you have CMake working in other IDEs then you shouldn't have a problem running CMake from the command line:
cd /path/to/project
cmake .

using CMake to build Google Test

I am trying to use CMake to build Google Test.
As mentioned in the README of Google Test,
I have issued following commands:
mkdir mybuild # Create a directory to hold the build output.
cd mybuild
cmake D:\gtest-1.6.0 # (in the README this was set as:cmake ${GTEST_DIR}, but since on my machine D:\gtest-1.6.0 is where I have downloaded gtest, I have used that in command prompt.
And here is the error I get:
Any help? any help would be greatly appreciated as I am stuck with it and can't move forward...... Thanks.
ps. I have Visual Studio 10 installed on my machine.
If you use Visual c++ compiler with cmake you must launch it from the Visual c++ command prompt. Otherwise cmake will not found your compiler.