How to use compiled wxwidgets with cmake - c++

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.

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 😃

Issues with wxwidgets and VSCode

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.

Cmake doesn't find boost windows

I'm trying to run this code:
https://github.com/snukky/news-translit-nmt
I've installed boost and got the following messages:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
C:\Program Files\boost\boost_1_67_0
The following directory should be added to linker library paths:
C:\Program Files\boost\boost_1_67_0\stage\lib
By the comment of #kenba I've added the following environment variables:
Try 1
When I try to run the following cmd:
cmake .. -DCMAKE_BUILD_TYPE=Release
I get:
-- Could NOT find Boost (missing: timer iostreams filesystem system chrono) (found version "1.67.0")
CMake Error at CMakeLists.txt:290 (message):
Cannot find Boost libraries. Terminating.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring incomplete, errors occurred!
See also "D:/ThesisResources/previous_works/news-translit-nmt-master/tools/marian-dev/build/CMakeFiles/CMakeOutput.log".
Try 2
When I try to give a custom boost by this ref
https://marian-nmt.github.io/docs/#custom-boost:
I run the following cmd:
cmake .. -DBOOST_ROOT="C:\Program Files\boost\boost_1_67_0"
I get the same error.
I've also tried working with Linux WSL (But problems with CUDA installation overthere, their team is working on it), Linux VirtualBox (Not enough resources), and Ubuntu 17.10 I have installed (But Cuda requires Ubuntu 16.04 / 18.04)
What am I missing here? I'm trying any suggestion, stuck on it for a few days. Thanks!
Edit:
I reinstalled Ubuntu 16.04 and the problem was solved. Still don't know how to solve it in windows, but i'll continue use Ubuntu 16.04.
I had this problem earlier while trying to build the Windows version of Marian NMT (the same component that you're having trouble with). I can't remember the exact steps to solve the problem, but the root cause is that the Marian NMT build for Windows does not work with newer versions of Boost, since the source code uses some deprecated calling conventions for timer and chrono libraries (maybe some others as well).
The error message kind of confirms this: it can't find Boost, but on the other hand it says it finds your version 1.67.0. The solution is to use an older version of boost, I've confirmed that it works with 1.60.0.
If you just require a Marian NMT decoder that works in Windows, a project I work on has released a plugin for the Trados Studio translation tool, which contains a compiled marian-decoder executable for Windows: https://object.pouta.csc.fi/fiskmo/TradosStudio/FiskmoTranslationProvider.sdlplugin. You can access the executable by unzipping the sdlplugin file, the StartMtPipe.bat shows how to use the decoder.

Can I use biicode for C++ on ubuntu 14.04 with Cmake 2.8.12.2?

I just downloaded biicode and tried to follow the getting started instructions but received an error about the Cmake 3.0 or higher being required.
However, ubuntu 14.4 uses "cmake version 2.8.12.2"
Is there a way to use biicode with 2.8 or am I stuck installing the newer version of CMake?
TIA!
No, biicode requires cmake > 3.0. There is a setup command that helps installing it:
$ bii setup:cpp
This will install CMake >3.0 in /home/user/biicode_env, and add it to the path, so it doesnt interfere/overwrite your current 2.8 installation. Biicode needs that executing "cmake" in the console actually uses 3.0, so it should be first in the path. You can manage it very easily in two different ways, with a symbolic link (/usr/bin) that you redirect as needed or adding/removing an entry in the path before executing biicode.
This is a different thing, but I woiuld like to say that I have migrated existing projects from cmake 2.8 to 3.0 without any problems, and 3.0 runs great and has useful new features. So I would recommend regular cmake users to upgrade if possible.
No, there isn't any way to change this requirement because internal biicode CMake has features, like the use of INTERFACE libraries, which are only available on CMake 3.0 or later. However, don't worry about upgrading CMake version, this one always keeps a exhaustive compatibility with older versions ;)

Could NOT find Boost in ubuntu machine?

I have already installed BOOST in my brand new Ubuntu 12.04 machine. And when I do like this -
cmake .
I always get the below exception saying -
Could NOT find Boost
I am not sure what wrong I am doing here. I have one of my ubuntu instance working fine and I am trying the same thing on my new Ubuntu instance which I have got.. So I am not sure what wrong I am doing here and how the same thing works fine in my other ubuntu instance.
root#dbx1245:/export/home/test/libcql# cmake .
-- Could NOT find Boost
WANT_LIB64 unset; assuming normal library directory names
Will install libraries to /usr/local/lib
-- Configuring done
-- Generating done
-- Build files have been written to: /export/home/test/libcql
Can anyone help me with this?
I am running Ubuntu 12.04. I have seen other article as well on the stackoverflow but I am not able to solve this issue.
I already have boost installed by the way.
I also encountered this error - boost was correctly installed as suggested in this answer.
I solved it by setting
set(BOOST_INCLUDEDIR /usr/include)
just before
find_package(Boost)
I was using CMake 3.1.3 for testing (via ppa:george-edison55/cmake-3.x)