Getting started with wxWidgets and CLion?
Asked Answered
C

2

8

Can anyone suggest a tutorial or getting started guide to CLion and wxWdgets? I have searched around but am unable to find anything.

Cynthea answered 12/4, 2016 at 11:44 Comment(7)
What seems to be the problem? Also, it would be nice to know you OS version as well as wx version. Thank you.Dolabriform
Hello, I have never worked with CLion or wxWidgets. The OS is Windows 10, wxWidgets v3.1.0. The only C++ development that I have done in the past is with Qt so, there was very little configuration of the IDE to get started. It appears that it would be much easier to use Visual Studio for wxWidgets however, I am a big fan of Jetbrains (IntelliJ, PyCharm, etc.) so, I wanted to give CLion a whirl. Thanks!Cynthea
is CLion some kind of Java IDE? I never heard about it before... Nevertheless if it can work with C++ it is very easy. Just build wxWIdgets either using MinGW or MSVC and set it up in CLion. No special requirements necessaryDolabriform
I just googled it and it is C/C++ IDE which uses CMake. There is a GitHub fork of wxWidgets that is using CMake. Post on either wx-users or on the forums.wxwidgets.org and you will get a link to its repo. Then build the library and set up the IDEDolabriform
I presume you already have CMake set up so you should be good after you get a CMake files for wxWidgets. After you build the library, just open the project, point the include directory to wxWidgets/include and lib directory to wxWidgets/lib and that's it. After that just build the code, and fix any compiler errors you get. ;-)Dolabriform
It this CMake file. It may help you. #39871553Gelding
Try this solution. I think it can help you #39871553Gelding
G
11

Well,

  1. you should download WxWidgets here http://www.wxwidgets.org/downloads/.
  2. Then, you should compile and install to your system.
  3. Download and install CLion.
  4. Create new Project.
  5. Then, follow to this edit your CMakeLists.txt Building wxWidgets 3.1.0 on CLion (Ubuntu)
  6. Then try Hello World sample http://docs.wxwidgets.org/trunk/overview_helloworld.html.
  7. If everything okay, start to develop great apps!
Gelding answered 7/6, 2017 at 14:58 Comment(0)
T
0

I built the latest version of wxWidget from scratch on macOS and didn't want to install wxWidget anywhere, but wanted to use the binaries for my CLion projects. Here's what my CMakeLists.txt file looks like below. Editing, building, running and debugging all works great with this file.

cmake_minimum_required(VERSION 3.26) 
project(stc)  # stc could be any project name you want

set(CMAKE_CXX_STANDARD 11)
add_compile_definitions(__WXOSX_COCOA__)
add_compile_definitions(_FILE_OFFSET_BITS=64)

# add both the built include dir and wxWidget src include dir
include_directories(<userhome>/wxWidgets/build-cocoa-debug/lib/wx/include/osx_cocoa-unicode-3.3 <userhome>/wxWidgets/include)

add_executable(stc stctest.cpp edit.cpp prefs.cpp) # just an simple app
 
target_link_directories(stc PUBLIC <userhome>/wxWidgets/build-cocoa-debug/lib)
target_link_libraries(stc -lwx_osx_cocoau_stc-3.3 -lwx_osx_cocoau_core-3.3  -lwx_baseu-3.3)
Tyrolienne answered 15/11, 2023 at 5:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.