PDAL / PDAL

PDAL is Point Data Abstraction Library. GDAL for point cloud data.

Home Page:https://pdal.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plugin doesn't read

alavenant opened this issue · comments

Describe the bug

I write a plugin for a filter using PDAL_CREATE_PLUGIN.

I need to comment this code so that my plugIn could be used :

    // This awfulness is to work around a warning that some compilers
    // generate when casting a void * to a function *.  See the example
    // in the dlsym manpage.
    *(void **)(&initFunc) = d->getSymbol("PF_initPlugin");
    if (!initFunc)
    {
        m_log->get(LogLevel::Debug) << "No symbol 'PF_initPlugin' found "
            "in plugin '" << path << "'." << std::endl;
        return false;
    }
    initFunc();
    m_log->get(LogLevel::Debug) << "Initialized plugin '" <<
        path << "'." << std::endl;

from line 331 of PluginManager.cpp.

Did i miss something in my plugin ? An include or something else ?

I'm using a mac with a M1 processor. But it's seems to be the same on a ubuntu.

Thanks,
Antoine

I don't understand the issue. Can you please provide the actual error that you're getting?

If i run pdal with a json including a filter from my plugIn, I get the error :

       RuntimeError: Couldn't create filter stage of type 'filters.grid_decimation'.
       You probably have a version of PDAL that didn't come with a plugin
       you're trying to load.  Please see the FAQ at https://pdal.io/faq.html

It doesn't happen when i comment the code :

*(void **)(&initFunc) = d->getSymbol("PF_initPlugin");
...

It's seems that the compilation of my plugIN doesn't give the "PF_initPlugin" symbol, so this code return false, and my plugIn is not taken in account.

But if i comment this code, the plugIN is taken and everything is fine.

I'd have to see your code, but it seems like you're not actually creating a plugin, as that symbol is directly created through CREATE_SHARED_STAGE() macro.

Wonderful !

I was using CREATE_STATIC_STAGE().

Thanks,
Antoine