[Qgis-developer] Building ".so" plugin, not ".dylib" on Mac
Tasos Varoudis
null at archtech.gr
Tue Oct 30 08:39:09 PDT 2012
crash log:
Process: QGIS [75167]
Path: /Users/USER/*/QGIS.app/Contents/MacOS/QGIS
Identifier: org.qgis.qgis
Version: 1.9.0 (1.9.0 [caae7b7])
Code Type: X86-64 (Native)
Parent Process: launchd [205]
User ID: 501
Date/Time: 2012-10-30 15:34:42.633 +0000
OS Version: Mac OS X 10.8.2 (12C54)
Report Version: 10
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Regions Near 0:
-->
__TEXT 000000010c96e000-000000010cfa1000 [ 6348K] r-x/rwx SM=COW /Users/USER/*/QGIS.app/Contents/MacOS/QGIS
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 QtGui 0x0000000119a0da06 -[NSApplication(QApplicationIntegration) qt_filterEvent:] + 22
1 qtgui 0x00000001117f3888 -[QNSApplication sendEvent:] + 40
2 qtgui 0x00000001117fc6bf QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1695
3 qtcore 0x00000001115b98c1 QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 81
4 org.qgis.qgis 0x000000010c9b1ea6 QgisApp::QgisApp(QSplashScreen*, bool, QWidget*, QFlags<Qt::WindowType>) + 4750 (qgisapp.cpp:597)
5 org.qgis.qgis 0x000000010c9775a3 main + 6739 (qstring.h:419)
6 libdyld.dylib 0x00007fff88d257e1 start + 1
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff9144ad16 kevent + 10
1 libdispatch.dylib 0x00007fff8f1e3dea _dispatch_mgr_invoke + 883
2 libdispatch.dylib 0x00007fff8f1e39ee _dispatch_mgr_thread + 54
Thread 2:
0 libsystem_kernel.dylib 0x00007fff9144a6d6 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8a38deec _pthread_workq_return + 25
2 libsystem_c.dylib 0x00007fff8a38dcb3 _pthread_wqthread + 412
3 libsystem_c.dylib 0x00007fff8a378171 start_wqthread + 13
Thread 3:
0 libsystem_kernel.dylib 0x00007fff9144a6d6 __workq_kernreturn + 10
1 libsystem_c.dylib 0x00007fff8a38deec _pthread_workq_return + 25
2 libsystem_c.dylib 0x00007fff8a38dcb3 _pthread_wqthread + 412
3 libsystem_c.dylib 0x00007fff8a378171 start_wqthread + 13
On 30 Oct 2012, at 15:20, William Kyngesburye <woklist at kyngchaos.com> wrote:
> On Oct 30, 2012, at 9:51 AM, Tasos Varoudis wrote:
>
>> Im not doing both together:
>> one in "-=" and the bundle is "+="
>>
> I missed the detail there
>
>> This is what I get
>> g++-4.2 -headerpad_max_install_names -FXXX/lib -arch x86_64 -single_module -bundle -Xarch_x86_64 -mmacosx-version-min=10.6 -o libTest.dylib debug/XX.o ….
>>
>> file libTest.dylib
>> libTest.dylib: Mach-O 64-bit dynamically linked shared library x86_64
>>
> That's very odd. The -bundle option should create a bundle but you're getting a dynamic library. The only thing I can think of (and equally very odd) is that the linker sees the .dylib extension on the output file and thinks you really meant a dynamiclib.
>
>>
>> Im not sure if Im don't something else wrong. On linux everything work perfect.
>>
>> Where should I put a dylib file in order to load it as a QGIS plugin on a Mac OSX?
>>
>
> Anyways, as I said, a dynamiclib (that's what they are on linux, linux doesn't have the shared lib/module distinction) should still be loadable as a plugin. As long as it has a .so extension (it will not load a .dylib as a plugin), and it's in the plugins folder with the rest of the plugins, QGIS will load it. if it is causing a crash, then something else is probably wrong (and it's beyond my skills).
>
> The crash log might help figure out what's wrong.
>
>> Best
>>
>>
>> On 30 Oct 2012, at 14:40, William Kyngesburye <woklist at kyngchaos.com> wrote:
>>
>>> If you are doing both of those at the same time, I'm guessing that dynamiclib (probably synonym for dylib) is overriding bundle.
>>>
>>> You can figure out what it really linked as with:
>>>
>>> file /path/to/your/plugin
>>>
>>> But then, the difference between a dylib and a bundle is not a big one - a dylib can be loaded like a bundle. Maybe there is a different problem?
>>>
>>> On Oct 30, 2012, at 9:22 AM, Tasos Varoudis wrote:
>>>
>>>> Hi,
>>>>
>>>> So something like that should work:
>>>>
>>>> macx:QMAKE_LFLAGS_PLUGIN -= -dynamiclib
>>>> macx:QMAKE_LFLAGS_PLUGIN += -bundle
>>>>
>>>> But it didn't.
>>>> I still get a dylib file and if I rename it to .so QGIS will crash (as it really a dylid and qgis is confused) or not load at all (if I leave it as dylib and move it to the plugin folder).
>>>>
>>>> Thanks
>>>> Tasos
>>>>
>>>>
>>>> On 30 Oct 2012, at 13:46, William Kyngesburye <woklist at kyngchaos.com> wrote:
>>>>
>>>>> You need to use a MODULE type for the cmake ADD_LIBRARY(). I don't know how to do this with qmake, but the linker flag is -bundle instead of -dylib.
>>>>>
>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
>
> "Time is an illusion - lunchtime doubly so."
>
> - Ford Prefect
>
>
More information about the Qgis-developer
mailing list