error when building veins_inet: unexpected token - c++

I have a Windows 10 PC where I installed Veins 5.0 following the tutorial and therefore I have installed OMNeT++ 5.6.1. I have also INET 4.2.0 that has been installed after opening the OMNeT IDE for the first time. I can open successfully the simulations from OMNeT++, Veins and INET. Nevertheless, when it comes to build the veins_project of veins/subprojects I get the following error:
10:48:52 **** Incremental Build of configuration gcc-release for project veins_inet ****
make MODE=release all
make[1]: Entering directory '/c/src/veins-veins-5.0/subprojects/veins_inet/src'
veins_inet/VeinsInetApplicationBase.cc
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `clang++ -c -std=c++11 -O3 -DNDEBUG=1 -MMD -MP -MF ../out/clang-release/src/veins_inet/VeinsInetApplicationBase.o.d -isystem /usr/include -isystem /mingw64/include -Wno-deprecated-register -Wno-unused-function -fno-omit-frame-pointer -DXMLPARSER=libxml -DPREFER_QTENV -DWITH_QTENV -DWITH_PARSIM -DWITH_NETBUILDER -DWITH_OSG -DWITH_OSGEARTH -DVEINS_INET_EXPORT -DINET_IMPORT -DVEINS_IMPORT -DVEINS_INET_EXPORT -I"C:/src/veins-veins-5.0/subprojects/veins_inet/src" -I"C:/src/veins-veins-5.0/src" -I"C:/src/inet4/src" -I. -IC:/Universidad/2019-2020 (Master)/1B - Quadrimestre Primavera/TFM/OMNET/inet/src -IC:/src/veins-veins-5.0/src -I. -IC:/src/omnetpp-5.6.1/include -o ../out/clang-release/src/veins_inet/VeinsInetApplicationBase.o veins_inet/VeinsInetApplicationBase.cc'
make[1]: *** [Makefile:153: ../out/clang-release/src/veins_inet/VeinsInetApplicationBase.o] Error 1
make[1]: Leaving directory '/c/src/veins-veins-5.0/subprojects/veins_inet/src'
make: *** [Makefile:36: all] Error 2
"make MODE=release all" terminated with exit code 2. Build might be incomplete.
10:48:53 Build Failed. 2 errors, 0 warnings. (took 942ms)
Does anyone experience something similar?

It's clear the problem is in your command line
clang++ -c -std=c++11 ... -IC:/Universidad/2019-2020 (Master)/1B ...
Don't put parentheses or spaces in folder names. It's only likely to lead to confusion.

Related

Cannot convert ‘bool’ to ‘gzFile {aka gzFile_s*}’

I am new to Linux environments, and trying to install a bioinformatics package (vcftools - https://vcftools.github.io/examples.html). For some reason I can compile without a problem in a Cygwin environment, other colleagues have installed the package without a glitch, but i get an error (per below) if I try to compile in an Ubuntu environment in a VirtualBox on the same computer. I get the following error. Does anyone have a suggestion on how to resolve this error?
$make install
output
Installing VCF tools
make[1]: Entering directory '/home/wde/selt/selectionTools/vcftools_0.1.11/cpp'
g++ -c -O2 -D_FILE_OFFSET_BITS=64 vcftools.cpp -o vcftools.o
g++ -MM -O2 -D_FILE_OFFSET_BITS=64 vcftools.cpp > vcftools.d
g++ -c -O2 -D_FILE_OFFSET_BITS=64 bcf_file.cpp -o bcf_file.o
g++ -MM -O2 -D_FILE_OFFSET_BITS=64 bcf_file.cpp > bcf_file.d
g++ -c -O2 -D_FILE_OFFSET_BITS=64 vcf_file.cpp -o vcf_file.o
vcf_file.cpp: In constructor ‘vcf_file::vcf_file()’:
**vcf_file.cpp:25:13: **error: cannot convert ‘bool’** to ‘gzFile {aka gzFile_s*}’ in assignment**
gzvcf_in = false;
^~~~~
Makefile:53: recipe for target 'vcf_file.o' failed
make[1]: *** [vcf_file.o] Error 1
make[1]: Leaving directory '/home/wde/selt/selectionTools/vcftools_0.1.11/cpp'
/bin/sh: 2: cd: can't cd to perl
Makefile:24: recipe for target 'install' failed
make: *** [install] Error 2
error with make
Basically what the makefile does is automating the calls to the compiler.
Thus, the output from the makefile is similar to usual compile errors you get, compiling a source file from within the command line.
The important line from the error log above is:
vcf_file.cpp: In constructor ‘vcf_file::vcf_file()’:
**vcf_file.cpp:25:13: **error: cannot convert ‘bool’** to ‘gzFile {aka gzFile_s*}’ in assignment**
gzvcf_in = false;
gzvcf_in is of type pointer to gzFile_s. Assigning a bool variable to a pointer type won't compile.
Thus, the error message. Replace, inside the vcf_file.cpp, false with the pointer literal std::nullptr or the macro NULL and re-run the makefile.
Btw. I checked the vcf_file.cpp file in the github repo from vcf. They do not contain the line leading to the above error. May you have an outdated / modified version, introducing the compiler error.

/bin/sh: -c: line 0: syntax error near unexpected token `(' and other strange errors

I have a very strange error compiling my C++ code.
Situation: I have a big project that uses PCL, OpenCV, VTK, ANN... and is actually working on Linux.
Now, I'm trying to set up the project in MAC OSX but there are some problems. I installed all needed libraries, and it seems that all dependencies are linked but when I try to compile the project some strange errors appears:
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `/Library/Developer/CommandLineTools/usr/bin/c++ -DDISABLE_OPENNI -DEIGEN_USE_NEW_STDVECTOR -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -DFLANN_STATIC -DvtkDomainsChemistry_AUTOINIT="1(vtkDomainsChemistryOpenGL2)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL2)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL2)" -pg -g -I/usr/local/include/vtk-6.3 -I/usr/local/lib/ann_1.1.2/include -I/usr/local/include/pcl-1.6 -I/usr/local/include/eigen3 -I/usr/local/include -I/usr/local/Cellar/flann/1.8.4_1/include -I/usr/local/include/opencv vtkDomainsChemistry_AUTOINIT=1(vtkDomainsChemistryOpenGL2) vtkRenderingContext2D_AUTOINIT=1(vtkRenderingContextOpenGL2) vtkRenderingCore_AUTOINIT=3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2) vtkRenderingVolume_AUTOINIT=1(vtkRenderingVolumeOpenGL2) -msse4.1 -mfpmath=sse -o CMakeFiles/Pipeline.dir/main.cpp.o -c /Users/ferran/ViCOROB/PROJECTS/Pipeline/main.cpp'
make[3]: /bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `/Library/Developer/CommandLineTools/usr/bin/c++ -DDISABLE_OPENNI -DEIGEN_USE_NEW_STDVECTOR -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -DFLANN_STATIC -DvtkDomainsChemistry_AUTOINIT="1(vtkDomainsChemistryOpenGL2)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL2)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL2)" -pg -g -I/usr/local/include/vtk-6.3 -I/usr/local/lib/ann_1.1.2/include -I/usr/local/include/pcl-1.6 -I/usr/local/include/eigen3 -I/usr/local/include -I/usr/local/Cellar/flann/1.8.4_1/include -I/usr/local/include/opencv vtkDomainsChemistry_AUTOINIT=1(vtkDomainsChemistryOpenGL2) vtkRenderingContext2D_AUTOINIT=1(vtkRenderingContextOpenGL2) vtkRenderingCore_AUTOINIT=3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2) vtkRenderingVolume_AUTOINIT=1(vtkRenderingVolumeOpenGL2) -msse4.1 -mfpmath=sse -o CMakeFiles/Pipeline.dir/data.cpp.o -c /Users/ferran/ViCOROB/PROJECTS/Pipeline/data.cpp'
*** [CMakeFiles/Pipeline.dir/main.cpp.o] Error 2
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [CMakeFiles/Pipeline.dir/data.cpp.o] Error 2
make[2]: *** [CMakeFiles/Pipeline.dir/all] Error 2
make[1]: *** [CMakeFiles/Pipeline.dir/rule] Error 2
I searched through the Internet, but I couldn't find any reference for this specific problem.
Any suggestion?

Error building wxWidgets using -j (jobs) option with MinGW

I'm compiling WxWidgets for Windows using the following command line:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 -j6
The last parameter (-j) is used to speed up the compilation by running multiple jobs in parallel, in my case making full use of my 6-core processor. A single-threaded build normally takes very long.
However, I get the following output when hitting Enter:
if not exist gcc_mswudll mkdir gcc_mswudll
if not exist ..\..\lib\gcc_dll mkdir ..\..\lib\gcc_dll
if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\msw
u -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/
regcomp.c
The system can not find the path specified.
0 file(s) copied.
makefile.gcc:5651: recipe for target '..\..\lib\gcc_dll\mswu\wx\setup.h' failed
mingw32-make: *** [..\..\lib\gcc_dll\mswu\wx\setup.h] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from ..\..\include/wx/defs.h:27:0,
from ../../src/regex/regcustom.h:39,
from ../../src/regex/regguts.h:38,
from ../../src/regex/regcomp.c:33:
..\..\include/wx/platform.h:183:22: fatal error: wx/setup.h: No such file or directory
#include "wx/setup.h"
^
compilation terminated.
makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Then, if I just repeat the same command a second time, the following output is shown:
if not exist ..\..\lib\gcc_dll\mswu mkdir ..\..\lib\gcc_dll\mswu
if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\msw
u -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/
regcompThe system can not find the path specified.
.c
0 file(s) copied.
makefile.gcc:5651: recipe for target '..\..\lib\gcc_dll\mswu\wx\setup.h' failed
mingw32-make: *** [..\..\lib\gcc_dll\mswu\wx\setup.h] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from ..\..\include/wx/defs.h:27:0,
from ../../src/regex/regcustom.h:39,
from ../../src/regex/regguts.h:38,
from ../../src/regex/regcomp.c:33:
..\..\include/wx/platform.h:183:22: fatal error: wx/setup.h: No such file or directory
#include "wx/setup.h"
^
compilation terminated.
makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Then... If I try a third time, the compilation finishes successfully.
Question: Is it ok to follow this procedure to build WxWidgets in parallel, or is there a possibility that it will lead to problems when using the compiled binaries later on?
Unfortunately there is indeed a bug in MSW makefiles with missing dependencies of the various libraries on setup_h target. It should be safe to do make setup_h first and then make -jN.
Alternatively, you could build using configure as explained in this old but still valid post, then just make -jN works perfectly fine.

Can't build test application with WxWIdgets in Netbeans

I'm a total c++ Newbie.
I'm trying to build windows aplications with Wx-Widgets under Net Beans.
So far so good. I have instaled everything, configured, build wx-widgets and attached it to the new project - with help of a good man here: Can't make wx-widget work with net-beans.
Now I try to build my first app:
#include <wx/string.h>
int main(int argc, char **argv)
{
wxPuts(wxT("A wxWidgets console application"));
}
and this is what I get:
I'm not sure if this is readable so I paste the errors:
g++ `C:\WXWIN\wx-config --cxxflags` -c -g -I../../../WXWIN/include `C:\WXWIN\wx-config --cxxflags` -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
/bin/sh.exe: C:WXWINwx-config: command not found
/bin/sh.exe: C:WXWINwx-config: command not found
In file included from ../../../WXWIN/include/wx/defs.h:21:0,
from ../../../WXWIN/include/wx/string.h:25,
from main.cpp:1:
../../../WXWIN/include/wx/platform.h:196:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
make[1]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
BUILD FAILED (exit value 2, total time: 859ms)
Please notice that I have set everything in linker and compiler like ordered: http://wiki.wxwidgets.org/Compiling_using_Netbeans
The error is right in front of you: "command not found". If you use /bin/sh, you must use Unix style paths, e.g. C:/WXWIN/wx-config instead of DOS paths with the backslashes.
I seriously advise you to get familiar with the environment you're using instead of just following the Wiki instructions without understanding them, otherwise your problems won't be over any time soon.

make: *** [src/Class.o] Error 1 eclipse

ok so i installed CDT for C++ development on my machine. I tried to make it work and followed these instructions to set everything up. By mistake i have gone into the Project>Properties>C++ Build>Enviorement and hit restore defaults by mistake. I dont know if that changed anything but i get the following error when i run my class.
I tried to switch the slashes in the given path "C:\Users\Nathan\workspace\Project\Debug" to forward slashes but that did nothing. I still get the same error. Any hints on what im doing wrong?
19:12:58 **** Incremental Build of configuration Debug for project Project ****
make all
Building file: ../src/Project.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Project.d" -MT"src/Project.d" -o "src/Project.o" "../src/Project.cpp"
cygwin warning:
MS-DOS style path detected: C:\Users\Nathan\workspace\Project\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Nathan/workspace/Project/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/cwchar:44:0,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/postypes.h:42,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/iosfwd:42,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/ios:39,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/ostream:40,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/iostream:40,
from ../src/Project.cpp:9:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/cstddef:44:20: fatal error: stddef.h: No such file or directory
src/subdir.mk:18: recipe for target `src/Project.o' failed
compilation terminated.
make: *** [src/Project.o] Error 1
19:12:59 Build Finished (took 535ms)