ethteck / splat

A binary splitting tool to assist with decompilation and modding projects
MIT License
159 stars 42 forks source link

C++ Unable to declare functions in Header #368

Closed weirdbeardgame closed 4 months ago

weirdbeardgame commented 4 months ago

Currently when compiling a C++ project I'm unable to declare functions in the header because it fails to mangle the function name.

https://github.com/weirdbeardgame/Fatal-Frame-2/blob/cc7427560f4a3d49422dc387600694d87e01f3f8/include/main/gphase.h#L133

https://github.com/weirdbeardgame/Fatal-Frame-2/blob/cc7427560f4a3d49422dc387600694d87e01f3f8/src/main/gphase.c#L114

pixel-stuck commented 4 months ago

How is this related to splat? Seems like a build system issue

weirdbeardgame commented 4 months ago

All of the build system commands set C++ All of the includes are right.

I tried changing GCC to G++ and basically anything off the bat I could think to identify.

There's no linker issues it just sees the headers as C and won't mangle them

pixel-stuck commented 4 months ago

Yeah, I'm saying, splat isn't your issue here, so making an issue in the splat repo isn't appropriate. Your build system is at fault, and I'm sure someone is happy to help on discord, but this is for issue tracking of splat bugs/issues, not your build system

AngheloAlf commented 4 months ago

This does indeed sound like a build system issue. What I imagine the issue may be is that you are trying to compile a .c file. Both gcc and g++ infer the language of the file by looking at the file extension, since this is a .c file them both of them compile it as a C file. You can either rename the file to .cpp or try passing the -x c++ flag.

I'll close this issue since it is not related with splat at all.