wxWidgets in OSX shared library (fvisibility=hidden)
Posted: Tue Dec 04, 2018 11:18 am
Hello,
I have a problem with building wxWidgets for OSX and hidding all the symbols. I'm trying to build shared library which will be responsible for just showing some custom dialogs - but this library has to work in independent way. The problem is that application have to work for Windows and OSX, and have to work with wxWidgets application and other applications (kind of plug-in environment). My relations:
1) wxWidgets based application <-> Shared SO/DLL (plug-in) <-> shared library with wxWidgets dialogs(dll/so).
2) Other standalone app without wxWidgets <-> Shared SO/DLL (plug-in) <-> shared library with wxWidgets dialogs(dll/so).
Now for Windows I've followed example: https://github.com/wxWidgets/wxWidgets/ ... amples/dll and everything works like a charm. Now for OSX I have huge problems to hide Objective C symbols. The moment shared library with dialogs is loaded I have following errors:
From this moment applications acts very strange, like it can't be closed using window "x" button. I've tried everything to hide those symbols, my configure:
Which is passed correctly during build, but still doesn't work for me. Building shared library with dialogs also contains such flags. While building either the wxWidget application or shared library with dialogs, I was trying to pass -Xlinker -x, and after that command:
Doesn't return any symbols, so I'm kind of lost what is going on. So how can I hide objective C related symbols?
I have a problem with building wxWidgets for OSX and hidding all the symbols. I'm trying to build shared library which will be responsible for just showing some custom dialogs - but this library has to work in independent way. The problem is that application have to work for Windows and OSX, and have to work with wxWidgets application and other applications (kind of plug-in environment). My relations:
1) wxWidgets based application <-> Shared SO/DLL (plug-in) <-> shared library with wxWidgets dialogs(dll/so).
2) Other standalone app without wxWidgets <-> Shared SO/DLL (plug-in) <-> shared library with wxWidgets dialogs(dll/so).
Now for Windows I've followed example: https://github.com/wxWidgets/wxWidgets/ ... amples/dll and everything works like a charm. Now for OSX I have huge problems to hide Objective C symbols. The moment shared library with dialogs is loaded I have following errors:
Code: Select all
objc[24994]: Class wxNSAnimationDelegate is implemented in both /Users/imac/Projects/GPE_trunk/trunk/GPESA/build/Debug/GConManager.app/Contents/MacOS/GConManager and /usr/local/lib/libgpe_gui_elements.so. One of the two will be used. Which one is undefined.
Code: Select all
../configure --enable-debug --with-osx_cocoa --with-zlib=builtin --without-libiconv --without-liblzma --disable-shared --disable-mediactrl --enable-universal_binary=i386,x86_64 --with-macosx-version-min=10.7 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk --disable-visibility CFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG" CXXFLAGS="-stdlib=libc++ -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden" OBJCXXFLAGS="-stdlib=libc++ -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden" OBJCXXFLAGS="-stdlib=libc++ -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden" OBJCFLAGS="-stdlib=libc++ -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden" LDFLAGS="-stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden" --prefix="$(pwd)"
Code: Select all
nm build/Debug/MyApp.app/Contents/MacOS/MyApp | grep -i wx