I have a custom implementation of Int128 for use on Windows as MSVC doesn’t support __int128
. I’m using thrust. My implementation works fine when I inline the code, however this approach breaks when I compile multiple objects that use my inlined includes as I get errors that symbols are already defined.
I tried to solve this problem by switching to static-linking, but I’m getting a lot of linker errors that don’t make sense to me. The one I’m hung up on now is:
Unresolved extern function ‘ZplRK8int128_tS1’
This demangles to operator+(int128_t const&, int128_t const&)
. If I remove this function, I get a compiler error that the operator doesn’t exist. If I inline the function in the header file, I get the same “Unresolved extern function” error, which is strange to me, because the implementation is definitely there.
My hunch is that I’m hitting some type of upper-limit on the number of symbols I can export in an object, given the size of the Int128 implementation, but I tried to break up the class and I’m getting similarly odd linker errors about extern functions not being defined.
Am I missing something obvious? Any suggestions on how to chase this down?