Undefined reference to `XF86VidModeQueryExtension' - cmake

I am trying to compile libfreenect2 from libfreenect2 and it turns out that when I run the make file after having done cmake CMakeLists.txt in step 5, I keep having the following errors:
Linking CXX executable /home/lex/libfreenect2/examples/protonect/bin/Protonect
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeQueryExtension'
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeGetGammaRampSize'
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeGetGammaRamp'
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeSetGammaRamp'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/lex/libfreenect2/examples/protonect/bin/Protonect] Error 1
make[1]: *** [CMakeFiles/Protonect.dir/all] Error 2
make: *** [all] Error 2
Does anyone have any idea on how to fix this?

Your program appears to depend upon libXxf86vm. You will need to add something like
-lXxf86vm
to the link command line. Be sure to install the development package. I am surprised the CMakeLists.txt did not have this.

Installing Mesa3D seems to fix my issue. It's something that probably had to do with the dependencies of libfreenect2 during the cmake installation.

Related

Why can I not update to the newest version of libtorch?

I followed the tutorial here to make a c++ front-end application for pytorch:
https://pytorch.org/tutorials/advanced/cpp_frontend.html
I used GPU version. I could succesfully cmake and make.
Now I updated to the latest version of libtorch. I can still cmake, but on make, I get the following error:
[willem#int2 build]$ make
make[2]: *** No rule to make target `/sw/arch/RedHatEnterpriseServer7/EB_production/2019/software/cuDNN/7.6.5.32-CUDA-10.1.243/include/lib64', needed by `polIter'. Stop.
make[1]: *** [CMakeFiles/polIter.dir/all] Error 2
make: *** [all] Error 2
My cmake command is:
cmake -DCMAKE_PREFIX_PATH=~/libtorch1.8.1/share/cmake/Torch/
-DCMAKE_MODULE_PATH=/home/willemvj/libtorch1.8.1/share/cmake/Torch/
-DCUDNN_LIBRARY_PATH=$EBROOTCUDNN/include/lib64
-DCUDNN_INCLUDE_DIR=$EBROOTCUDNN/include -DCUDNN_LIBRARY=$EBROOTCUDNN/lib64
/libcudnn.so.7 .. #
Any ideas on what is causing this?

Error in building CGAL example Triangulation_2

I installed CGAL and tried to follow manual, but I failed to build example Triangulation_2. I used terminal in mac and run the code.
[ 50%] Building CXX object CMakeFiles/draw_triangulation_2.dir/draw_triangulation_2.cpp.o
In file included from /Users/janeh/Downloads/CGAL-5.0.2/examples/Triangulation_2/draw_triangulation_2.cpp:3:
/usr/local/include/CGAL/draw_triangulation_2.h:16:10: fatal error:
'CGAL/Qt/Basic_viewer_qt.h' file not found
#include <CGAL/Qt/Basic_viewer_qt.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/draw_triangulation_2.dir/draw_triangulation_2.cpp.o] Error 1
make[1]: *** [CMakeFiles/draw_triangulation_2.dir/all] Error 2
I checked Basic_viewer_qt.h and it is at the right location
/Users/janeh/Downloads/CGAL-5.0.2/include/CGAL/Qt/Basic_viewer_qt.h
But somehow draw_triangulation_2.h can't include it. Is there any reason why this happens?

ld unrecognised emulation mode aarch64linux

When running make in CMake, I only get an error that says /usr/bin/ld unrecognised emulation mode aarch64linux.
Im trying to build DualBootPatcher app for Android, this is the error:
/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [misc/CMakeFiles/fsck-wrapper.dir/build.make:76: misc/fsck-wrapper] Error 1
make[4]: *** [CMakeFiles/Makefile2:1786: misc/CMakeFiles/fsck-wrapper.dir/all] Error 2
make[3]: *** [Makefile:163: all] Error 2
make[2]: *** [android/CMakeFiles/android-system_arm64-v8a.dir/build.make:111: android/android-system_arm64-v8a-prefix/src/android-system_arm64-v8a-stamp/android-system_arm64-v8a-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1868: android/CMakeFiles/android-system_arm64-v8a.dir/all] Error 2
make: *** [Makefile:163: all] Error 2>
Im running latest Cmake and binutils. Also tried reinstalling binutils.
Im NOT a developers, so it would be nice if you could explain it^^
Does anyone has a solution?
The issue is clear from the fact that the output is coming from /usr/bin/ld. This is the system ld, rather than the ld included with the NDK. You should investigate why this ld is being executed instead, for example via strace.
For me it turned out to be a file permissions issue - the NDK zip file had extracted without execute permissions, so the toolchain binaries were silently ignored. A few chmod +x later and all was well.

Build Apache on vista

I try to build Apache2.4.9 by MINGW on VISTA.
When I make it following messages are showed.
mod_proxy.c:2700:1: error: initializer element is not constant
In file included from c:/devel/apache/httpd-2.4.9/include/util_mutex.h:30:0,
from mod_proxy.h:47,
from mod_proxy.c:17:
Does anyone know how to fix this?
I configured it with following command line.
./configure --prefix=/c/opt/apache --with-apr=/c/opt/apache --with-apr-util=/c/opt/apache --with-pcre=/c/opt/pcre --with-ssl=/c/opt/openssl --disable-ratelimit --disable-mod_proxy
If I change to Apache2.4.7 and run make following messages are showed.
modules/generators/.libs/libmod_status.a(mod_status.o): In function `status_hand
ler':
c:\devel\apache\httpd-2.2.27\modules\generators/mod_status.c:825: undefined refe
rence to `_imp__ap_run_status_hook#8'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [httpd] Error 1
I can't solve these.

(Linux) Unable to link archives via cmake

On the command line, the following produces an executable:
g++ -o a.out main.cpp class1.cc class2.cc /usr/lib/libgsl.a /usr/lib/libgslcblas.a
However I am unsure how to get cmake to work properly.
When I add a line like
include_directories(/usr/lib/)
link_libraries(usr/lib/libgsl.a usr/libgslcblas.a)
the configuring seems to work but building fails:
CMakeFiles/kmv.dir/main.o: In function `main':
main.cpp:27: undefined reference to `gsl_matrix_alloc'
main.cpp:35: undefined reference to `gsl_matrix_fscanf'
collect2: ld returned 1 exit status
make[2]: *** [kmv] Error 1
make[1]: *** [CMakeFiles/kmv.dir/all] Error 2
make: *** [all] Error 2
*** Failed ***
Seems to be a synthax problem. Any hint is welcome. Thank you.
Instead of
include_directories(/usr/lib)
link_libraries(usr/lib/libgsl.a usr/libgslcblas.a)
try
add_executable (targetName main.cpp class1.cc class2.cc)
target_link_libraries(targetName gsl gslcblas)
Where targetName is the name of the output binary you intend to create. The path /usr/lib should already be in the default library search path for CMake, so you shouldn't have to specify that, but if you did have to specify a custom library path, you would do it like so
link_directories(/some/custom/library/path)
The include_directories CMake directive is used for adding header search paths, not library search paths...
Probably, link_libraries is deprecated
http://www.cmake.org/pipermail/cmake/2009-April/028439.html
Try using target_link_libraries instead.