C++ error: expected primary-expression before ‘;’ token using Cmake - c++

I used Cmake to define folder paths.
I have Config.in.h file and where #cmakedefine are declared as
#cmakedefine CAFFE_MODEL_PATH
#cmakedefine CAFFE_MODEL_PATH
#cmakedefine CAFFE_TRAIN_MODEL
#cmakedefine MEAN_FILE
#cmakedefine LABEL_FILE
In my CMakeLists.txt, I did as
set(CAFFE_MODEL_PATH "" CACHE PATH "Path to a Caffe model")
set(CAFFE_TRAIN_MODEL "" CACHE PATH "Path to a trained model")
set(MEAN_FILE "" CACHE PATH "Path to the mean file all trained images")
set(LABEL_FILE "" CACHE PATH "Path to the mean file all trained images")
configure_file (
"${PROJECT_SOURCE_DIR}/Config.h.in"
"${PROJECT_SOURCE_DIR}/Config.h"
)
So that Config.h has #define for those CAFFE_MODEL_PATH, CAFFE_TRAIN_MODEL, MEAN_FILE, LABEL_FILE.
But when I use them in my main.cpp file
int main(void) {
::google::InitGoogleLogging("endtoenddetection");
string model_file = CAFFE_MODEL_PATH;
string trained_file = CAFFE_TRAIN_MODEL;
string mean_file = MEAN_FILE;
string label_file = LABEL_FILE;
}
I have errors as
/home/Softwares/ReInspect/endtoendLstm/main.cpp:8:43: error: expected primary-expression before ‘;’ token
string model_file = CAFFE_MODEL_PATH;
^
/home/Softwares/ReInspect/endtoendLstm/main.cpp:9:44: error: expected primary-expression before ‘;’ token
string trained_file = CAFFE_TRAIN_MODEL;
^
/home/Softwares/ReInspect/endtoendLstm/main.cpp:10:36: error: expected primary-expression before ‘;’ token
string mean_file = MEAN_FILE;
^
/home/Softwares/ReInspect/endtoendLstm/main.cpp:11:37: error: expected primary-expression before ‘;’ token
string label_file = LABEL_FILE;

When configure_file, expression
#cmakedefine CAFFE_MODEL_PATH
is actually a conditional macro definition. That is, the macro is defined only when corresponded CMake variable is evaluated as no-false (according to if(constant) rules).
In your case, CMake variables have empty values, which are evaluated as false. So configured file (Config.h in you case) doesn't contain macros definitions.
If you want to define macro with string value, use
#define CAFFE_MODEL_PATH "#CAFFE_MODEL_PATH#"
Such a way the macro will be properly defined even if corresponded variable is empty.
See also documentation for configure_file command.

Related

Windows Visual C++ 2019 trying to pass preprocessor varible (-D in linux ) error C2143: syntax error: missing ';' before 'constant'

im doing simple port from Linux to windows, now in Linux I pass simple
-DVERSION=1 to be able to get the value in preprocessor macro :
for example :
#define APP_NAME "MyApp " VERSION
in windows when i set the VERSION value in :
Configuration Properties, C/C++, Preprocessor -> Preprocessor Definitions
as :
VERSION=1
I'm getting :
error C2143: syntax error: missing ')' before 'constant'
also when if the VERSION define in other places like :
char *message = (char*)"MyApp " VERSION "\0";
getting the same :
error C2143: syntax error: missing ';' before 'constant'
when i mouse point on the VERSION definition i do see that it set to 1
With
VERSION=1
then VERSION expands to the integer literal 1, which means your statement is as this:
char *message = "MyApp " 1 "\0";
This is not valid, as you can't concatenate string literals with integer literals. For this to work you need to define VERSION as a string literal:
VERSION="1"
As for the APP_NAME macro, you have a similar issue there. One solution is the same as for above, to define VERSION as a string. But another is to use the poreprocessor concatenation operator ##:
#define APP_NAME "MyApp " ## VERSION
Or use the preprocessor "stringify" operator #:
#define APP_NAME "MyApp " #VERSION

rmarkdown::render() failed to generate pdf, but the rstudio 'knitr' buttons works

I use tineytex package and have no problem knitting a pdf when I click on the knit button in rStudio. However, when I called rmarkdown::render() with the same .Rmd file as input, only an intermeidate .tex file was generated in the target folder.
Below is my code.
rmarkdown::render(input = "C:/Users/sqhuang/Pdf.Rmd",
output_format = "pdf_document",
output_file = "test.pdf",
output_dir = ot_path)
Below is the error messages that I got.
processing file: Pdf.Rmd
|......... | 14%
ordinary text without R code
|................... | 29%
label: setup (with options)
List of 1
$ echo: logi FALSE
|............................ | 43%
ordinary text without R code
|..................................... | 57%
label: cars
|.............................................. | 71%
ordinary text without R code
|........................................................ | 86%
label: pressure (with options)
List of 1
$ echo: logi FALSE
|.................................................................| 100%
ordinary text without R code
output file: Pdf.knit.md
"C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS Pdf.utf8.md --to latex
--from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash
--output pandoc15f027594a1c.tex --template "C:\PROGRA~1\R\R-36~1.1\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX"
--highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes" This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX)
(preloaded format=pdflatex) restricted \write18 enabled. warning:
kpathsea: //enterprise2/Users4$/Sqhuang_a/My Documents: Unrecognized
variable construct $/'. warning: kpathsea:
//enterprise2/Users4$/Sqhuang_a/My Documents: Unrecognized variable
construct$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My
Documents: Unrecognized variable construct $/'. warning: kpathsea:
//enterprise2/Users4$/Sqhuang_a/My
Documents/.TinyTeX/texmf-config/web2c/pdftex: Unrecognized variable
construct$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My
Documents/.TinyTeX/texmf-var/web2c/pdftex: Unrecognized variable
construct $/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My
Documents/.TinyTeX/texmf-home/web2c/pdftex: Unrecognized variable
construct$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My
Documents/.TinyTeX/texmf-config/web2c: Unrecognized variable construct
$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My
Documents/.TinyTeX/texmf-var/web2c: Unrecognized variable construct
$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My
Documents/.TinyTeX/texmf-home/web2c: Unrecognized variable construct
`$/'. entering extended mode Error: Failed to compile
\endeavor/apps_doc$/Applications/0_Support/GCS/Brett - Other
Duties/BAR/Steph/AL/Jul/test_report.tex. See
https://yihui.name/tinytex/r/#debugging for debugging tips.
I think I've figured out the problem (unfortunately, I seem to have ran into a further issue, but I think I've resolved this one anyway).
Basically, kpathsea is searching everywhere in your system for the needed packages. This means it's trying to search in directories that it can't read properly (because of the $ symbol amongst others). The solution was to find the texmf.cnf file which looks something like this:
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFLOCAL = $SELFAUTOPARENT/texmf-local
TEXMFHOME = $HOME/.TinyTeX/texmf-home
TEXMFVAR = $HOME/.TinyTeX/texmf-var
TEXMFCONFIG = $HOME/.TinyTeX/texmf-config
OSFONTDIR = $SystemRoot/fonts//
ASYMPTOTE_HOME = $TEXMFCONFIG/asymptote
% Prefer external Perl for third-party TeXLive Perl scripts
% Was set to 1 if at install time a sufficiently recent Perl was detected.
TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 0
TEXMFAUXTREES = C:/PROGRA~1/R/R-36~1.3/share/texmf,
When searching, kpathsea replaces the $HOME with a directory, which contains a $, e.g., for me $HOME gets replaced by my default Documents folder (which is on a shared network drive).
I replaced anywhere that had a $HOME/.TinyTeX with ./TinyTeX, which would make kpathsea search in the directory where I have actually installed the TinyTex (and, more specifically to not search in the default directory.)
Hope this helps anybody having this issue and provides some help for developers on how to maybe stop this problem in the future.

src/caffe/parallel.cpp:70:1: error: ‘Params’ does not name a type

This is not the first time I compiled caffe, but I still have problems that I can't solve. The caffe version I used is https://github.com/chuanqi305/ssd, the compiled version is GPU, I successfully compiled and run on my computer ( Ubuntu 16.04 GTX1080TI*1 cuda9.0) , but in the school server (Ubuntu 14.04 Tesla k80*2+Tesla k40*2 cuda8.0), the same code, the same configuration, but the compilation failed。The error occurred in the code compilation phase rather than the link phase, but the code itself is definitely no problem, because it has been compiled successfully on another computer, I don't know if it is because of my gcc/g++ version.
I tried to compile the parallel.cpp file myself using the g++ command. When I don't specify the header file path, the same error will occur, but in the Makefile, the location of the header file has been added.
The error message is below:
SGM#user-SMBIOS-implementations-newer-thandmidecode-Super-Server:~/ssd-ssd$ sudo make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/parallel.cpp
src/caffe/parallel.cpp:70:1: error: ‘Params’ does not name a type
Params<Dtype>::Params(shared_ptr<Solver<Dtype> > root_solver)
^
src/caffe/parallel.cpp:77:1: error: ‘GPUParams’ does not name a type
GPUParams<Dtype>::GPUParams(shared_ptr<Solver<Dtype> > root_solver, int device)
^
src/caffe/parallel.cpp:102:1: error: ‘GPUParams’ does not name a type
GPUParams<Dtype>::~GPUParams() {
^
src/caffe/parallel.cpp:110:15: error: expected initializer before ‘<’ token
void GPUParams<Dtype>::configure(Solver<Dtype>* solver) const {
^
src/caffe/parallel.cpp:117:6: error: ‘DevicePair’ has not been declared
void DevicePair::compute(const vector<int> devices, vector<DevicePair>* pairs) {
^
src/caffe/parallel.cpp:117:60: error: ‘DevicePair’ was not declared in this scope
void DevicePair::compute(const vector<int> devices, vector<DevicePair>* pairs) {
^
src/caffe/parallel.cpp:117:70: error: template argument 1 is invalid
void DevicePair::compute(const vector<int> devices, vector<DevicePair>* pairs) {
^
src/caffe/parallel.cpp:117:70: error: template argument 2 is invalid
src/caffe/parallel.cpp: In function ‘void caffe::compute(std::vector<int>, int*)’:
src/caffe/parallel.cpp:133:20: error: request for member ‘push_back’ in ‘* pairs’, which is of non-class type ‘int’
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:133:67: error: ‘DevicePair’ was not declared in this scope
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:157:18: error: request for member ‘push_back’ in ‘* pairs’, which is of non-class type ‘int’
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:157:65: error: ‘DevicePair’ was not declared in this scope
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:175:14: error: request for member ‘push_back’ in ‘* pairs’, which is of non-class type ‘int’
pairs->push_back(DevicePair(remaining[i], remaining[i + 1]));
^
src/caffe/parallel.cpp:175:65: error: ‘DevicePair’ was not declared in this scope
pairs->push_back(DevicePair(remaining[i], remaining[i + 1]));
^
src/caffe/parallel.cpp:185:10: error: request for member ‘insert’ in ‘* pairs’, which is of non-class type ‘int’
pairs->insert(pairs->begin(), DevicePair(-1, remaining[0]));
^
src/caffe/parallel.cpp:185:24: error: request for member ‘begin’ in ‘* pairs’, which is of non-class type ‘int’
pairs->insert(pairs->begin(), DevicePair(-1, remaining[0]));
^
src/caffe/parallel.cpp:185:60: error: ‘DevicePair’ was not declared in this scope
pairs->insert(pairs->begin(), DevicePair(-1, remaining[0]));
^
In file included from src/caffe/parallel.cpp:4:0:
src/caffe/parallel.cpp:187:16: error: request for member ‘size’ in ‘* pairs’, which is of non-class type ‘int’
CHECK(pairs->size() == devices.size());
^
src/caffe/parallel.cpp:188:30: error: request for member ‘size’ in ‘* pairs’, which is of non-class type ‘int’
for (int i = 0; i < pairs->size(); ++i) {
^
In file included from src/caffe/parallel.cpp:4:0:
src/caffe/parallel.cpp:189:21: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].parent() != (*pairs)[i].device());
^
src/caffe/parallel.cpp:189:45: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].parent() != (*pairs)[i].device());
^
src/caffe/parallel.cpp:190:36: error: request for member ‘size’ in ‘* pairs’, which is of non-class type ‘int’
for (int j = i + 1; j < pairs->size(); ++j) {
^
In file included from src/caffe/parallel.cpp:4:0:
src/caffe/parallel.cpp:191:23: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].device() != (*pairs)[j].device());
^
src/caffe/parallel.cpp:191:47: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].device() != (*pairs)[j].device());
^
src/caffe/parallel.cpp: At global scope:
src/caffe/parallel.cpp:202:1: error: ‘P2PSync’ does not name a type
P2PSync<Dtype>::P2PSync(shared_ptr<Solver<Dtype> > root_solver,
^
src/caffe/parallel.cpp:249:1: error: ‘P2PSync’ does not name a type
P2PSync<Dtype>::~P2PSync() {
^
src/caffe/parallel.cpp:271:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::InternalThreadEntry() {
^
src/caffe/parallel.cpp:287:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::on_start() {
^
src/caffe/parallel.cpp:325:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::on_gradients_ready() {
^
src/caffe/parallel.cpp:383:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::Prepare(const vector<int>& gpus,
^
src/caffe/parallel.cpp:421:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::Run(const vector<int>& gpus) {
^
In file included from /usr/local/include/caffe/blob.hpp:8:0,
from /usr/local/include/caffe/caffe.hpp:7,
from src/caffe/parallel.cpp:12:
src/caffe/parallel.cpp:439:19: error: ‘Params’ is not a class template
INSTANTIATE_CLASS(Params);
^
src/caffe/parallel.cpp:439:19: error: explicit instantiation of non-template type ‘caffe::Params’
src/caffe/parallel.cpp:439:19: error: ‘Params’ is not a class template
INSTANTIATE_CLASS(Params);
^
src/caffe/parallel.cpp:439:19: error: explicit instantiation of non-template type ‘caffe::Params’
src/caffe/parallel.cpp:440:19: error: ‘GPUParams’ is not a class template
INSTANTIATE_CLASS(GPUParams);
^
src/caffe/parallel.cpp:440:19: error: explicit instantiation of non-template type ‘caffe::GPUParams’
src/caffe/parallel.cpp:440:19: error: ‘GPUParams’ is not a class template
INSTANTIATE_CLASS(GPUParams);
^
src/caffe/parallel.cpp:440:19: error: explicit instantiation of non-template type ‘caffe::GPUParams’
src/caffe/parallel.cpp:441:19: error: ‘P2PSync’ is not a class template
INSTANTIATE_CLASS(P2PSync);
^
src/caffe/parallel.cpp:441:19: error: explicit instantiation of non-template type ‘caffe::P2PSync’
src/caffe/parallel.cpp:441:19: error: ‘P2PSync’ is not a class template
INSTANTIATE_CLASS(P2PSync);
^
src/caffe/parallel.cpp:441:19: error: explicit instantiation of non-template type ‘caffe::P2PSync’
make: *** [.build_release/src/caffe/parallel.o] Error 1
Makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1
# Uncomment if you're using OpenCV 3
OPENCV_VERSION := 3
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the lines after *_35 for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
# BLAS := atlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
#PYTHON_INCLUDE := /usr/include/python2.7 \
# /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := /home/SGM/anaconda3
PYTHON_INCLUDE := /home/SGM/anaconda3/include \
/home/SGM/anaconda3/include/python3.6m \
/home/SGM/anaconda3/lib/python3.6/site-packages/numpy/core/include
# Uncomment to use Python 3 (default is Python 2)
PYTHON_LIBRARIES := boost_python3 python3.6m
PYTHON_INCLUDE := /home/SGM/anaconda3/include/python3.6m \
/home/SGM/anaconda3/lib/python3.6/site-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib
# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/hdf5/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/hdf5/lib /home/SGM/anaconda3/lib/
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib
# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1
# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
# enable pretty build (comment to see full commands)
Q ?= #
When you change the environment,have you edit the path in Makefile.config?
Please make the python path correct and make sure cudnn is installed,if you want to compile with cuDNN.
Not very clear with your issue, try comment USE_CUDNN := 1

How to pass a string from a make file into a c++ program

It seems on a program I've inherited we can pass in make variables that are numbers but I'd like to pass in a string now. When they are passed in as numbers it is as the following:
CFLAGS += -DBUILD_NUMBER=$(BUILD_NUMBER)
and i can access it as an int like so:
fprintf(stderr, "\n%s v%d.%d.%d.%d\n", APPNAME, MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION, BUILD_NUMBER, MYBRANCH);
but I do not seem to be achieving the same with a string.
CFLAGS += -DMYBRANCH=$(BRANCH)
fprintf(stderr, "\n%s v%d.%d.%d.%d.%s\n", APPNAME, MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION, BUILD_NUMBER, MYBRANCH);
I get this error with the above:
main.cpp: In function ‘int args_parse_cmd_line(int, char**)’:
<command-line>:0:10: error: ‘FIL’ was not declared in this scope
main.cpp:72:114: note: in expansion of macro ‘MYBRANCH’
%s\n", APPNAME, MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION, BUILD_NUMBER, MYBRANCH);
^~~~~~~~
Can someone give me a tip on what I'm doing wrong? "FIL-1234" is the example of our branch name that I'm trying to add to our build meta data for tractability.
This preprocessor trick should work
#define xstr(s) str(s)
#define str(s) #s
fprintf(stderr, "\n%s v%d.%d.%d.%d.%s\n", APPNAME, MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION, BUILD_NUMBER, xstr(MYBRANCH));
It's clear from your error that MYBRANCH is being expanded into FIL-1234 when, not unreasonably, the compiler looks for a variable FIL. You need to turn the macro expansion into a string literal and the code above should do that. Although I haven't tested anything.
Not sure if this is ideal but it works.
CFLAGS += -DMYBRANCH=\"$(BRANCH)\"
I think John's solution is attractive as I'm not crazy about escaping characters.

Function in if statement: error expected expression

I want to compile following file:
https://gist.github.com/bodokaiser/5382281
which does not succeed because I get following error:
CXX(target) Release/obj.target/parser/src/parser/parser.o
In file included from ../src/parser/parser.cc:2:
../src/parser/calc_head_size.cc:67:16: error: expected expression
if (mask || isMasking(masking)) {
^
1 error generated.
make: *** [Release/obj.target/parser/src/parser/parser.o] Error 1
This does not make sense to me. Can it be that there is something else wrong?
Bodo
You seem to have a strange character in your source code that looks like a space but isn't. In this line:
if (mask || isMasking(masking)) {
// ^ here
try to delete the "space" and add a real space.