No RibbonBar in CLion on MacOS14.7

32 views
Skip to first unread message

Christian Homeier

unread,
Mar 7, 2025, 4:42:16 AM3/7/25
to wx-users
Hello to all of you,

I have problems to integrate a wxRibbonBar() in my Project. When trying to build I ran into this Error:

Undefined symbols for architecture x86_64:
  "wxRibbonBar::wxRibbonBar()", referenced from:
      PjmFrame::PjmFrame() in pjm_frame.cpp.o
ld: symbol(s) not found for architecture x86_64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [ProjectManager] Error 1
make[2]: *** [CMakeFiles/ProjectManager.dir/all] Error 2
make[1]: *** [CMakeFiles/ProjectManager.dir/rule] Error 2
make: *** [ProjectManager] Error 2

With the Sample-Projekt it´s the same, BUT if I build the Sample WITHOUT my CLion IDE, using the MAKEFILE of the Sample in a terminal it compiles and ran.

Can anyone here tell me what I´m doing wrong?

Nice day to all of you.

P.S please excuse me if it´s an "bloody noob"-question, I´m still new to wxWidgets on CLion/Mac, most times I used VisualStudio which unfortunately make everything for....

Vadim Zeitlin

unread,
Mar 7, 2025, 6:02:07 AM3/7/25
to wx-u...@googlegroups.com
On Fri, 7 Mar 2025 00:22:34 -0800 (PST) Christian Homeier wrote:

CH> Hello to all of you,
CH>
CH> I have problems to integrate a wxRibbonBar() in my Project. When trying to
CH> build I ran into this Error:
CH>
CH> Undefined symbols for architecture x86_64:
CH> "wxRibbonBar::wxRibbonBar()", referenced from:
CH> PjmFrame::PjmFrame() in pjm_frame.cpp.o

You need to link with the ribbon library.

CH> With the Sample-Projekt it´s the same, BUT if I build the Sample WITHOUT my
CH> CLion IDE, using the MAKEFILE of the Sample in a terminal it compiles and
CH> ran.
CH>
CH> Can anyone here tell me what I´m doing wrong?

I don't know how do you specify the link options in your project in this
IDE, but you must use the equivalent of `wx-config --libs` output, whether
directly (if the IDE supports running commands) or as a copy. To use
wxRibbonBar, you need to change this to be `wx-config --libs std,ribbon`
instead.

Good luck,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Christian Homeier

unread,
Mar 7, 2025, 12:08:15 PM3/7/25
to wx-users
Hey Varim,

thanks a lot for replying. I don´t know if I did it "the right way" but in my case it seems that the following
were the Problem:

In my CMakeList.txt I defined

find_package(wxWidgets COMPONENTS base core REQUIRED)

after changing it to 

find_package(wxWidgets COMPONENTS all REQUIRED)

the problem seems to has gone.... 

Vadim Zeitlin

unread,
Mar 7, 2025, 12:09:24 PM3/7/25
to wx-u...@googlegroups.com
On Fri, 7 Mar 2025 09:08:14 -0800 (PST) Christian Homeier wrote:

CH> Hey Varim,
CH>
CH> thanks a lot for replying. I don´t know if I did it "the right way" but in
CH> my case it seems that the following
CH> were the Problem:
CH>
CH> In my CMakeList.txt I defined
CH>
CH> find_package(wxWidgets COMPONENTS *base core* REQUIRED)
CH>
CH> after changing it to
CH>
CH> find_package(wxWidgets COMPONENTS *all *REQUIRED)
CH>
CH> the problem seems to has gone....

Yes, sure, if you CMake you need to add "ribbon" to the list of libraries.
Using "all", unsurprisingly, includes all libraries, including this one.

Regards,

Christian Homeier

unread,
Mar 7, 2025, 12:13:04 PM3/7/25
to wx-users
Additionally I tried what you said, simply adding ribbon to this section do the same.

cmake_minimum_required(VERSION 3.30)
project(ProjectManager)

set(CMAKE_CXX_STANDARD 26)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")

find_package(wxWidgets COMPONENTS base core ribbon REQUIRED)

include("${wxWidgets_USE_FILE}")

set(SRCS project_manager.cpp )

if (APPLE)
project(${PROJECT_NAME} VERSION 3.30 LANGUAGES CXX OBJCXX)
else ()
project(${PROJECT_NAME} VERSION 3.30 LANGUAGES CXX )
endif (APPLE)

if(WIN32)
set(SRCS ${SRCS} wxWidgetsTest.rc)
endif (WIN32)

add_executable(ProjectManager project_manager.cpp
pjm_frame.cpp
pjm_frame.h
ribbonbar.cpp
menubar.cpp
)

target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})
Reply all
Reply to author
Forward
0 new messages