t0rakka / mango

Other
58 stars 9 forks source link

cannot initialize a variable of type 'void *' with an rvalue of type 'FARPROC' (aka 'long long (*)()') #6

Closed tksuoran closed 2 weeks ago

tksuoran commented 1 month ago

Trying to build my fork of mango in msys2 clang64 environment using clang 18.1.8 gives this error:

mango/source/mango/core/win32/dynamic_library.cpp:38:19: error: cannot initialize a variable of type 'void *' with an rvalue of type 'FARPROC' (aka 'long long (*)()')
   38 |             void* ptr = ::GetProcAddress(handle, symbol.c_str());
      |                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

The code looks same in here in "proper" mango repo.

t0rakka commented 1 month ago

I don't have MSYS2 or windows close by (vacation) just macOS laptop, so I'll try reinterpret_cast magic and commit it, let me know if it worked.. =/ If it doesn't, you have the environment; propose a fix instead.. let's get this compiling again! =P

For now, let me know if the fix worked. :)

t0rakka commented 2 weeks ago

Installed MSYS2, fixed every issue I could find with clang-18 and gcc-13+14 so closing this with some extra fixes thrown in as bonus.