Issues with wxwidgets and VSCode - c++

OS: linux
IDE: VSCode
complier: CMake but I can use another if better results are given
Hello I am wanting to learn how to apply c++ for cross platform development. I have chose to use WxWidgets, however, after compiling I ran into an issue, I could not integrate WxWidgets. I tried using vcpkg because it seemed simpler to integrate I ran the following after the ./vcpkg integrate install
cmake -DCMAKE_TOOLCHAIN_FILE=/home/places/vcpkg/scripts/buildsystems/vcpkg.cmake
I then got the issue
CMake Error at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
wxWidgets_INCLUDE_DIRS)
I pretty certain I am not missing the libraries and that the issue lies in configuration.
Here is part of my CMakeLists.txt
set(wxWidgets_CONFIGURATION mswu)`
SET(wxWidgets_ROOT_DIR "home/places/wxwidget/wxWidgets-3.1.4/")
SET(wxWidgets_LIBRARIES "home/places/wxwidget/wxWidgets-3.1.4/lib/")
SET(wxWidgets_LIB_DIR "home/places/wxWidgets-3.1.4/lib/libwx_baseu-3.1.so")
SET(wxWidgets_CONFIGURATION "mswd")
find_package(wxWidgets COMPONENTS core base REQUIRED)
include(${wxWidgets_USE_FILE})
I also tried the wxwidgets-vscode helloworld found here https://github.com/huckor/wxwidgets-vscode/blob/master/.vscode/launch.json
I really appreciate any help and thankyou.

Please do the following
Open the Terminal.
Do `cd </path/to/your/source/code>.
Do
g++ -o <your_binary_name> wx-config --cxxflags --libs *.cpp
Did it work?
Thank you.
BTW, CMake is not a compiler - its a tool to generate Makefile and project files for different IDEs.

Related

How to build OpenCV 4.5 from source on RaspberryPi 4?

I am trying to compile the OpenCV 4.5 library from source on a fresh install of Raspian and I'm running into a problem regarding the C++ standard. After running the cmake command from the build dir, in order to obtain the required makefiles, I get prompted with the message "OpenCV 4.X requires c++11. I tried modifying the CMakeLists.txt adding the set(CMAKE_CXX_STANDARD 11) and also adfding a building flag using the -D CMAKE_CXX_FLAGS='-std=c++11' option but without luck. All options available here: cmake build command + flags I'm not sure how I could get past this and I could use some advice if someone encountered it before, any suggestions? TIA 😃

How to use compiled wxwidgets with cmake

I'm getting some trouble while trying to use wxwidgets in my project (I'm on linux). It worked well when I was with wxWidget 3.02, but when I tried to use 3.1.0 it stopped to work.
I still have the 3.0.2 (so I can have something working) but I want to use the wxlistctrl::EnableCheckBoxes(), so I get the 3.1.0.
In my CMakeList, I change FIND_PACKAGE(wxWidgets REQUIRED)to FIND_PACKAGE(wxWidgets 3.1.0 REQUIRED)
When i try to cmake ..in my build directory, I got the following error:
... could NOT find wxWidgets: Found unsuitable version "3.0.2", but required is
at least `3.1.0`(found
-L/usr/local/lib//lib/x86_64-linux-gnu; ...
I know that the library is located at /usr/local/lib I tried to ln to the directory, I tried many commands in my cmake, but I don't know how to tell cmake to search in the good library to find th wxWidgets version I want.
I'm pretty sure it's a cmake mistake, but it can be an installation problem too (even if I followed the tutorial here). More, when I type gtk-config --versionI got "3.1.1" (that's what I expected as version number, I get the git version)
If anyone has a question or an idea to solve my problem, I would be haappy to read it =)
Thank's!
CMake saying that your minumum version of cmake, 3.0.2, is lower than the wxWidgets minimum cmake version, 3.1.0.
Try putting the command: cmake_minimum_required(VERSION 3.1.0).
That way your minimum cmake version required will be 3.1.0 so it will be fine.

Install VTK 6.2.0 with Qt 5.4 using CMake-GUI 3.2.2

This is the first time I try to use Vtk libraries but I can not find a tutorial that can help me with the qt integration. I tried several tutorials but when I try to write some code, qt can not find vtk libraries.
I followed this post but something doesn't work correctly: Combining Qt 5.4.1 with vtk 6.2.0 (using CMake GUI 3.2.1) on windows
Can someone explain me the correct procedure? I'm using Windows 7 64 bit, VTK 6.2.0, QT 5.4 and CMake-GUI 3.2.2.
Thanks to all who respond!
Did you build the vtk solution in debug or release? In the example you linked (it was me), I did it in debug, so it will only work in debug (until I build it in release)
also, maybe it's your cMakeList the problem. Did you manage to launch the project EasyView from the vtk solution?
Finally, the tutorial I followed was this one : http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup
The only thing I had to modify, was to change the qt version to 5, add another entry cmake_prefix and set up several environment variables.
Try to create Qt project with cmake instead of qmake like is described here
For a first step try to write just hello world in Qt and try to create cmake for it..
Then you just add the VTK find functions and use those to add vtk support to your qt cmake project. Maybe its something like this (never used vtk):
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
Then you should be able to use Qt and vtk in same project..

instructions on building CGAL libraries from source code

I have installed Computational Geometry Algorithms Library 4.3 and followed instructions on CGAL4.3 manual page(http://doc.cgal.org/latest/Manual/installation.html).
After I cmaked CGAL-4.3 folder , it says ,"make # build the CGAL libraries".However I cant find any cmake command or .exe file to execute "make".What am I missing here?
below I copied the instructions on the manual page in case anyone cant access it.
1 Introduction
This document describes how to install CGAL on Windows, Unix-like systems, and MacOS X.
Ideally, setting up CGAL amounts to:
cd CGAL-x.y # go to CGAL directory
cmake . # configure CGAL
make # build the CGAL libraries
You are on windows so you may not have make.
You can either install make or tell Cmake to generate something else than a makefile (like a Visual Studio project for instance).
If you are using Cygwin, it should be pretty easy to install make or maybe you already have it. Try typing make at the Cygwin prompt.
From my limited experience building code on windows, I recommend installing MinGW and Code::Blocks. Then ask Cmake to generate a Code::Blocks project using MinGW. Open the project and build it. Clean and easy.
Note that the CGAL Project provides Installation Instructions for Windows

Qt + VTK + Cmake

I'm running OSX 10.6 (Snow Leopard), Qt 4.6, VTK 5.4, and Cmake 2.8. I installed Qt, then VTK and Cmake. I configured VTK to use QT 4.6 (turned on VTK_USE_GUISUPPORT and VTK_USE_QVTK). The configuration and installation worked painlessly but if I run Cmake with Qt references the compilation fails during the subsequent make process because of failed dependency resolution.
As an example, I tried to build the Qt ImageViewer example (VTK/Examples/GUI/Qt/ImageViewer) and it failed to find qapplication.h (and all other qt headers). Any ideas about why this might be happening would be greatly appreciated!
CMake finds Qt by looking for qmake (ironic, eh?). Make sure qmake is in your path.
Also, make sure VTK and Qt 4.6 were compiled with the same version of gcc/g++. Weird runtime errors (like cout not working) can result.
First you should set DESIRED_QT_VERSION to 4. When it's ready, you could chose QT_QMAKE_EXECUTABLE to your qmake binary.
I find that the CMakeCache.txt in your build folder for cmake tends to have all the necessary diagnostics info for stuff like this. Almost certainly there's a string field for the include path that is blank right now due to not being found.