electronicarts / EASTL

EASTL stands for Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance.
BSD 3-Clause "New" or "Revised" License
7.82k stars 905 forks source link

Building EASTL #497

Open superwills opened 1 year ago

superwills commented 1 year ago

I experienced problems trying to build/link using the build downloaded by vcpkg

1>ConsoleApplication1.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned __int64,char const *,int,unsigned int,char const *,int)" (??_U@YAPEAX_KPEBDHI1H@Z)
1>ConsoleApplication1.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned __int64,unsigned __int64,unsigned __int64,char const *,int,unsigned int,char const *,int)" (??_U@YAPEAX_K00PEBDHI1H@Z)

I was able to compile & run from the github repo using @spacelg's steps, and do some testing from within the Test Suite. (Alternatively to @spacelg's step 7, you can open & build in Visual Studio).

Would it be a good idea to incorporate @spacelg's build steps into README.md?

I think it may be worth mentioning in the documentation that starting with the test suite is a great way to learn & get comfortable with EASTL.

indigogem commented 7 months ago

you need to override global new (and currently there is two types), consider to build EASTL and your proj with EASTL_USER_DEFINED_ALLOCATOR and implement custom allocator to be able also custom delete

void* __cdecl operator new[](size_t size, const char* name, int flags, unsigned debugFlags, const char* file, int line)
{
    return new uint8_t[size];
}

void* __cdecl operator new[](unsigned __int64 size, unsigned __int64 alignment, unsigned __int64 offset, char const* pName, int flags, unsigned int debugFlags, char const* file, int line)
{

    return new uint8_t[size];
}