jhu-cisst / cisst

JHU ERC CISST Library
http://github.com/jhu-cisst/cisst/wiki
Other
63 stars 46 forks source link

linker error - vctDoubleMat argument type in mtsCommand - mtsGenericObjectProxy undefined #19

Open marcinbalicki opened 9 years ago

marcinbalicki commented 9 years ago
//roBehaviorSinusNavControl.h:
void SetMat(const vctDoubleMat &mat) { m = mat};

//roBehaviorSinusNavControl.cpp
providedInterface->AddCommandWrite(&roBehaviorSinusNavControl::SetMat, this, "SetMat");

//linker errors:
function mtsGenericObjectProxyBase<vctDynamicMatrix<double> >::Services() const: error: undefined reference to 'mtsGenericObjectProxy<vctDynamicMatrix<double> >::ClassServices()'
function vtable for mtsGenericObjectProxy<vctDynamicMatrix<double> >: error: undefined reference to 'mtsGenericObjectProxy<vctDynamicMatrix<double> >::Services() const'

//If I change the matrix to mts then it works:
void SetMat(const mtsDoubleMat &mat) { m = mat};  
adeguet1 commented 9 years ago

I'm having some trouble reproducing this bug. I tried calling directly the missing method or creating a test component with a command using the same signature (const vctDoubleMat &) and no linking error (at least on Mac OS X with clang). Could I get access to your code to see how if differs from mine?

adeguet1 commented 9 years ago

FYI, code snippet I tested:


class testComponent: public mtsComponent {
public:
    testComponent(void):
        mtsComponent("testComponent") {
    }

    void SetMat(const vctDoubleMat & mat) {
        std::cout << mat << std::endl;
    }

    void Configure(const std::string &) {
        mtsInterfaceProvided * interfaceProvided = this->AddInterfaceProvided("testing");
        interfaceProvided->AddCommandWrite(&testComponent::SetMat, this, "SetMat");
    }

    void Startup(void) {
    }
};

void mtsMatrixTest::TestInstantiation(void)
{
    cmnClassServicesBase * services = 0;
    cmnGenericObject * object = 0;
    services = mtsGenericObjectProxyBase<vctDynamicMatrix<double> >::ClassServices();
    CPPUNIT_ASSERT(services);
    object = services->Create();
    CPPUNIT_ASSERT(object);
    CPPUNIT_ASSERT(object->Services());

    testComponent * test = new testComponent;
    test->Configure("");

    mtsTaskManager * manager = mtsTaskManager::GetInstance();
    manager->AddComponent(test);
}
marcinbalicki commented 9 years ago

Are you using 2 processes?

Marcin

On Feb 6, 2015, at 11:55, Anton Deguet notifications@github.com wrote:

I'm having some trouble reproducing this bug. I tried calling directly the missing method or creating a test component with a command using the same signature (const vctDoubleMat &) and no linking error (at least on Mac OS X with clang). Could I get access to your code to see how if differs from mine?

— Reply to this email directly or view it on GitHub.

adeguet1 commented 9 years ago

Single process. Can we schedule some time so I can test on your installed code?


Anton Deguet 410-790-0456 www.lcsr.jhu.edu

On Feb 6, 2015, at 1:25 PM, Marcin Balicki notifications@github.com wrote:

Are you using 2 processes?

Marcin

On Feb 6, 2015, at 11:55, Anton Deguet notifications@github.com wrote:

I'm having some trouble reproducing this bug. I tried calling directly the missing method or creating a test component with a command using the same signature (const vctDoubleMat &) and no linking error (at least on Mac OS X with clang). Could I get access to your code to see how if differs from mine?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

adeguet1 commented 9 years ago

Tried with Peter on UR5 wrappers and couldn't reproduce issue. Marcin, let's schedule 5 minutes to investigate.