flext icon indicating copy to clipboard operation
flext copied to clipboard

Duplicate symbol for new / delete since pulling latest changes

Open jamiebullock opened this issue 4 years ago • 1 comments

Hi...

Since pulling the latest version of Flext master into my project, I am getting link errors:

duplicate symbol 'operator delete[](void*)' in:
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_base.o
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_regression.o
duplicate symbol 'operator new(unsigned long)' in:
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_base.o
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_regression.o

etc

I am defining FLEXT_USE_CMEM which used to fix this (I think). I am also using FLEXT_INLINE and FLEXT_USESIMD

Any ideas?

jamiebullock avatar May 15 '21 14:05 jamiebullock

Hello.

I ran into the same problem. The duplicated symbols come from the global operators overwritten in flsupport.cpp.

It happened for me when i tried to compile a library with several externals - each defining the global operators (new, delete, new[], delete[] in my case).

It seems to me that those global operators are not needed, so i deleted them. It links fine, the externals work as expected.

i-n-g-o avatar Jan 02 '22 14:01 i-n-g-o