Numerous link error when linking against plugin library

CodeLite installation/troubleshooting forum
bartgol
CodeLite Curious
Posts: 1
Joined: Thu May 07, 2020 7:14 pm
Genuine User: Yes
IDE Question: C++
Contact:

Numerous link error when linking against plugin library

Post by bartgol »

Hello,

I've been redirected to this forum from the codelite github issue tracker. I'm having issues building codelite from scratch, particularly with the plugin library. The error is related to the wx libs.

My cmake config script is quite basic:

Code: Select all

SRC_DIR=${WORK_DIR}/utils/codelite/codelite-src
INSTALL_DIR=${WORK_DIR}/utils/codelite/codelite-install
WX_CONFIG=/usr/libexec/wxGTK3/wx-config

rm -rf CMakeFiles
rm -f  CMakeCache.txt

cmake -Wno-dev  \
  -D CMAKE_BUILD_TYPE:STRING=RELEASE            \
  -D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}   \   
  -D CMAKE_C_COMPILER:STRING=gcc                \
  -D CMAKE_CXX_COMPILER:STRING=g++              \
  \
  -D WITH_WX_CONFIG:FILEPATH=${WX_CONFIG}       \
  -D ENABLE_LLDB:BOOL=FALSE                     \
  \
  ${SRC_DIR}
When linking against the plugin target, I get numerous (~40-50) errors that look like the following:

Code: Select all

../lib/libplugin.so: undefined reference to `non-virtual thunk to wxStyledTextCtrl::Undo()'
I manually inspected the wx libraries via nm, and made sure those symbols are indeed defined. And in fact, it's not an undefined symbol, but an error that, honestly, I little understand.

Some info:

- OS: rhel 7.5
- Compiler: gcc 8.2.0
- wx version: 3.0.4

I am not sure if the error is due to a) something wrong in my wx libs installation, b) something wrong in how wx libs/headers are used in codelite, or c) I'm doing something wrong in the config/build process. I hope you can help me figure out which one it is, and possibly how to address it.

Thanks.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Numerous link error when linking against plugin library

Post by DavidGH »

Hi,
And in fact, it's not an undefined symbol, but an error that, honestly, I little understand.
Me too :( so I fear this reply may contain misinformation. However:

AFAICT after googling, it happens if you try to link to a lib built by an incompatible version of g++, or some similar issue.

Did you build your own wxWidgets? If so, with the same g++ version as you're using now?

Is there any chance that you have a mixture of builds of wx (or other) libs installed, or (just possibly) the wx devel package is incompatible with the wxlibs install? Perhaps doing:
wx-config --list
wx-config --cxxflags
wx-config --libs
in the build terminal might show something helpful.

Can you build successfully any of the wxWidgets samples, that come with the wx source-code? Start with 'minimal', but try 'text' too as wxTextCtrl was on your error list.

If your wx installation wasn't self-built, perhaps try doing so and see if using that gives the same errors.

Regards,

David
Post Reply