Undefined reference to itk::simple::ImageRegistrationMethod::~ImageRegistrationMethod()
laithanh77 opened this issue · comments
Thanh Lai commented
Hi,
I compiled SimpleElastix for Ubuntu in accordance to the guidelines and I get an error when using the package in C++
Sample code:
#include <iostream>
#include <SimpleITK.h>
#include <sitkImageOperators.h>
#include <iostream>
#include <stdlib.h>
#include <iomanip>
namespace sitk = itk::simple;
int main()
{
std::cout << "Hello World!" << std::endl;
sitk::ImageRegistrationMethod R;
}
The compilation syntax:
g++ -I../../builds/SimpleElastix/include/SimpleITK-2.0/ -L../../builds/SimpleElastix/lib/ --std=c++11 -o test_code test_code.cpp
The error:
/usr/bin/ld: /tmp/ccfUDeKj.o: in function `main':
test_code.cpp:(.text+0x51): undefined reference to `itk::simple::ImageRegistrationMethod::ImageRegistrationMethod()'
/usr/bin/ld: test_code.cpp:(.text+0x60): undefined reference to `itk::simple::ImageRegistrationMethod::~ImageRegistrationMethod()'
collect2: error: ld returned 1 exit status
I get a similar undefined reference error when instantiating an Image object too.
My g++ version:
g++ (Ubuntu 10.3.0-1ubuntu1) 10.3.0
Thank you
Kunyadav commented
hi
i dont have answer for your question rather i have a question, i am trying to build/compile simpleElastic for my C++ project but i am not able to succeed, can you tell me how did you get or create simpleITK C++ library?
Regards
Kunal