Hi guys out there,
since days I am trying to get one easy program started:
The *.cpp File:
And here is the header File:
I am trying to run that project using xCode and the well known boost library. But always, I am getting the following error message 3 times:
I searched through the www for any help. But mostly some people gave the reason that the main() function is missing. But this is not the case here.
But I have found out that this is a so called "linker" problem. Unfortunately I do not understand how to deal with it.
So I really hope that someone here wants to be my hero for the whole week!
I would be really grateful for an answer
!
Bye,
XeDoSh
since days I am trying to get one easy program started:
The *.cpp File:
Code:
/*
* TopologyPreserving.cpp
*/
#include "TopologyPreserving.h"
#include <iostream>
using namespace std;
using namespace boost::numeric::ublas;
namespace scils{ namespace algorithms{ namespace morphology{
TopologyPreserving::TopologyPreserving(ublas::matrix<double>& segmentedMatrix)
:segMask(segmentedMatrix.size1(),segmentedMatrix.size2()) {//const narrowBandWidth connectivity tau rho maxIter, const bool output)
// 1. Get mask of the segmented Matrix
//segMask = new ublas::matrix<double> (segmentedMatrix.size1(),segmentedMatrix.size2());
for (unsigned i = 0; i < segmentedMatrix.size1 (); ++ i) {
for (unsigned j = 0; j < segmentedMatrix.size2 (); ++ j) {
if (segmentedMatrix(i,j) != 0) {
segMask(i,j) = 1;
}
else {
segMask(i,j) = 0;
}
}
}
};
int main (int argc, char *argv[]) {
// Test example
// segmentedMatrix = [0 0 3 3;
// 0 0 0 3;
// 3 0 0 0;
// 3 3 0 0]
ublas::matrix<double> segmentedMatrix(4,4);
for (unsigned i=0; i<4; ++i) {
for (unsigned j=0; j<4; ++j) {
segmentedMatrix(i,j) = 0;
}
}
segmentedMatrix(0,2) = 3;
segmentedMatrix(0,3) = 3;
segmentedMatrix(1,3) = 3;
//
segmentedMatrix(2,0) = 3;
segmentedMatrix(3,0) = 3;
segmentedMatrix(3,1) = 3;
// Run algorithm (to get the mask from the segmented mask)
scils::algorithms::morphology::TopologyPreserving
myTP(segmentedMatrix);
cout << myTP.segMask << endl;
return 0;
}
}}}
And here is the header File:
Code:
/*
* TopologyPreserving.h
*/
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
namespace ublas = boost::numeric::ublas;
#include <stdio.h>
// #include <stdlib.>
namespace scils{ namespace algorithms{ namespace morphology{
class TopologyPreserving{
public:
/** Mask for segmented mask */
ublas::matrix<double> segMask;
/** Constructor */
TopologyPreserving(ublas::matrix<double>& segmentedMatrix);
};
}}}
I am trying to run that project using xCode and the well known boost library. But always, I am getting the following error message 3 times:
Code:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I searched through the www for any help. But mostly some people gave the reason that the main() function is missing. But this is not the case here.
But I have found out that this is a so called "linker" problem. Unfortunately I do not understand how to deal with it.
So I really hope that someone here wants to be my hero for the whole week!
I would be really grateful for an answer
Bye,
XeDoSh