Hello everyone,
I am planning on using a MultiScalarField
to keep track of a few flags. For setting and using those flags I want to use bitwise operators. As such, the type that I wanted to store the flags in is unsigned long
, however during compiling, a few errors popped up.
Compile error
/usr/bin/ld: CMakeFiles/test2D.dir/test2D.cpp.o: in function `non-virtual thunk to plb::MultiScalarField2D<unsigned long>::getTypeInfo[abi:cxx11]() const':
test2D.cpp:(.text._ZNK3plb18MultiScalarField2DImE11getTypeInfoB5cxx11Ev[_ZNK3plb18MultiScalarField2DImE11getTypeInfoB5cxx11Ev]+0x33): undefined reference to `plb::NativeType<unsigned long>::getName()'
/usr/bin/ld: CMakeFiles/test2D.dir/test2D.cpp.o: in function `plb::MultiScalarField2D<unsigned long>::getTypeInfo[abi:cxx11]() const':
test2D.cpp:(.text._ZNK3plb18MultiScalarField2DImE11getTypeInfoB5cxx11Ev[_ZNK3plb18MultiScalarField2DImE11getTypeInfoB5cxx11Ev]+0x203): undefined reference to `plb::NativeType<unsigned long>::getName()'
/usr/bin/ld: CMakeFiles/test2D.dir/test2D.cpp.o: in function `__static_initialization_and_destruction_1(int, int) [clone .constprop.0]':
test2D.cpp:(.text.startup+0x2fd): undefined reference to `plb::NativeType<unsigned long>::getName()'
collect2: error: ld returned 1 exit status ```
It seems that in src\core\plbTypenames.h & .cpp
several types are predefined such that other functions can access the type name. However, no unsigned versions of these types exists. Adding the unsigned long
version to the NativeType
and NativeTypeConstructor
fixes the compile error, but I have a few open questions.
- Is there a reason why no unsigned types are implemented?
- Should I add the unsigned type elsewhere as well? (except for in the
NativeType
andNativeTypeConstructor
)
Thank you and regards,
Julius