I'm trying to build open source program and getting this error:
$ make
mkdir -p ../Obj/FFS_GCC_Make_Release/ffs/src/base/
g++ -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread `pkg-config --cflags gtk+-2.0` -c base/algorithm.cpp -o ../Obj/FFS_GCC_Make_Release/ffs/src/base/algorithm.o
In file included from base/../fs/abstract.h:13:0,
from base/structures.h:14,
from base/file_hierarchy.h:20,
from base/algorithm.h:11,
from base/algorithm.cpp:7:
../../zen/serialize.h:35:45: error: ‘byte’ is not a member of ‘std’
using value_type = std::vector<std::byte>::value_type;
^~~~
compilation terminated due to -Wfatal-errors.
Makefile:108: recipe for target '../Obj/FFS_GCC_Make_Release/ffs/src/base/algorithm.o' failed
make: *** [../Obj/FFS_GCC_Make_Release/ffs/src/base/algorithm.o] Error 1
This source file contains #include <cstdint>
Here is a problem part of code:
using value_type = std::vector<std::byte>::value_type;
How to reproduce: Download FreeFileSync source from official website, unpack
cd FreeFileSync_10.4_Source\FreeFileSync\Source
make
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) under Windows Subsystem for Linux
Add #include <cstddef> into serialize.h and ring_buffer.h
cd ../../zen/
grep -q -F '<cstddef>' serialize.h || sed -i '1s/^/#include <cstddef>\n/' serialize.h
grep -q -F '<cstddef>' ring_buffer.h || sed -i '1s/^/#include <cstddef>\n/' ring_buffer.h
std::byte is implemented since C++17. You may check your compiler version.
Related
Trying to install PktGen with DPDK 21.11, however I am getting the below error
[1/69] Compiling C object lib/common/libcommon.a.p/copyright_info.c.o
FAILED: lib/common/libcommon.a.p/copyright_info.c.o
cc -Ilib/common/libcommon.a.p -Ilib/common -I../lib/common -I/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -O3 -march=native -mavx -mavx2 -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE -Wno-pedantic -Wno-format-truncation -fPIC -include rte_config.h -march=native -mno-avx512f -MD -MQ lib/common/libcommon.a.p/copyright_info.c.o -MF lib/common/libcommon.a.p/copyright_info.c.o.d -o lib/common/libcommon.a.p/copyright_info.c.o -c ../lib/common/copyright_info.c
cc1: fatal error: rte_config.h: No such file or directory
compilation terminated.
I think I am missing some environmental variable?
23:45:08 [root:~/Pktgen-DPDK] dev* ± echo $RTE_SDK
/root/repo/gNB_CU/ngp/thirdparty/dpdk/dpdk-21.11/
23:45:41 [root:~/Pktgen-DPDK] dev* ± echo $RTE_TARGET
x86_64-native-linux-gcc
23:45:46 [root:~/Pktgen-DPDK] dev* ± pkg-config --libs libdpdk
-Wl,--as-needed -L/lib64 -lrte_node -lrte_graph -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_pdump -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_dmadev -lrte_regexdev -lrte_rawdev -lrte_power -lrte_pcapng -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_gpudev -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bpf -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
23:45:54 [root:~/Pktgen-DPDK] dev* ± pkg-config --cflags libdpdk
-I/include -include rte_config.h -march=native -mno-avx512f
23:46:06 [root:~/Pktgen-DPDK] dev* ±
Any suggestion where I might have gone wrong?
Problem was in DPDK installation path.
wget http://fast.dpdk.org/rel/dpdk-21.11.tar.xz
tar -xf dpdk-21.11.tar.xz
cd dpdk-21.11/
meson -Dexamples=all build
ninja -C build
cd build
ninja install
ldconfig
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/
Once this was done, installation was successful.
I am trying to compile a program mafTools on MacOSX using gnu make. I get the following error:
cd mafExtractor && make all
clang -std=c99 -stdlib=libstdc++ -O3 -c -O3 -Wall -Werror --pedantic -funroll-loops -DNDEBUG -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -I ../../sonLib/lib -I ../inc -I ../external src/mafExtractorAPI.c -o src/mafExtractorAPI.o.tmp -lm
This gives the error:
clang: error: -lm: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make[1]: \*** [src/mafExtractorAPI.o] Error 1
make: \*** [mafExtractor.all] Error 2
I looked at similar errors but couldn't fix it. Any help will be much appreciated. Thanks!
This is the package: https://github.com/dentearl/mafTools/tree/master/mafExtractor
Everything else here compiled successfully.
This is the makefile:
https://github.com/dentearl/mafTools/blob/master/mafExtractor/Makefile
Thanks a bunch.
Your clang commaand includes the -c option which means you do not want to link and resolve external references, you just want to produce an unlinked object file.
Your -lm option says you want to link with the maths library.
Basically, the aforementioned options are incompatible - you cannot both link with the math library and not link.
TLDR; Remove -lm
I am trying to make using g++. At first, I upgraded my gcc version by compiling the package locally, and add some environment path to my ~/.bashrc
alias gcc='/home/rescape/lib/bin/gcc'
alias g++='/home/rescape/lib/bin/g++'
export CC=/home/rescape/lib/bin/gcc
export CPP=/home/rescape/lib/bin/cpp
export CXX=/home/rescape/lib/bin/c++
And I try g++ -v in terminal:
[rescape#iZ231twjza6Z mxnet]$ g++ -v
Using built-in specs.
COLLECT_GCC=/home/rescape/lib/bin/g++
COLLECT_LTO_WRAPPER=/home/rescape/lib/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib --prefix=/home/rescape/lib/
Thread model: posix
gcc version 4.8.0 (GCC)
Still, When I do make, such error message occurs:
[rescape#iZ231twjza6Z mxnet]$ make
g++ -std=c++0x -DMSHADOW_FORCE_STREAM -Wall -O3 -I./mshadow/ -I./dmlc-core/include -fPIC -Iinclude -msse3 -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMXNET_USE_OPENCV=1 `pkg-config --cflags opencv` -fopenmp -MM -MT build/resource.o src/resource.cc >build/resource.d
cc1plus: error: unrecognized command line option "-std=c++0x"
make: *** [build/resource.o] Error 1
Any suggestions of how to fix this? Thanks!
According to this:
[rescape#iZ231twjza6Z mxnet]$ make
g++ ...
You not use CXX variable in your Makefile, so just replace g++ with CXX in your Makefile. aliases works only when you enter commands in your shell, if you type g++ something.cpp bash execute /home/bin/g++ something.cpp, that's all, bash aliasing not help if external process (in our case make) execute g++
I am working on simple program of grayscaling using Opencl. When i compile, it gives me the following error.
make all
Building file: ../Test1.cpp
Invoking: GCC C++ Compiler 4.9.3 [armeb-linux-gnueabihf]
armeb-linux-gnueabihf-g++ -I/opt/AMDAPPSDK-3.0-0-Beta/include/ -I/opt/AMDAPPSDK-3.0-0-Beta/include/CL -I/opt/AMDAPPSDK-3.0-0-Beta/include/GL -I/opt/AMDAPPSDK-3.0-0-Beta/include/SDKUtil -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0 -o -MM -MMD -MP -MF"Test1.d" -MT"Test1.d" -o "Test1.o" "../Test1.cpp"
cc1plus: fatal error: Test1.d: No such file or directory
compilation terminated.
make: *** [Test1.o] Error 1
Compiler command with options:-
armeb-linux-gnueabihf-g++ -I/opt/AMDAPPSDK-3.0-0-Beta/include/ -I/opt/AMDAPPSDK-3.0-0-Beta/include/CL -I/opt/AMDAPPSDK-3.0-0-Beta/include/GL -I/opt/AMDAPPSDK-3.0-0-Beta/include/SDKUtil -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0 -o -MM
The actual command that is executed seems to have the output option -o twice. This option is supposed to be followed by a filename.
Please remove the output option -o from your command because eclipse seems to automatically add it.
I am compiling the C++ code using Android native library NDK but I am getting the following errors while trying to include the g729a.h file in g729_jni.cpp:
ERRORS:
Compile++ arm : g729_jni <= g729_jni.cpp
/usr/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi/objs/g729_jni/g729_jni.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/usr/src/android-ndk-r8/sources/cxx-stl/system/include -Ijni -DANDROID -O3 -Wa,--noexecstack -O2 -DNDEBUG -g -I/usr/src/android-ndk-r8/platforms/android-3/arch-arm/usr/include -c jni/g729_jni.cpp -o ./obj/local/armeabi/objs/g729_jni/g729_jni.o
In file included from jni/g729_jni.cpp:34:
jni/g729/g729a.h:70: error: 'UWord8' has not been declared
jni/g729/g729a.h:126: error: 'UWord8' has not been declared
jni/g729_jni.cpp: In function 'jint Java_org_sipdroid_codecs_G729_open(JNIEnv*, _jobject*)':
jni/g729_jni.cpp:72: error: 'UWord8' was not declared in this scope
jni/g729_jni.cpp: In function 'jint Java_org_sipdroid_codecs_G729_encode(JNIEnv*, _jobject*, _jshortArray*, jint, _jbyteArray*, jint)':
jni/g729_jni.cpp:111: error: 'UWord8' was not declared in this scope
jni/g729_jni.cpp:111: error: expected ';' before 'serial'
jni/g729_jni.cpp:125: error: 'serial' was not declared in this scope
jni/g729_jni.cpp: In function 'jint Java_org_sipdroid_codecs_G729_decode(JNIEnv*, _jobject*, _jbyteArray*, _jshortArray*, jint)':
jni/g729_jni.cpp:156: error: cannot convert 'unsigned char*' to 'int*' for argument '2' to 'void g729a_dec_process(void*, int*, Word16*, Flag)'
make: *** [obj/local/armeabi/objs/g729_jni/g729_jni.o] Error 1
I googled to try and find the reason behind this error. As C++ is case sensitive, if we make a mistake in upper and lower case, then this kind of error occurs. But I didn't make this kind of mistakes.
If you have any idea or suggestion then please guide me through that.
Thanks
UPDATE:
[root#localhost sipdroid-read-only]# /usr/src/android-ndk-r8/ndk-build V=1 APP_ABI=armeabi APP_PROJECT_PATH=. obj/local/armeabi/objs/g729_jni/g729_jni.o
make: `obj/local/armeabi/objs/g729_jni/g729_jni.o' is up to date.
Make sure your typedef.h is similar to http://siphon.googlecode.com/svn/trunk/g729a/Headers/typedef.h
Here are the steps I made to reproduce your problem:
svn checkout http://sipdroid.googlecode.com/svn/trunk/ sipdroid
cd sipdroid
sed "s/^SILK/include $(CLEAR_VARS)\\nSILK/" -i jni/Android.mk
(note that Android.mk needed a fix after line 89).
svn checkout http://siphon.googlecode.com/svn/trunk/ ../siphon
cp -d ../siphon/g729a/Headers/ jni/g729
wget http://pastie.org/pastes/4737332/download -O jni/g729/g729a.h
wget "http://sipdroid.googlecode.com/issues/attachment?aid=7963991223373796529&name=g729_jni.cpp&token=KHEZCoq6ZYSuV_VhsV8fC3uwsSs%3A1348058591979" -O jni/g729_jni.cpp
sed -e "s/g722_jni/g729_jni/" -i jni/Android.mk
ndk-build.cmd V=1 APP_ABI=armeabi APP_PROJECT_PATH=. obj/local/armeabi/objs/g729_jni/g729_jni.o
... and your file compiles with a small warning. What have you done differently?