I am trying to use the geos library on a Raspbery Pi 3, using Debian. I am trying to compile a program in C ++.
The same program can be compiled on other computers, this means that the source code of my program is correct.
When executing the command geos-config --version, version 3.7.1 is returned to me.
A while ago, a friend compiled and has been using the same code in Raspibian. However, I can't run it on Debian. My friend does not remember how he installed the geos library.
Would anyone know of anything that could help me?
make
Building target using GCC compiler: sources/geometry-manager.cpp
g++ -g -c sources/geometry-manager.cpp -std=c++17 -w -c -rdynamic -W `wx-config --cxxflags --libs --gl-libs` `geos-config --cflags` -lgeos -lglut -lGLU -lGL -lm -lGLEW -o builded/geometry-manager.o `pkg-config --libs geographiclib`
In file included from sources/geometry-manager.cpp:14:
sources/../include/geometry-manager.hpp:26:10: fatal error: geos.h: No such file or directory
#include <geos.h>
^~~~~~~~
compilation terminated.
make: *** [Makefile:37: builded/geometry-manager.o] Error 1
geos-config --includes : /usr/include.
geos-config --cflags : -I/usr/include.
geos-config --libs : -L/usr/lib/aarcg64-linux-gnu -lgeos-3.7.1 .
I installed via apt-get. However, as it didn't work, I installed it from the cloned github repository. –
Solution:
I uninstalled geos from my computer. Afterwards, I deleted all the folders related to geos that were still on the computer.
For some reason, the installation from the current repository did not work. So I cloned an old version of the geos.
https://github.com/libgeos/geos.git
I ran autogen.sh script (which didn't work before).
And this time it compiled and installed it successfully.
Thanks
Related
I'm using Debian 11, I installed Mingw and built WxWidgets with the following command:
../configure --prefix=/usr/x86_64-w64-mingw32 --host=x86_64-w64-ming32 --build=x86_64-linux --with-msw && make && sudo make install
And I'm using the following command to build:
x86_64-w64-mingw32-g++ wx.cpp `wx-config --cxxflags --libs std,aui`
I receive the following error:
wx/msw/libraries.h: not found
But file exists at: /usr/x86_64-w64-mingw32/include/wx-3.2/wx/msw/libraries.h
Where am I going wrong?
PS: I don't use any kind of IDE.
Friends, it finally worked, that's what you said above, the wx-config that is linked to the terminal, is only for linux, what was with the compilation for Windows inside /usr/x86_64-w64-mingw32/bin /wx-config.
When I want to compile for linux I pass:
g++ wx.cpp `wx-config --cxxflags --libs std,aui`
When I go to Windows I pass:
x86_64-w64-mingw32-g++ wx.cpp `/usr/x86_64-w64-mingw32/bin/wx-config --cxxflags --libs std,aui`
PS: I had to copy some dlls to the application folder, but it all worked out.
Thank you very much for everyone's patience.
I can cross compile a simple C++ program. (ex. g++ -o test test.cpp & arm-linux-gnueabihf-g++ -o test test.cpp).
But when I include OpenCV header files in a C++ program and cross compile it, it throws an error.(ex. arm-linux-gnueabihf-g++ -o ocv_test ocv_test.cpp $(pkg-config --libs --cflags opencv)).
Also I can compile successfully with the default compiler i.e. g++.(ex. g++ -o ocv_test ocv_test.cpp $(pkg-config --libs --cflags opencv))
I executed cmake with
-D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm.toolchain.cmake \.
as per the opencv docs. That didn't help.
I added opencv include dir in compilation cmd ie -I/path/to/opencv/include and removing pkg-config. That didn't help.
I tried changing arm-gnueabi.toolchain.cmake by exporting PKG_CONFIG_LIBDIR as per suggestion by someone. That didn't help.
I got the following error:
__/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lopencv_shape
//usr/local/lib/libopencv_stitching.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status__
I want my cross-compiled OpenCV app to run on a RaspberryPI.
I'm confused. Cross compiling OpenCV sources with the -D CMAKE_TOOLCHAIN_FILE option should allow us to cross-compile OpenCV C++ programs. Otherwise we will have to cmake or make (cross-compile) every OpenCV C++ program seperately on a build machine.
I have read all of the related questions with no success trying anything mentioned anywhere. I am new to cross-compiling and have been working on this for over a week with no progress. So please forgive me if you think I am stupid or have overlooked something.
So I have an application running in C++ that works great on my development computer running Ubuntu 14.04 x64. I am trying to cross compile for my Banana Pro running Lubuntu. Based on the documentation from Lemaker I am supposed to cross compile using "arm-linux-gnueabihf-"
So far the farthest I have been able to get is to :
/usr/local/opencv-arm/usr/local/lib/libopencv_calib3d.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
I get this error regardless of what command I run, Here is a list of commands I have tried:
arm-linux-gnueabihf-g++ `arm-linux-gnueabihf-pkg-config arm-opencv --cflags` -Wall test.cpp -o vis-300 `arm-linux-gnueabihf-pkg-config arm-opencv --libs`
arm-linux-gnueabihf-g++ `pkg-config arm-opencv --cflags` -Wall test.cpp -o vis-300 `pkg-config arm-opencv --libs`
arm-linux-gnueabihf-gcc `pkg-config arm-opencv --cflags` -Wall test.cpp -o vis-300 `pkg-config arm-opencv --libs`
arm-linux-gnueabihf-g++ `pkg-config arm-opencv --cflags` test.cpp -o vis-300 `pkg-config arm-opencv --libs`
And there have been many more commands before those with different errors such as:
arm-linux-gnueabihf-gcc: error trying to exec 'cc1plus': execvp: No such file or directory
arm-linux-gnueabihf-cpp fatal error too many input files
I have tried with just normal arm-linux-gnueabihf-gcc/g++, 4.6, 4.7, and 4.8
I have built opencv making small changes for hf using these 2 guides and both produced the same results:
http://processors.wiki.ti.com/index.php/Building_OpenCV_for_ARM_Cortex-A8
http://www.ridgesolutions.ie/index.php/2013/05/24/building-cross-compiling-opencv-for-linux-arm/
and not included in either I install it using this command because it will conflict with my current x86_64 install:
sudo make install DESTDIR=/usr/local/opencv-arm
Also the above pkg-config lines point to my custom pkg config file named arm-opencv.pc
# Package Information for pkg-config
prefix=/usr/local/opencv-arm/usr/local
exec_prefix=${prefix}
libdir=
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV-arm
Description: Open Source Computer Vision Library
Version: 2.4.10
Libs: ${exec_prefix}/lib/libopencv_calib3d.so ${exec_prefix}/lib/libopencv_contrib.so ${exec_prefix}/lib/libopencv_core.so ${exec_prefix}/lib/libopencv_features2d.so ${exec_prefix}/lib/libopencv_flann.so ${exec_prefix}/lib/libopencv_gpu.so ${exec_prefix}/lib/libopencv_highgui.so ${exec_prefix}/lib/libopencv_imgproc.so ${exec_prefix}/lib/libopencv_legacy.so ${exec_prefix}/lib/libopencv_ml.so ${exec_prefix}/lib/libopencv_nonfree.so ${exec_prefix}/lib/libopencv_objdetect.so ${exec_prefix}/lib/libopencv_ocl.so ${exec_prefix}/lib/libopencv_photo.so ${exec_prefix}/lib/libopencv_stitching.so ${exec_prefix}/lib/libopencv_superres.so ${exec_prefix}/lib/libopencv_ts.a ${exec_prefix}/lib/libopencv_video.so ${exec_prefix}/lib/libopencv_videostab.so -lrt -lpthread -lm -ldl
Cflags: -I${includedir_old} -I${includedir_new}
Anyways I have tried a lot of stuff short of just installing everything on the board itself and compiling there. Any help is much appreciated and keep in mind I have never successfully cross-compiled before. I always give up and compile on the board.
I installed GLFW3 and am trying to compile my OpenGL program with the following:
g++ -std=c++11 main.cpp -lGL -lGLEW -lglfw3
But here's the library error I get:
/usr/bin/ld: cannot find -lglfw3
collect2: error: ld returned 1 exit status
I also tried with pkg-config:
g++ `pkg-config --cflags glfw3 glew` -o myprog main.cpp `pkg-config --static --libs glfw3 glew`
it compiles but when I run myprog it says it can't find libglfw.so.3
But it is located in /usr/local/lib
http://www.brandonfoltz.com/2012/12/compile-glfw-on-ubuntu-and-fix-libglfw-so-cannot-open-error/
Ubuntu installs libglfw.so.3 in /usr/local/lib so you have to add this line to /etc/ld.so.conf
I had the same problem.
In my case was usefull following steps:
Download glfw source code
unzip it
cd glfw_folder
cmake . (with dot)
make
sudo make install
To check, copy and paste following command in your console "whereis libglfw3".
you should have output like this one: "libglfw3: /usr/local/lib/libglfw3.a" (or another path after ":").
My config: VAIO Pro 13/Ubuntu 16.04 LTS/ Intel HD4000.
P.S.: Yes, I'd tryed "sudo apt-get install libglfw3" and all dependenses.
I have been following this tutorial ( http://note.sonots.com/SciSoftware/haartraining.html ) to do some Haar training. I am currently stuck on merging the generate *.vec files. I am provided with this ( http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp.html ) script and a description of how to build it for Linux, but for Linux only.
I have installed Cygwin, placed mergevec.cpp file into openCV_dir/apps/haartraining and tried to compile it with the following command:
$ g++ 'pkg-config --libs --cflags opencv' -I. -o mergevec mergevec.cpp cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp cvhaartraining.cpp
I recieve following error:
$ g++: error: pkg-config --libs --cflags opencv: No such file or directory
Could someone tell me how should I properly compile it for Windows?
Working on Windows 7, Cygwin x64, OpenCV 2.4.6
I was able to get mergevec.exe from here:
http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp.html
It requires highgui100.dll and cxcore100.dll which I downloaded from:
http://www.dllme.com/