Author Topic: Help with Linker error - CurvePointValue problem  (Read 19892 times)

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Help with Linker error - CurvePointValue problem
« on: 2011 June 10 23:44:23 »
I'm getting the following exit error by the compiler:

Code: [Select]
./x86_64/Release/InterChannelCurvesParameters.o: In function `pcl::ICCCurvePointValue::ICCCurvePointValue(pcl::MetaTable*)':
InterChannelCurvesParameters.cpp:(.text+0xfd5): undefined reference to `pcl::CurvePointValue::CurvePointValue(pcl::MetaTable*)'
./x86_64/Release/InterChannelCurvesParameters.o: In function `pcl::CurvePointValue::~CurvePointValue()':
InterChannelCurvesParameters.cpp:(.text._ZN3pcl15CurvePointValueD2Ev[_ZN3pcl15CurvePointValueD5Ev]+0x5): undefined reference to `vtable for pcl::CurvePointValue'
/usr/bin/ld: ./x86_64/Release/InterChannelCurvesParameters.o: relocation R_X86_64_PC32 against undefined hidden symbol `vtable for pcl::CurvePointValue' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make: *** ["/home/cmilovic/Development/Working/InterChannelCurves/linux/g++/x86_64/Release"/InterChannelCurves-pxm.so] Error 1

And here is part of the Parameters.h and Parameters.cpp files:

Code: [Select]
class ICCCurvePointValue : public CurvePointValue
{
public:

   ICCCurvePointValue( MetaTable* );

   virtual IsoString Id() const = 0;

   virtual double MinimumValue() const;
   virtual double MaximumValue() const;

   virtual bool IsX() const = 0;
};

#define DECLARE_ICCCURVE_POINT_VALUE_PARAMETER( classId, parId, isX )       \
class classId;                                                             \
extern classId* The##classId##Parameter;                                   \
class classId : public ICCCurvePointValue                                   \
{                                                                          \
public:                                                                    \
   classId( MetaTable* t ) : ICCCurvePointValue( t )                        \
   { if ( The##classId##Parameter == 0 ) The##classId##Parameter = this; } \
   virtual IsoString Id() const { return parId; }                          \
   virtual bool IsX() const { return isX; }                                \
}

DECLARE_ICCCURVE_POINT_VALUE_PARAMETER( XICC, "x", true  );
DECLARE_ICCCURVE_POINT_VALUE_PARAMETER( YICC, "y", false );

Code: [Select]
ICCCurvePointValue::ICCCurvePointValue( MetaTable* t ) : CurvePointValue( t )
{
}

double ICCCurvePointValue::MinimumValue() const
{
   return -1.0;
}

double ICCCurvePointValue::MaximumValue() const
{
   return 1.0;
}

Any idea of where is the problem?

I'm working over the code of ColorSaturation, and just changed the names of several parameters...

Also, I have one doubt. CurveBase.h has included the parameters from the CurvesTransform process... Is it safe to remove that, or do I need to include them too? I'm going down the safe road, and doing the latter...
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Help with Linker error - CurvePointValue problem
« Reply #1 on: 2011 June 11 09:02:55 »
Just a wild guess: Is CurvesTransformationParameters.cpp (or the corresponding .o-file) part of your project?
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Help with Linker error - CurvePointValue problem
« Reply #2 on: 2011 June 11 10:17:49 »
yes
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Help with Linker error - CurvePointValue problem
« Reply #3 on: 2011 June 11 11:42:45 »
Quote
undefined reference to `pcl::CurvePointValue::CurvePointValue(pcl::MetaTable*)'
undefined reference to `vtable for pcl::CurvePointValue'

Your project is missing the implementation of CurvePointValue. You have declared this class, but the definition is either lacking or incomplete.

CurvePointValue is declared in CurvesTransformationParameters.h. Most of its member functions are defined in CurvesTransformationParameters.cpp. As Georg has pointed out, this file is probably missing in your project, or for some reason it is not being compiled (for example, due to misplaced/incorrect #defines).

Quote
Also, I have one doubt. CurveBase.h has included the parameters from the CurvesTransform process... Is it safe to remove that, or do I need to include them too?

Since your process (InterChannelCurves —by the way, I don't like that name :) ) is sharing some metaparameters with CurvesTransformation, you definitely need to include CurvesTransformationParameters.h and CurvesTransformationParameters.cpp in your project. There should be no problem in doing that; after all, this is now happening with ColorSaturation. Follow the latter as an example to implement your code —you already are doing that.

How about:

FlexibleCurvesTM

? :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Help with Linker error - CurvePointValue problem
« Reply #4 on: 2011 June 11 12:12:30 »
...
FlexibleCurvesTM

Finally going into marketing  ? ;)
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Help with Linker error - CurvePointValue problem
« Reply #6 on: 2011 June 11 12:53:58 »
My bad :P Indeed I was not including CurvesTransformParameters.cpp... now it compiles. But, now I'm getting this error when installing the module:

undefined symbol:
_ZNK3pcl9CurveBase16InitInterpolatorEv): Module load error


:S
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Help with Linker error - CurvePointValue problem
« Reply #7 on: 2011 June 11 14:04:56 »
Probably another file you need to add. To demangle symbols, try this:
Code: [Select]
> c++filt _ZNK3pcl9CurveBase16InitInterpolatorEv
pcl::CurveBase::InitInterpolator() const
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Help with Linker error - CurvePointValue problem
« Reply #8 on: 2011 June 13 12:58:41 »
This is making me mad... To test if the problem was something I did to the code, I decided to just copy the IntensityTransform module, delete the innecesary files (just left the *Module.*, ColorSaturation*.* and CurvesTransformParameters.* codes, commenting the module.cpp).
This compiles fine, but throws the same error at installation as in my previous message. Which other file do I need to include? Compiling the whole module works...
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Help with Linker error - CurvePointValue problem
« Reply #9 on: 2011 June 13 14:20:17 »
CurveBase::InitInterpolator() is defined in CurvesTransformtionInstance.cpp (I would have expected it in CurveBase.cpp, but that does not exist).

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Help with Linker error - CurvePointValue problem
« Reply #10 on: 2011 June 13 17:46:56 »
Pfff..... thanks Georg ;)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Help with Linker error - CurvePointValue problem
« Reply #11 on: 2011 June 13 18:56:09 »
Eureka! Adding the definition to my Instance.cpp file solved the issue :) New module soon ;)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com