Project

General

Profile

Undefined Reference to ::persist in Release Mode, compiles fine in Debug

Added by Christian Meyer almost 2 years ago

Hi there,

I have developed in Debug Mode for a While and building works as expected.
Now changing over to Release mode, the linker gives me this error and I have no Idea where to even begin looking

Did Anyone come across this problem before?

in function `void Wt::Dbo::hasOne<Wt::Dbo::DropSchema, ContactForm::Dbo::Location>(Wt::Dbo::DropSchema&, Wt::Dbo::weak_ptr<ContactForm::Dbo::Location>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':

Address.cpp:(.text._ZN2Wt3Dbo6hasOneINS0_10DropSchemaEN11ContactForm3Dbo8LocationEEEvRT_RNS0_8weak_ptrIT0_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN2Wt3Dbo6hasOneINS0_10DropSchemaEN11ContactForm3Dbo8LocationEEEvRT_RNS0_8weak_ptrIT0_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1d2): 

undefined reference to `void ContactForm::Dbo::Location::persist<Wt::Dbo::DropSchema>(Wt::Dbo::DropSchema&)'

What might be of interest: The Location Class uses another Class as IdType, as seen in another thread
https://redmine.emweb.be/boards/2/topics/18360

But I am not sure if that is the case here.

Any thoughts are welcome at this point.

Building With CMake, only difference between building in Debug and Release is the Link to wt_D Connectors

Ran into this, while updating to wt-4.10.0, but also checked with 4.9.2

Thanks


Replies (1)

[[SOLVED]]: Undefined Reference to ::persist in Release Mode, compiles fine in Debug - Added by Christian Meyer almost 2 years ago

Error comes back to the File Structure I used...

I kept the Persist function implementation in the .cpp file.

Once I moved it into the .h file, no problem with the compiling anymore

If you know why that happens, and why debug is fine with this structure, I'd be very happy to learn about that!

Thanks

    (1-1/1)