I downloaded Openni2 from github and run $make following the instruction in README. I got this error:
g++ -MD -MP -MT "./../../../Bin/Intermediate/x86-Release/libOpenNI2.jni.so/org_openni_NativeMethods.d ../../../Bin/Intermediate/x86-Release/libOpenNI2.jni.so/org_openni_NativeMethods.o" -c -msse3 -Wall -O2 -DNDEBUG -I. -I../../../Include -I../../../ThirdParty/PSCommon/XnLib/Include -fPIC -fvisibility=hidden -o ../../../Bin/Intermediate/x86-Release/libOpenNI2.jni.so/org_openni_NativeMethods.o org_openni_NativeMethods.cpp
g++ -o ../../../Bin/x86-Release/libOpenNI2.jni.so ./../../../Bin/Intermediate/x86-Release/libOpenNI2.jni.so/OpenNI.jni.o ./../../../Bin/Intermediate/x86-Release/libOpenNI2.jni.so/org_openni_NativeMethods.o -L../../../Bin/x86-Release -lOpenNI2 -Wl,--no-undefined -shared
/usr/lib/i386-linux-gnu/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local':
(.text+0x10): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
make[1]: *** [../../../Bin/x86-Release/libOpenNI2.jni.so] Error 1
make[1]: Leaving directory `/home/smalleyreaserch/OpenNI2/Wrappers/java/OpenNI.jni'
make: *** [Wrappers/java/OpenNI.jni] Error 2
I have all the required packages installed. Can anyone help me?
My system is Ubuntu 14.04 32 bits but the computer is 64 bits. would that be the reason why Im getting this error?
Some other people had this problem... but it was mainly in i686 computers... anyways, here is a possible solution.
First, make sure you have java and not openjava... I have read that this gives sometimes problems.
Secondly, use
export LDFLAGS+="-lc"
This should fix your problem, if not just leave a comment
Related
The project I am attempting compile is not in any way complex, and references nothing but the standard library and one self-contained library (everything compiles fine on another system). As indicated by the title, it can't even link against something in the standard library, due to things in there not having been compiled with -fPIC, supposedly. I didn't build it myself, nor do I want to, and reinstalling things with apt didn't seem to resolve the "recompile with -fPIC" issue.
I will say that I think one possible source of the issue is due to gcc-multilib or something being installed earlier, but I think that was purged. I don't know, maybe something was overwritten or a conflict arose. Might not even be related. Any ideas?
Running Ubuntu 18.04
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Nonsense.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Nonsense.o src/Nonsense.cpp
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Socket.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Socket.o src/Socket.cpp
g++ -shared -flto -o libNonsense.so obj/Nonsense.o obj/Socket.o -Llib -lenet
/usr/bin/x86_64-linux-gnu-ld: obj/Socket.o: relocation R_X86_64_PC32 against symbol `_ZTISt13runtime_error##GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
makefile:22: recipe for target 'libNonsense.so' failed
make: *** [libNonsense.so] Error 1
Apparently, it is compulsory to compile with the -fPIC flag in 64bits platform. If you are making a 32-bits project with linkink with 32-bits library; you don't need -fPIC.
Indeed, without -fPIC, the dynamic linker recalculates adresses for global variables and functions (which are not known in advance in the step of compilation). However, in a 64-bits system, it is not possible to use this technique as it is required to guess in advance the size of adress.
PIC (Position Independent Code), a more sophisticated and complicated process is used. https://eli.thegreenplace.net/2011/11/11/position-independent-code-pic-in-shared-libraries-on-x64 for explanations.
As the error message says, you need to recompile with -fPIC. Your current compiler command does not show the -fPIC option:
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Socket.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Socket.o src/Socket.cpp
Same for -flto by the way—this flag also has to be specified when compiling in order to be effective.
I want to use the hpc in our univerisity, but the gcc version of the system is too old to compile new packages that I need. So I want to install a new version gcc locally.
I downloaded the gcc-5.2.0 package and configured. When I make the files, there are some mistake, which lead to process killed. The last sentence before process killed is
/home/$USERNAME/software/gcc-5.2.0/host-x86_64-unknown-linux-gnu/prev-gcc/xg++ -B/home/$USERNAME/software/gcc-5.2.0/host-x86_64-unknown-linux-gnu/prev-gcc/ -B/home/$USERNAME/local/gcc-5.2.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/home/$USERNAME/software/gcc-5.2.0/libstdc++-v3/libsupc++ -L/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -c -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I/home/$USERNAME/local/gmp-4.3.2//include -I/home/$USERNAME/local/mpfr-2.4.2/include -I/home/$USERNAME/local/mpc-1.0.1//include -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/bid -I../libdecnumber -I../.././gcc/../libbacktrace -o insn-recog.o -MT insn-recog.o -MMD -MP -MF ./.deps/insn-recog.TPo insn-recog.c
and the error information is
xg++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
make[3]: *** [insn-recog.o] Error 4
make[3]: Leaving directory '/home/$USERNAME/software/gcc-5.2.0/host-x86_64-unknown-linux-gnu/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/$USERNAME/software/gcc-5.2.0'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory '/home/$USERNAME/software/gcc-5.2.0'
make: *** [all] Error 2
I have searched some question about this kind of problem, it seems that this is caused by not enough memory. But I run on a hpc with more than 20G memory free. So I don't what the problem is and how to solve it.
The OS version is Red Hat 4.4.7-3
The fact shows that it's still the memory problem. It seems that the login node doesn't use the swap memeory. I have to log into the test node to install softwares.
An internal compiler error (ICE) means that the compiler has detected a bug in itself. It might be that you're using some unusual code construct that causes the compiler to hit this bug. In any case, the first step you should do is to test with a newer compiler, in case the bug has already been fixed, as 5.2 that you're using now is still quite old. The latest version at the time of writing this is 7.2.
I gonna debugging kernel with QEMU to GDB.
I had commanded such as "make && sudo make install" on GDB though, Error have shown up.
Error Message:
make[1]: Leaving directory '/home/ubuntu/work/Kernel/linux-kernel/qemu/binutils-gdb/gdb'
g++ -std=gnu++11 -g -02 -I. -I. -I./common -I./config -DLOCALEDIR=""/usr/local/share/locale"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I./../zlib -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gnulib/import -Ibuild-gunlib/import -DTUI=1 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-write-strings -Wno-narrowing -Wformat-nonliteral -c -o dfp.o -MT dfp.o -MMD -MP -MF .deps/dfp.Tpo dfp.c
In file included from ../libdecnumber/decNumber.h:37:0,
from ../libdecnumber/dpd/decimal128.h:58,
from dfp.c:29:
../libdecnumber/decContext.h:54:61: fatal error: gstdint.h: No such file or directory
compilation terminated.
Makefile:1872: recipe for target 'dfp.o' failed
make: *** [dfp.o] Error 1enter code here
What should I do? Please, help me.
Thank you.
You need to run configure in the libdecnumber before building gdb.
I am using the Ubuntu 14.04 in virtual box and 64 bit OS
I try to cross compile Qt-everywhere 4.8.6 with a 'gcc-linaro-arm-linux-gnueabihf-4.7' cross compiler and get the following error while doing the 'make'
make[1]: Entering directory `/home/user/qt-everywhere-opensource-src-4.8.6
/src/corelib'
/usr/local/linaro/bin/arm-linux-gnueabihf-gcc (The path depends where the Toolchain has been installed) -c -pipe -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -fvisibility=hidden -Wall -W -D_REENTRANT -fPIC -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -I../../mkspecs/qws/linux-arm-linaro-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-static-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-static-emb-arm -o .obj/release-static-emb-arm/adler32.o ../3rdparty/zlib/adler32.c
/bin/sh: 1: Syntax error: word unexpected (expecting ")")
make[1]: *** [.obj/release-static-emb-arm/adler32.o] Error 2
make[1]: Leaving directory `/home/user/qt-everywhere-opensource-src-4.8.6/src/corelib'
make: *** [sub-corelib-install_subtargets-ordered] Error 2
The .configure script has no problems
Can anyone help out, what causes this?
This text doesn't belong in your call to gcc:
(The path depends where the Toolchain has been installed)
Remove that to get rid of the error.
I'm attempting to compile abiword in my Cygwin environment.
I have cygwin 1.7.25.
The compile fails regarding glib:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -I/usr/include/fribidi -
I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgsf-1 -I/usr/include/libxml2
-I/usr/include/wv -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -
I/usr/include/libpng15 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gtk-2.0 -
I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -
I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-unix-print-2.0 -I/usr/include/librsvg-2.0 -Wall -
Wextra -Wsign-compare -Wpointer-arith -Wchar-subscripts -Wwrite-strings -Wmissing-noreturn -
Wunused -Wpointer-arith -Wshadow -g -O2 -MT go-cmd-context.lo -MD -MP -MF .deps/go-cmd-
context.Tpo -c goffice/app/go-cmd-context.c -DDLL_EXPORT -DPIC -o .libs/go-cmd-context.o
In file included from ./goffice/app/goffice-app.h:25:0,
from ./goffice/app/go-cmd-context.h:24,
from goffice/app/go-cmd-context-impl.h:4,
from goffice/app/go-cmd-context.c:10:
/usr/include/glib-2.0/glib/gmacros.h:35:2: error: #error "Only <glib.h> can be included directly."
goffice/app/go-cmd-context.c: In function ‘go_cmd_context_get_type’:
goffice/app/go-cmd-context.c:147:3: warning: missing initializer [-Wmissing-field-initializers]
goffice/app/go-cmd-context.c:147:3: warning: (near initialization for ‘go_cmd_context_info.class_init’) [-Wmissing-field-initializers]
Makefile:503: recipe for target `go-cmd-context.lo' failed
make[3]: *** [go-cmd-context.lo] Error 1
make[3]: Leaving directory `/home/kingram/src/abiword-2.8.6/goffice-bits'
Makefile:409: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/kingram/src/abiword-2.8.6/goffice-bits'
Makefile:670: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kingram/src/abiword-2.8.6'
Makefile:473: recipe for target `all' failed
make: *** [all] Error 2
A google search produced a Redhat bug report suggesting that Glib 2.31 is required.
I'm considering downloading and compiling the latest glib from source as cygwin does not appear to be using it.
However, I'd like some insight on this choice or hear if there are some other experiences around this.
Actually, Glib 2.31 is the culprit; its headers changed so that only the top-level headers may be #included, not the individual class headers.
Cygwin does have the latest stable branch of Glib.
Therefore, in order to get this to compile, you would need to fix the #includes in the code, as indicated in the error messages.
However, I can save you the trouble: Abiword packages are available from Cygwin Ports.