Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Support #90

Open
luciusDXL opened this issue Jan 3, 2021 · 48 comments
Open

Mac Support #90

luciusDXL opened this issue Jan 3, 2021 · 48 comments
Assignees
Labels
enhancement A feature that enhances the project.

Comments

@luciusDXL
Copy link
Owner

The Force Engine should compile and run on recent OS X platforms, including M1 Macs.

@luciusDXL luciusDXL added the enhancement A feature that enhances the project. label Jan 3, 2021
@luciusDXL luciusDXL self-assigned this Jan 3, 2021
@gilmorem560
Copy link
Contributor

In addition to the changes needed for #89, I'm finding that clang++ on macOS Monterey at least does not appear to be happy with in-place object instantiation/anonymous initialization. I by no means consider myself a C++ savant, so I'm not sure what the proper term for that is in this language, but for instance on line 173 of TFE_Asset/vueAsset.cpp:

transforms.push_back({ rotScale, translation });

fails in clang++, but:

VueTransform transform = { rotScale, translation };

transforms.push_back(transform);

works.

That aside, stepping through the basics of a macOS build, I'll mention any particular gotchas here, then resolve the necessary changes between this and #89, then expect another PR with the code changes relevant to a functional build on both. That said, I'll make note that I may require someone else to run through building a Windows copy with those changes to ensure there are no regressions before merge, I don't have a Windows machine I could use for that currently.

@sofakng
Copy link

sofakng commented Sep 19, 2023

Is this still on the roadmap or being developed?

@gilmorem560
Copy link
Contributor

I haven't touched anything personally in a while. There was some debate over the use of XDG variables in the past (not POSIX, don't apply to macOS) but most other stuff done for the Linux support, at least that I contributed to, should be POSIX and therefore constitute mac support as well.

I seem to recall all of one time actually getting the OpenGL surface to pop up, but it was so long ago now, I don't know if that has since been paved over.

All that to say, I suspect that it shouldn't be hard to get this over the finish line for macOS, but I'm not actively making any contributions at this point and couldn't tell you who is paying attention to portability concerns.

If anyone does want to take a concerted swing at it I'm happy to help out.

P.S. A bridge to this working may be experimenting with the codebase using XQuartz. That'll get you running on macOS without needing as much of the underlying toolkit stuff to be perfectly Cocoa-ready.

@dgorshkov
Copy link

(this is an upvote)

@sofakng
Copy link

sofakng commented Dec 14, 2023

I would also really like to see macOS support...

@gilmorem560
Copy link
Contributor

At the time (two years ago) the work as I saw it entailed taking the Linux build at the time, trying to build it on Mac, and squashing compiler bugs as they arose. I don't know what state the Linux build is in today, but so long as Linux support bits are built in a POSIX-y way, the only Mac-specific bits would be Cocoa-related methinks, and imGUI may abstract most if not all of that away. Well that and the object instantiation mentioned above, clang doesn't like it.

If that eases anyone's trepidation at taking a swing, that's what I would do if I had bandwidth to start studying this again, I don't remember running into a question I couldn't answer through available documentation back when I got an OpenGL surface to pop up on my Mac properly. Good luck!

@mikesk8
Copy link

mikesk8 commented Apr 5, 2024

Is there still a chance the Mac version happens soon? ;-)

@Burrito78
Copy link

Just leaving a comment as my vote for a macOS build. Thank you.

@jodaco
Copy link

jodaco commented Jul 7, 2024

Tried to build on an M1 Mac and thought I would note a few issues here, unclear if some of these are clang related or MacOS's STL at this time:

  • sprintf is currently deprecated on MacOS, get warnings about it
  • QUAD_MAX is defined in limits.h
  • clang doesn't like while (buf[i++] = readNumber(&ptr));, it wants parentheses around the assignment inside the while loop's parantheses
  • clang also does not seem like switch statements that don't have a default case handler, in case of the KEYWORD enum being handled, it complains of not every enum value being handled.
  • Some calls to TFE_System::logWrite pass a std::string through a variadic function, which is not allowed.
  • Conversions from size_t * (unsigned long *) fail to the various int types in the memory handler

There are perhaps more issues, but this is what I had time to collect today.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 8, 2024

Tried to build on an M1 Mac and thought I would note a few issues here, unclear if some of these are clang related or MacOS's STL at this time:

* [ ]  sprintf is currently deprecated on MacOS, get warnings about it

* [ ]  QUAD_MAX is defined in limits.h

Are these 2 apple specific things? I don't see sprintf() being deprecated in any official standards document, and QUAD_MAX isn't predefined on linux/windows either. But the change is simple enough.

* [ ]  clang doesn't like while (buf[i++] = readNumber(&ptr));, it wants parentheses around the assignment inside the while loop's parantheses

* [ ]  clang also does not seem like switch statements that don't have a default case handler, in case of the KEYWORD enum being handled, it complains of not every enum value being handled.

Yeah clang-only warnings,

* [ ]  Conversions from size_t * (unsigned long *) fail to the various int types in the memory handler

Don't see those with clang on linux, can you please post the error messages?

@jodaco
Copy link

jodaco commented Jul 8, 2024

All the libraries that TFE depends on seem to be available on MacOS, so I thought I would try and build it and see how far I got.

__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")

sprintf complains on windows as well I believe, but this is a simple macro to define to make the messages go away, and obviously it's just noise, not an absolute requirement to fix.

Another one I missed, LINE_MAX

#define LINE_MAX 65536
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/sys/syslimits.h:110:9: note: previous definition is here
#define LINE_MAX                 2048   /* max bytes in an input line */
        ^
#define QUAD_MAX 1024

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/arm/limits.h:120:9: note: previous definition is here
#define QUAD_MAX        LLONG_MAX
                file->write(&region->blockArrCapacity);
                ~~~~~~^~~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:49:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s8 *' (aka 'const signed char *') for 1st argument
        void write(const s8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:50:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u8 *' (aka 'const unsigned char *') for 1st argument
        void write(const u8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:51:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s16 *' (aka 'const short *') for 1st argument
        void write(const s16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:52:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u16 *' (aka 'const unsigned short *') for 1st argument
        void write(const u16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:53:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s32 *' (aka 'const int *') for 1st argument
        void write(const s32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:54:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u32 *' (aka 'const unsigned int *') for 1st argument
        void write(const u32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:55:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s64 *' (aka 'const long long *') for 1st argument
        void write(const s64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:56:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u64 *' (aka 'const unsigned long long *') for 1st argument
        void write(const u64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:57:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f32 *' (aka 'const float *') for 1st argument
        void write(const f32* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:58:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f64 *' (aka 'const double *') for 1st argument
        void write(const f64* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:59:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const std::string *' (aka 'const basic_string<char> *') for 1st argument
        void write(const std::string* ptr, u32 count=1) override { writeString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:484:9: error: no matching member function for call to 'write'
                file->write(&region->blockCount);
                ~~~~~~^~~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:49:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s8 *' (aka 'const signed char *') for 1st argument
        void write(const s8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:50:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u8 *' (aka 'const unsigned char *') for 1st argument
        void write(const u8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:51:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s16 *' (aka 'const short *') for 1st argument
        void write(const s16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:52:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u16 *' (aka 'const unsigned short *') for 1st argument
        void write(const u16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:53:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s32 *' (aka 'const int *') for 1st argument
        void write(const s32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:54:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u32 *' (aka 'const unsigned int *') for 1st argument
        void write(const u32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:55:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s64 *' (aka 'const long long *') for 1st argument
        void write(const s64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:56:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u64 *' (aka 'const unsigned long long *') for 1st argument
        void write(const u64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:57:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f32 *' (aka 'const float *') for 1st argument
        void write(const f32* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:58:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f64 *' (aka 'const double *') for 1st argument
        void write(const f64* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:59:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const std::string *' (aka 'const basic_string<char> *') for 1st argument
        void write(const std::string* ptr, u32 count=1) override { writeString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:485:9: error: no matching member function for call to 'write'
                file->write(&region->blockSize);
                ~~~~~~^~~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:49:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s8 *' (aka 'const signed char *') for 1st argument
        void write(const s8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:50:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u8 *' (aka 'const unsigned char *') for 1st argument
        void write(const u8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:51:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s16 *' (aka 'const short *') for 1st argument
        void write(const s16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:52:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u16 *' (aka 'const unsigned short *') for 1st argument
        void write(const u16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:53:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s32 *' (aka 'const int *') for 1st argument
        void write(const s32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:54:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u32 *' (aka 'const unsigned int *') for 1st argument
        void write(const u32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:55:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s64 *' (aka 'const long long *') for 1st argument
        void write(const s64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:56:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u64 *' (aka 'const unsigned long long *') for 1st argument
        void write(const u64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:57:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f32 *' (aka 'const float *') for 1st argument
        void write(const f32* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:58:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f64 *' (aka 'const double *') for 1st argument
        void write(const f64* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:59:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const std::string *' (aka 'const basic_string<char> *') for 1st argument
        void write(const std::string* ptr, u32 count=1) override { writeString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:486:9: error: no matching member function for call to 'write'
                file->write(&region->maxBlocks);
                ~~~~~~^~~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:49:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s8 *' (aka 'const signed char *') for 1st argument
        void write(const s8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:50:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u8 *' (aka 'const unsigned char *') for 1st argument
        void write(const u8*  ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:51:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s16 *' (aka 'const short *') for 1st argument
        void write(const s16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:52:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u16 *' (aka 'const unsigned short *') for 1st argument
        void write(const u16* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:53:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s32 *' (aka 'const int *') for 1st argument
        void write(const s32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:54:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u32 *' (aka 'const unsigned int *') for 1st argument
        void write(const u32* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:55:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const s64 *' (aka 'const long long *') for 1st argument
        void write(const s64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:56:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const u64 *' (aka 'const unsigned long long *') for 1st argument
        void write(const u64* ptr, u32 count=1)  override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:57:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f32 *' (aka 'const float *') for 1st argument
        void write(const f32* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:58:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const f64 *' (aka 'const double *') for 1st argument
        void write(const f64* ptr, u32 count=1) override { writeType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:59:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'const std::string *' (aka 'const basic_string<char> *') for 1st argument
        void write(const std::string* ptr, u32 count=1) override { writeString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:546:10: error: no matching member function for call to 'read'
                        file->read(&region->blockArrCapacity);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:547:10: error: no matching member function for call to 'read'
                        file->read(&region->blockCount);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:548:10: error: no matching member function for call to 'read'
                        file->read(&region->blockSize);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:549:10: error: no matching member function for call to 'read'
                        file->read(&region->maxBlocks);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:555:10: error: no matching member function for call to 'read'
                        file->read(&blockArrCapacity);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:556:10: error: no matching member function for call to 'read'
                        file->read(&blockCount);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:557:10: error: no matching member function for call to 'read'
                        file->read(&blockSize);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_Memory/memoryRegion.cpp:558:10: error: no matching member function for call to 'read'
                        file->read(&maxBlocks);
                        ~~~~~~^~~~
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:36:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's8 *' (aka 'signed char *') for 1st argument
        void read(s8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:37:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u8 *' (aka 'unsigned char *') for 1st argument
        void read(u8*  ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:38:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's16 *' (aka 'short *') for 1st argument
        void read(s16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:39:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u16 *' (aka 'unsigned short *') for 1st argument
        void read(u16* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:40:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's32 *' (aka 'int *') for 1st argument
        void read(s32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:41:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u32 *' (aka 'unsigned int *') for 1st argument
        void read(u32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:42:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 's64 *' (aka 'long long *') for 1st argument
        void read(s64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:43:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'u64 *' (aka 'unsigned long long *') for 1st argument
        void read(u64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:44:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f32 *' (aka 'float *') for 1st argument
        void read(f32* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:45:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'f64 *' (aka 'double *') for 1st argument
        void read(f64* ptr, u32 count=1) override { readType(ptr, count); }
             ^
/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:46:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *') to 'std::string *' (aka 'basic_string<char> *') for 1st argument
        void read(std::string* ptr, u32 count=1) override { readString(ptr, count); }

My simple fix to get past the errors was just to add a read and write method that took size_t * instead of one of the project defined integer types. I was a little hesitant as this was my first 15 minutes looking at the actual code base and didn't want to modify something that might be reading or writing from data files where there are expected/required sizes of objects inside the files.

I also modified CMakeLists line 59 to if(LINUX OR MACOS) to get it to build

If I have a little more time, I could throw together a pull request on a few of the smaller changes

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 8, 2024

/Users/jonathan/code/TheForceEngine/TheForceEngine/TFE_FileSystem/filestream.h:51:7: note: candidate function not viable: no known conversion from 'size_t *' (aka 'unsigned long *')

How many bits does an "unsigned long" have on Apple? A bit strange that it does not match either the u32 or u64 specialization.

Could you please test PR #419 ? Thanks!

@gilmorem560
Copy link
Contributor

The sprintf->snprintf replacement should be fine, with the understanding this is an ANSI C99 extension.

For the size_t thing, size_t is defined as the type returned by sizeof () on a particular platform, so ideally should only be used in this context. If something else is being coerced to size_t and back out, that may be something where the type should be redefined elsewhere.

Could the issues be due to it being a pointer to size_t rather than size_t itself? C gets iffy on conversions between pointers of different types without a cast. This owes to some platforms historically having different pointer representations for different data types, even though this is quite uncommon nowadays.

What I'd do is inspect whether these variables of size_t are truly defined as the result of the sizeof () operator. If they aren't, then size_t technically isn't the right type for them, even if they may for instance be array indices. This is especially true if the field is from a binary file, because it may have originated as a size_t on the host platform (MS-DOS, x86), but it has since been flattened into a machine long-word, and is no longer defined as the general result of sizeof () on , it is a 4-byte little-endian value which is best read out as bytes and composited into a uint32_t (or equivalent). Granted you may cast it to size_t in appropriate places, but just understand you need to make sure you have the reverse of that casting and compositing anywhere you need to go back to the binary format.

@jodaco
Copy link

jodaco commented Jul 8, 2024

The sprintf->snprintf replacement should be fine, with the understanding this is an ANSI C99 extension.

For the size_t thing, size_t is defined as the type returned by sizeof () on a particular platform, so ideally should only be used in this context. If something else is being coerced to size_t and back out, that may be something where the type should be redefined elsewhere.

I agree, I was trying minimal changes just to get it to build, this seems to be the culprit here (or atleast the first one that threw the errors):

{
	char name[32];
	MemoryBlock** memBlocks;
	size_t blockArrCapacity;

	size_t blockCount;
	size_t blockSize;
	size_t maxBlocks;
};

Could the issues be due to it being a pointer to size_t rather than size_t itself? C gets iffy on conversions between pointers of different types without a cast. This owes to some platforms historically having different pointer representations for different data types, even though this is quite uncommon nowadays.

Likely the case, from memoryRegion.cpp:475:

	{
		if (!region || !file || !file->isOpen())
		{
			return false;
		}

		file->writeBuffer(region->name, 32);
		file->write(&region->blockArrCapacity);
		file->write(&region->blockCount);
		file->write(&region->blockSize);
		file->write(&region->maxBlocks);

What I'd do is inspect whether these variables of size_t are truly defined as the result of the sizeof () operator. If they aren't, then size_t technically isn't the right type for them, even if they may for instance be array indices. This is especially true if the field is from a binary file, because it may have originated as a size_t on the host platform (MS-DOS, x86), but it has since been flattened into a machine long-word, and is no longer defined as the general result of sizeof () on , it is a 4-byte little-endian value which is best read out as bytes and composited into a uint32_t (or equivalent). Granted you may cast it to size_t in appropriate places, but just understand you need to make sure you have the reverse of that casting and compositing anywhere you need to go back to the binary format.

Presently, I have next to no understanding of the code base, but am aware it descends from dos, so until I have a better understanding of how the code base works, I'm hesitant to start making any bigger changes myself, I just wanted to see it build.

An unsigned long, which is what size_t is defined as is 8 bytes, as is the size of pointers, just built a test program.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 8, 2024

The sprintf->snprintf replacement should be fine, with the understanding this is an ANSI C99 extension.
For the size_t thing, size_t is defined as the type returned by sizeof () on a particular platform, so ideally should only be used in this context. If something else is being coerced to size_t and back out, that may be something where the type should be redefined elsewhere.

I agree, I was trying minimal changes just to get it to build, this seems to be the culprit here (or atleast the first one that threw the errors):

{
	char name[32];
	MemoryBlock** memBlocks;
	size_t blockArrCapacity;

	size_t blockCount;
	size_t blockSize;
	size_t maxBlocks;
};

Ah, change them to u64 and you should be good to go. And it'll make savegames from 32 and 64bit builds compatible as well.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 8, 2024

i.e.:

index cf859d22..59565001 100644
--- a/TheForceEngine/TFE_Memory/memoryRegion.cpp
+++ b/TheForceEngine/TFE_Memory/memoryRegion.cpp
@@ -80,11 +80,11 @@ struct MemoryRegion
 {
 	char name[32];
 	MemoryBlock** memBlocks;
-	size_t blockArrCapacity;
+	u64 blockArrCapacity;
 
-	size_t blockCount;
-	size_t blockSize;
-	size_t maxBlocks;
+	u64 blockCount;
+	u64 blockSize;
+	u64 maxBlocks;
 };
 
 static_assert(sizeof(RegionAllocHeader) == 16, "RegionAllocHeader is the wrong size.");
@@ -98,7 +98,7 @@ namespace TFE_Memory
 	static const u32 c_relativeOffsetMask = (1u << c_relativeBlockShift) - 1u;
 
 	void freeSlot(RegionAllocHeader* alloc, RegionAllocHeader* next, MemoryBlock* block);
-	size_t alloc_align(size_t baseSize);
+	u64 alloc_align(u64 baseSize);
 	s32  getBinFromSize(u32 size);
 	bool allocateNewBlock(MemoryRegion* region);
 	void removeHeaderFromFreelist(MemoryBlock* block, RegionAllocHeader* header);
@@ -137,7 +137,7 @@ namespace TFE_Memory
 		}
 	}
 
-	MemoryRegion* region_create(const char* name, size_t blockSize, size_t maxSize)
+	MemoryRegion* region_create(const char* name, u64 blockSize, u64 maxSize)
 	{
 		assert(name);
 		if (!name || !blockSize) { return nullptr; }
@@ -206,8 +206,8 @@ namespace TFE_Memory
 		if (header->size - size >= MIN_SPLIT_SIZE)
 		{
 			// Split.
-			size_t split0 = size;
-			size_t split1 = header->size - split0;
+			u64 split0 = size;
+			u64 split1 = header->size - split0;
 			RegionAllocHeader* next = (RegionAllocHeader*)((u8*)header + split0);
 
 			// Cleanup the free list.
@@ -231,7 +231,7 @@ namespace TFE_Memory
 		return (u8*)header + sizeof(RegionAllocHeader);
 	}
 
-	void* region_alloc(MemoryRegion* region, size_t size)
+	void* region_alloc(MemoryRegion* region, u64 size)
 	{
 		assert(region);
 		if (size == 0) { return nullptr; }
@@ -283,7 +283,7 @@ namespace TFE_Memory
 		return nullptr;
 	}
 
-	void* region_realloc(MemoryRegion* region, void* ptr, size_t size)
+	void* region_realloc(MemoryRegion* region, void* ptr, u64 size)
 	{
 		assert(region);
 		if (!ptr) { return region_alloc(region, size); }
@@ -336,8 +336,8 @@ namespace TFE_Memory
 					if (header->size - size >= MIN_SPLIT_SIZE)
 					{
 						// Split.
-						size_t split0 = size;
-						size_t split1 = header->size - split0;
+						u64 split0 = size;
+						u64 split1 = header->size - split0;
 						RegionAllocHeader* next = (RegionAllocHeader*)((u8*)header + split0);
 
 						// Reset the header.
@@ -408,9 +408,9 @@ namespace TFE_Memory
 		}
 	}
 		
-	size_t region_getMemoryUsed(MemoryRegion* region)
+	u64 region_getMemoryUsed(MemoryRegion* region)
 	{
-		size_t used = 0;
+		u64 used = 0;
 		for (s32 i = 0; i < region->blockCount; i++)
 		{
 			used += (region->blockSize - region->memBlocks[i]->sizeFree);
@@ -418,13 +418,13 @@ namespace TFE_Memory
 		return used;
 	}
 
-	void region_getBlockInfo(MemoryRegion* region, size_t* blockCount, size_t* blockSize)
+	void region_getBlockInfo(MemoryRegion* region, u64* blockCount, u64* blockSize)
 	{
 		*blockCount = region->blockCount;
 		*blockSize = region->blockSize;
 	}
 
-	size_t region_getMemoryCapacity(MemoryRegion* region)
+	u64 region_getMemoryCapacity(MemoryRegion* region)
 	{
 		return region->blockCount * region->blockSize;
 	}
@@ -539,7 +539,7 @@ namespace TFE_Memory
 			return nullptr;
 		}
 
-		size_t blockAllocStart = 0;
+		u64 blockAllocStart = 0;
 		file->readBuffer(region->name, 32);
 		if (region->blockArrCapacity == 0)
 		{
@@ -551,7 +551,7 @@ namespace TFE_Memory
 		}
 		else
 		{
-			size_t blockArrCapacity, blockCount, blockSize, maxBlocks;
+			u64 blockArrCapacity, blockCount, blockSize, maxBlocks;
 			file->read(&blockArrCapacity);
 			file->read(&blockCount);
 			file->read(&blockSize);
@@ -669,7 +669,7 @@ namespace TFE_Memory
 		insertBlockIntoFreelist(block, alloc);
 	}
 
-	size_t alloc_align(size_t baseSize)
+	u64 alloc_align(u64 baseSize)
 	{
 		return (baseSize + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
 	}
@@ -771,7 +771,7 @@ namespace TFE_Memory
 			return false;
 		}
 
-		size_t blockIndex = region->blockCount;
+		u64 blockIndex = region->blockCount;
 		assert(blockIndex < region->blockArrCapacity);
 		region->memBlocks[blockIndex] = (MemoryBlock*)malloc(sizeof(MemoryBlock) + region->blockSize);
 		if (!region->memBlocks[blockIndex])
@@ -799,12 +799,12 @@ namespace TFE_Memory
 	// Malloc = 0.005514 sec.
 	// Region = 0.000991 sec.
 	#define ALLOC_COUNT 20000
-	const size_t _testAllocSize[] = { 16, 32, 24, 100, 200, 500, 327, 537, 200, 17, 57, 387, 874, 204, 100, 22 };
+	const u64 _testAllocSize[] = { 16, 32, 24, 100, 200, 500, 327, 537, 200, 17, 57, 387, 874, 204, 100, 22 };
 
 	void region_test()
 	{
 		u64 start = TFE_System::getCurrentTimeInTicks();
-		const size_t mask = TFE_ARRAYSIZE(_testAllocSize) - 1;
+		const u64 mask = TFE_ARRAYSIZE(_testAllocSize) - 1;
 		void* alloc[ALLOC_COUNT];
 		for (s32 i = 0; i < ALLOC_COUNT; i++)
 		{
diff --git a/TheForceEngine/TFE_Memory/memoryRegion.h b/TheForceEngine/TFE_Memory/memoryRegion.h
index 034fe8bf..544633db 100644
--- a/TheForceEngine/TFE_Memory/memoryRegion.h
+++ b/TheForceEngine/TFE_Memory/memoryRegion.h
@@ -15,17 +15,17 @@ typedef u32 RelativePointer;
 
 namespace TFE_Memory
 {
-	MemoryRegion* region_create(const char* name, size_t blockSize, size_t maxSize = 0u);
+	MemoryRegion* region_create(const char* name, u64 blockSize, u64 maxSize = 0u);
 	void region_clear(MemoryRegion* region);
 	void region_destroy(MemoryRegion* region);
 
-	void* region_alloc(MemoryRegion* region, size_t size);
-	void* region_realloc(MemoryRegion* region, void* ptr, size_t size);
+	void* region_alloc(MemoryRegion* region, u64 size);
+	void* region_realloc(MemoryRegion* region, void* ptr, u64 size);
 	void  region_free(MemoryRegion* region, void* ptr);
 
-	size_t region_getMemoryUsed(MemoryRegion* region);
-	size_t region_getMemoryCapacity(MemoryRegion* region);
-	void region_getBlockInfo(MemoryRegion* region, size_t* blockCount, size_t* blockSize);
+	u64 region_getMemoryUsed(MemoryRegion* region);
+	u64 region_getMemoryCapacity(MemoryRegion* region);
+	void region_getBlockInfo(MemoryRegion* region, u64* blockCount, u64* blockSize);
 
 	RelativePointer region_getRelativePointer(MemoryRegion* region, void* ptr);
 	void* region_getRealPointer(MemoryRegion* region, RelativePointer ptr);

@jodaco
Copy link

jodaco commented Jul 8, 2024

Found one more instance of this, might u64 be a little large? As far as preserving compatibility with 32-bit systems, assuming this is actually a concern?

index 9886fa91..805e7579 100644
--- a/TheForceEngine/TFE_Game/igame.cpp
+++ b/TheForceEngine/TFE_Game/igame.cpp
@@ -17,7 +17,7 @@ MemoryRegion* s_levelRegion = nullptr;
 void displayMemoryUsage(const ConsoleArgList& args)
 {
 	char res[256];
-	size_t blockCount, blockSize;
+	u64 blockCount, blockSize;
 	region_getBlockInfo(s_gameRegion, &blockCount, &blockSize);
 	TFE_Console::addToHistory("-------------------------------------------------------------------");
 	TFE_Console::addToHistory("Region   | Memory Used | Current Capacity | Block Count | BlockSize");
diff --git a/TheForceEngine/TFE_Memory/memoryRegion.cpp b/TheForceEngine/TFE_Memory/memoryRegion.cpp
index cf859d22..59565001 100644
--- a/TheForceEngine/TFE_Memory/memoryRegion.cpp
+++ b/TheForceEngine/TFE_Memory/memoryRegion.cpp
@@ -80,11 +80,11 @@ struct MemoryRegion
 {
 	char name[32];
 	MemoryBlock** memBlocks;
-	size_t blockArrCapacity;
+	u64 blockArrCapacity;
 
-	size_t blockCount;
-	size_t blockSize;
-	size_t maxBlocks;
+	u64 blockCount;
+	u64 blockSize;
+	u64 maxBlocks;
 };
 
 static_assert(sizeof(RegionAllocHeader) == 16, "RegionAllocHeader is the wrong size.");
@@ -98,7 +98,7 @@ namespace TFE_Memory
 	static const u32 c_relativeOffsetMask = (1u << c_relativeBlockShift) - 1u;
 
 	void freeSlot(RegionAllocHeader* alloc, RegionAllocHeader* next, MemoryBlock* block);
-	size_t alloc_align(size_t baseSize);
+	u64 alloc_align(u64 baseSize);
 	s32  getBinFromSize(u32 size);
 	bool allocateNewBlock(MemoryRegion* region);
 	void removeHeaderFromFreelist(MemoryBlock* block, RegionAllocHeader* header);
@@ -137,7 +137,7 @@ namespace TFE_Memory
 		}
 	}
 
-	MemoryRegion* region_create(const char* name, size_t blockSize, size_t maxSize)
+	MemoryRegion* region_create(const char* name, u64 blockSize, u64 maxSize)
 	{
 		assert(name);
 		if (!name || !blockSize) { return nullptr; }
@@ -206,8 +206,8 @@ namespace TFE_Memory
 		if (header->size - size >= MIN_SPLIT_SIZE)
 		{
 			// Split.
-			size_t split0 = size;
-			size_t split1 = header->size - split0;
+			u64 split0 = size;
+			u64 split1 = header->size - split0;
 			RegionAllocHeader* next = (RegionAllocHeader*)((u8*)header + split0);
 
 			// Cleanup the free list.
@@ -231,7 +231,7 @@ namespace TFE_Memory
 		return (u8*)header + sizeof(RegionAllocHeader);
 	}
 
-	void* region_alloc(MemoryRegion* region, size_t size)
+	void* region_alloc(MemoryRegion* region, u64 size)
 	{
 		assert(region);
 		if (size == 0) { return nullptr; }
@@ -283,7 +283,7 @@ namespace TFE_Memory
 		return nullptr;
 	}
 
-	void* region_realloc(MemoryRegion* region, void* ptr, size_t size)
+	void* region_realloc(MemoryRegion* region, void* ptr, u64 size)
 	{
 		assert(region);
 		if (!ptr) { return region_alloc(region, size); }
@@ -336,8 +336,8 @@ namespace TFE_Memory
 					if (header->size - size >= MIN_SPLIT_SIZE)
 					{
 						// Split.
-						size_t split0 = size;
-						size_t split1 = header->size - split0;
+						u64 split0 = size;
+						u64 split1 = header->size - split0;
 						RegionAllocHeader* next = (RegionAllocHeader*)((u8*)header + split0);
 
 						// Reset the header.
@@ -408,9 +408,9 @@ namespace TFE_Memory
 		}
 	}
 		
-	size_t region_getMemoryUsed(MemoryRegion* region)
+	u64 region_getMemoryUsed(MemoryRegion* region)
 	{
-		size_t used = 0;
+		u64 used = 0;
 		for (s32 i = 0; i < region->blockCount; i++)
 		{
 			used += (region->blockSize - region->memBlocks[i]->sizeFree);
@@ -418,13 +418,13 @@ namespace TFE_Memory
 		return used;
 	}
 
-	void region_getBlockInfo(MemoryRegion* region, size_t* blockCount, size_t* blockSize)
+	void region_getBlockInfo(MemoryRegion* region, u64* blockCount, u64* blockSize)
 	{
 		*blockCount = region->blockCount;
 		*blockSize = region->blockSize;
 	}
 
-	size_t region_getMemoryCapacity(MemoryRegion* region)
+	u64 region_getMemoryCapacity(MemoryRegion* region)
 	{
 		return region->blockCount * region->blockSize;
 	}
@@ -539,7 +539,7 @@ namespace TFE_Memory
 			return nullptr;
 		}
 
-		size_t blockAllocStart = 0;
+		u64 blockAllocStart = 0;
 		file->readBuffer(region->name, 32);
 		if (region->blockArrCapacity == 0)
 		{
@@ -551,7 +551,7 @@ namespace TFE_Memory
 		}
 		else
 		{
-			size_t blockArrCapacity, blockCount, blockSize, maxBlocks;
+			u64 blockArrCapacity, blockCount, blockSize, maxBlocks;
 			file->read(&blockArrCapacity);
 			file->read(&blockCount);
 			file->read(&blockSize);
@@ -669,7 +669,7 @@ namespace TFE_Memory
 		insertBlockIntoFreelist(block, alloc);
 	}
 
-	size_t alloc_align(size_t baseSize)
+	u64 alloc_align(u64 baseSize)
 	{
 		return (baseSize + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
 	}
@@ -771,7 +771,7 @@ namespace TFE_Memory
 			return false;
 		}
 
-		size_t blockIndex = region->blockCount;
+		u64 blockIndex = region->blockCount;
 		assert(blockIndex < region->blockArrCapacity);
 		region->memBlocks[blockIndex] = (MemoryBlock*)malloc(sizeof(MemoryBlock) + region->blockSize);
 		if (!region->memBlocks[blockIndex])
@@ -799,12 +799,12 @@ namespace TFE_Memory
 	// Malloc = 0.005514 sec.
 	// Region = 0.000991 sec.
 	#define ALLOC_COUNT 20000
-	const size_t _testAllocSize[] = { 16, 32, 24, 100, 200, 500, 327, 537, 200, 17, 57, 387, 874, 204, 100, 22 };
+	const u64 _testAllocSize[] = { 16, 32, 24, 100, 200, 500, 327, 537, 200, 17, 57, 387, 874, 204, 100, 22 };
 
 	void region_test()
 	{
 		u64 start = TFE_System::getCurrentTimeInTicks();
-		const size_t mask = TFE_ARRAYSIZE(_testAllocSize) - 1;
+		const u64 mask = TFE_ARRAYSIZE(_testAllocSize) - 1;
 		void* alloc[ALLOC_COUNT];
 		for (s32 i = 0; i < ALLOC_COUNT; i++)
 		{
diff --git a/TheForceEngine/TFE_Memory/memoryRegion.h b/TheForceEngine/TFE_Memory/memoryRegion.h
index 034fe8bf..544633db 100644
--- a/TheForceEngine/TFE_Memory/memoryRegion.h
+++ b/TheForceEngine/TFE_Memory/memoryRegion.h
@@ -15,17 +15,17 @@ typedef u32 RelativePointer;
 
 namespace TFE_Memory
 {
-	MemoryRegion* region_create(const char* name, size_t blockSize, size_t maxSize = 0u);
+	MemoryRegion* region_create(const char* name, u64 blockSize, u64 maxSize = 0u);
 	void region_clear(MemoryRegion* region);
 	void region_destroy(MemoryRegion* region);
 
-	void* region_alloc(MemoryRegion* region, size_t size);
-	void* region_realloc(MemoryRegion* region, void* ptr, size_t size);
+	void* region_alloc(MemoryRegion* region, u64 size);
+	void* region_realloc(MemoryRegion* region, void* ptr, u64 size);
 	void  region_free(MemoryRegion* region, void* ptr);
 
-	size_t region_getMemoryUsed(MemoryRegion* region);
-	size_t region_getMemoryCapacity(MemoryRegion* region);
-	void region_getBlockInfo(MemoryRegion* region, size_t* blockCount, size_t* blockSize);
+	u64 region_getMemoryUsed(MemoryRegion* region);
+	u64 region_getMemoryCapacity(MemoryRegion* region);
+	void region_getBlockInfo(MemoryRegion* region, u64* blockCount, u64* blockSize);
 
 	RelativePointer region_getRelativePointer(MemoryRegion* region, void* ptr);
 	void* region_getRealPointer(MemoryRegion* region, RelativePointer ptr);

Made it to linking and can't find glew now, working on figuring out whatever MacOS does that is different than Linux now.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 8, 2024

Found one more instance of this, might u64 be a little large? As far as preserving compatibility with 32-bit systems, assuming this is actually a concern?

Changing them to u32 will break existing savegames, since size_t == u64 on windows and linux.

Made it to linking and can't find glew now, working on figuring out whatever MacOS does that is different than Linux now.

Ooh, maybe you want to try my PR #418 which gets rid of GLEW entirely, all you need is a recent SDL2.

@jodaco
Copy link

jodaco commented Jul 8, 2024

Applied your apple compat branch on PR #418, and this latest patch file with the u64 replacements and it moves along, but there is another linker error with SDL now, CMAKE seems to be handing the include path just fine but something is going wrong with the linker library paths, so far, we seem to be moving in the right direction, though. I've probably spent more time on this than I should have today, though.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 10, 2024

[...] there is another linker error with SDL now, CMAKE seems to be handing the include path just fine but something is going wrong with the linker library paths [...]

Does this change to cmake work for you? Can you please post the linker error? Maybe someone else with
Macos experience can find out how to fix it.

index 8624b35c..d9949acf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,8 +32,6 @@ endif()
 
 if (UNIX AND NOT APPLE)
        set(LINUX ON)
-elseif (UNIX AND APPLE)
-       set(MACOS ON)
 endif()
 
 if(WIN32)
@@ -61,22 +59,16 @@ if(ENABLE_TFE)
        add_executable(tfe)
        set_target_properties(tfe PROPERTIES OUTPUT_NAME "theforceengine")
 
-       if(LINUX)
+       if(UNIX)
                find_package(PkgConfig REQUIRED)
-               find_package(Threads REQUIRED)
                find_package(SDL2 2.0.20 REQUIRED)
-               pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
+               find_package(SDL2_Image REQUIRED)
                pkg_check_modules(GLEW REQUIRED glew)
-               set(OpenGL_GL_PREFERENCE GLVND)
-               find_package(OpenGL REQUIRED)
                target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
                target_include_directories(tfe PRIVATE ${SDL2_INCLUDE_DIRS})
                target_include_directories(tfe PRIVATE ${SDL2_IMAGE_INCLUDE_DIRS})
-               target_link_libraries(tfe PRIVATE
-                                       ${OPENGL_LIBRARIES}
+               target_link_libraries(tfe PRIVATE SDL2::SDL2main SDL2::SDL2 SDL2_image::SDL2_image
                                        ${GLEW_LIBRARIES}
-                                       ${SDL2_LIBRARIES}
-                                       ${SDL2_IMAGE_LIBRARIES}
                )
 
                if(NOT DISABLE_SYSMIDI)

@gilmorem560
Copy link
Contributor

gilmorem560 commented Jul 10, 2024

Ideally whatever variables are in play with the size_t/u32/u64 business would be defined as a fixed size and endianness, promoting portability of binary assets across platforms and architectures.

At the very least, binary I/O should read a byte at a time and use shifting and ORing to composite the value into whatever data type is used to then represent it in program logic, and likewise be partsed back out into individual bytes in a known endianness for saving. Think htonl or htons ala sockets handling. Pretty much the same idea. If you do that and always explicitly convert the binary value into a size_t in code the same way, then size_t can be used everywhere you've already parsed the data out, but then in turn whatever would write a size_t to a binary file anywhere convert it back. This would have the benefit of the code itself being clear this value is explicitly a sizeof ()/array index type, but binary handling would be clear this is stored as a 32-bit or 64-bit little-endian byte array, regardless of how the current host machine is passing it around in RAM.

Sorry if you already know this, not assuming you don't just it's something on my mind a lot, I work with a lot of console (Famicom/Mega Drive particularly) code these days so "everything binary is a byte array in target byte order" is something I have to think about on the regular. Comes into play a little less with general purpose computers but is still very important for binary data.

@gilmorem560
Copy link
Contributor

Oops also, these changes you've got diffs up of, are these checked into a branch/fork anywhere, or just posted here? I've got a macOS box, happy to pull it down and give it a try.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 10, 2024

Oops also, these changes you've got diffs up of, are these checked into a branch/fork anywhere, or just posted here? I've got a macOS box, happy to pull it down and give it a try.

There's #419 but it doesn't include the cmake update I posted above. You could also add #418 and #407 on top. 418 gets rid of GLEW and 407 fixes a copy-pasto which causes a crash on shutdown.

@mlauss2
Copy link
Contributor

mlauss2 commented Jul 10, 2024

Oh and also #282 for big-endian machines. I like it, but I can't test it since I have no BE userland for my MIPS toys.

@jodaco
Copy link

jodaco commented Jul 10, 2024

I don't have my diff checked in anywhere, I do make it all the way to the linking stage and my last issue was figuring out why cmake wasn't finding sdl2_image. It is unclear to me if there is an issue with the cmake file supplied by brew for sdl2_image

When cmake runs it seems to find sdl2_image, but at the linking stage it does not include the library path, while it seems to for sdl2 itself. CMakeCache seems to show the library path folder in there, I was trying various tweaks to see if I could get cmake to cooperate, but no joy. I ran out of time due to school at the present time, but it would be nice to at least get it building and see what isn't working at that point. Since the project is depending on external libraries instead of system specific libraries, I don't see why it shouldn't mostly work.

@gilmorem560
Copy link
Contributor

gilmorem560 commented Jul 10, 2024

Doesn't include the library path as in it is missing a -L or a -l? I would imagine sdl2_image gets installed in the same prefix as other SDL2 stuff so if you find one, you should find all, but if it's missing specifically the -l include, I wonder if that could point to an issue with say pkg-config. Most UNIX-y build systems nowadays expect pkg-config to just tell it "add a -lSDL2_image" to the linker, and if the pkg-config file that gets scooped up for whatever reason thinks this is packed into the main SDL2 library, it may only provide -lSDL2, not -lSDL2_image.

This is just conjecture though, I haven't looked at it yet, but I have seen in the past where a host winds up with multiple, copies of a library pc file, for instance one in /usr/lib/pkgconfig and one in /usr/share/pkgconfig on systems where these don't point to the same directory.

Just a thought, that's the first thing I'd start investigating, because it's very unlikely that libSDL2.dylib and libSDL2_image.dylib are in different library paths.

@jodaco
Copy link

jodaco commented Jul 10, 2024

The libraries live in /opt/homebrew/Cellar/library_name and cmake is finding the library path here, but there are symlinks to all the libs in /opt/homebrew/lib. CMake does not seem to be inserting the full library path to SDL2_image in the linker options and I've been trying to workout why.

link.txt

It does seem to list the correct path in here, but my current cmake skills and time are limited to dig into it for a few days at least
CMakeCache.txt

pkg-config returns the correct paths, so I believe something interesting is going on with cmake and/or homebrew.

#pkg-config --libs sdl2_image
returns
-L/opt/homebrew/Cellar/sdl2_image/2.8.2_1/lib -L/opt/homebrew/lib -lSDL2_image -lSDL2
and neither one of the paths returned by pkg-config lands inside link.txt generated by cmake

@gilmorem560
Copy link
Contributor

Between those two files the main thing I see missing from the command line is:

-L/opt/homebrew/lib

You might try running the contents of link.txt directly with this added into the command line where the other -L options are. That'll at least isolate the problem to this missing from the linker command line. Since it's in pkg-config too, something else might be gobbling it up.

What I do find interesting is you're getting two general paths to where the libs are:

/opt/homebrew/lib
/opt/homebrew/Cellar/{libName}/{version}/lib

Could that imply that there are conflicting pkg-config or possibly even CMake SDL detection scripts between those two prefixes?

A curious bit is that the linking looks like so:

-L/opt/homebrew/Cellar/sdl2/2.30.5/lib  -Wl,-rpath,/opt/homebrew/Cellar/sdl2/2.30.5/lib /opt/homebrew/Cellar/sdl2/2.30.5/lib/libSDL2.dylib -lSDL2_image -lSDL2 -lrtmidi

So it establishes the cellar path as a library directory...then explicitly points at libSDL2.dylib in that directory...but then follows it also with a -lSDL2, so that is doubled up. There isn't a complementary -L option for either /opt/homebrew/lib or the Cellar directory for SDL2_image, so that's why -lSDL2_image isn't turning anything up.

I wish I knew more about CMake to help you along but I've never used it from a packaging perspective. In any case, where I'd look next is if there's any difference between pkg-config and CMake files between:

/opt/homebrew

and

/opt/homebrew/Cellar/{etc}

Therein may lie the solution. Admittedly I don't use homebrew, so I'm also unfamiliar with their best practices regarding ensuring stuff is consistently locatable. Good luck, our environments are sufficiently different that I don't think I can offer further help.

@jodaco
Copy link

jodaco commented Jul 10, 2024

They are just symlinks to each other, homebrew seems to ship files that cmake uses to pickup library locations, I found a bug report from a couple years ago that suggested some trouble with sdl2_image and homebrew that was previously resolved, perhaps there is some other issue with it now, I know I could manually add the linker path to the files, just trying to get things working the "right" way.

@gilmorem560
Copy link
Contributor

Oh yeah, I only suggested adding the path to confirm that's the only thing wrong, that way you're not chasing some unrelated gremlin.

One other suggestion I have is the ultimate solution here may depend on whether you're intending to pack in SDL2 statically or expect the host machine to supply it.

If you're going with static linkage, then I would just forego the homebrew and try and install SDL2 some other way, because if the homebrew-ization of it is what is causing trouble, doing something else will hopefully unstick you as a developer.

On the other hand, if this is expected to be used with dynamic linkage, then it'd be worth some research to see how SDL2 is most commonly installed on macOS. Aside from homebrew, I see the SDL folks provide their own dmg: https://github.com/libsdl-org/SDL/releases/tag/release-2.30.5

If that installs differently than homebrew and is the more common SDL2 source for macOS users out there, that may be the way to go. A happy medium may be providing the dynamic libraries with an installation package for this and putting them in some sort of custom directory as not to interfere with any existing dylib on the target machine.

Finally, back on the "pack it in" angle, SDL2 is in GitHub, like this project, so there is the prospect of pulling it in as a formal submodule dependency, that way both the project has a link to upstream and you're able to easily pack it in statically as part of the build rather than futzing with all the "find this library on the host" stuff.

Many ways to crack this nut, best of luck on whichever you decide!

@jodaco
Copy link

jodaco commented Jul 10, 2024

Assuming TFE were officially supporting MacOS, it might make some sense to use the sdl components inside the tree, I see it's already there for Windows. There is a strong chance that the majority of MacOS users might not have sdl lying around like in the same way Linux users would.

@gilmorem560
Copy link
Contributor

Yeah if that's what's happening for Windows, probably fine for macOS too. Way back when I did some Linux work on this stuff, I linked almost everything dynamically in the dinky little Makefile I made for my own purposes, so frankly I don't know how SDL2 is linked on Linux in this package's conventional build. I would do the same everywhere in that case though, since this project keeping Windows/macOS on a fixed version. Then you're not chasing gremlins related to an SDL version difference on different platforms.

@mikesk8
Copy link

mikesk8 commented Oct 23, 2024

Hello All ;-) I just wanted to check if there is any hope to get the Mac version in the near future? I cannot help coding, but I can help testing ;) Please let me know.

@gilmorem560
Copy link
Contributor

Gave it a shot today, after installing glib-2.0, pkg-config, SDL2, and SDL2_image, CMake is failing to find the latter:

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.29/Modules/FindPkgConfig.cmake:634 (message):
  The following required packages were not found:

   - SDL2_image

Call Stack (most recent call first):
  /Applications/CMake.app/Contents/share/cmake-3.29/Modules/FindPkgConfig.cmake:862 (_pkg_check_modules_internal)
  CMakeLists.txt:65 (pkg_check_modules)

Annoyingly it does find SDL itself. The two are located via

find_package(SDL2 2.0.20 REQUIRED)
pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)

I don't use CMake at all so I don't know where to start on this one. Note this is using the dmg copies of SDL2 and SDL2_image as distributed by the SDL folks themselves, no idea how this behaves via homebrew.

@gilmorem560
Copy link
Contributor

So replaced the second line with (I chose 2.6.0 based on release dates, not a dependency analysis):

find_package(SDL2_image 2.6.0 REQUIRED)

and CMake can actually complete and generate a Makefile. However, it then isn't able to find the SDL2_image stuff...a verbose listing of the build reveals

/Library/Developer/CommandLineTools/usr/bin/c++  -I/Users/gilmorem/Desktop/TheForceEngine/build -I/Users/gilmorem/Desktop/TheForceEngine/TheForceEngine -isystem /Library/Frameworks/SDL2.framework/Headers -iframework /Library/Frameworks -ftrivial-auto-var-init=zero -O3 -DNDEBUG -std=c++14 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -MD -MT CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/imageAsset.cpp.o -MF CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/imageAsset.cpp.o.d -o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/imageAsset.cpp.o -c /Users/gilmorem/Desktop/TheForceEngine/TheForceEngine/TFE_Asset/imageAsset.cpp

Indeed /Library/Frameworks/SDL2.framework/Headers is pulled in by the found SDL2...but the corresponding directory for SDL2_image does not come in. This may point to further reason to probably just use a packed in SDL2, the situation on macOS trying to incorporate SDL2_image seems dire...anywho if I do discover anything else I'll report back.

@gilmorem560
Copy link
Contributor

Got it, SDL2_image's CMake config file (on macOS at least) doesn't define SDL2_IMAGE_* prefixed include and link paths, rather, it exports a library interface of SDL2_image::SDL2_image. This turns this chunk from

		find_package(SDL2 2.0.20 REQUIRED)
		pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
		target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
		target_include_directories(tfe PRIVATE ${SDL2_INCLUDE_DIRS})
		target_include_directories(tfe PRIVATE ${SDL2_IMAGE_INCLUDE_DIRS})
		target_link_libraries(tfe PRIVATE SDL2::SDL2main SDL2::SDL2
					${SDL2_IMAGE_LIBRARIES}
		)

to

                find_package(SDL2 2.0.20 REQUIRED)
                find_package(SDL2_image 2.6.0 REQUIRED)
                target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
                target_include_directories(tfe PRIVATE ${SDL2_INCLUDE_DIRS} SDL2_image::SDL2_image)
                target_link_libraries(tfe PRIVATE SDL2::SDL2main SDL2::SDL2
                                        SDL2_image::SDL2_image
                )

With this, I'm able to get a 100% compile. However, the linking step then fails. Still, progress. Not sure then if the above still works on other UNIX-like targets, but it does fix the compile steps on macOS.

@gilmorem560
Copy link
Contributor

For anyone who would like to drink from the fire-hose, this is the linker command-line and the resulting error:

/Library/Developer/CommandLineTools/usr/bin/c++  -ftrivial-auto-var-init=zero -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -F /Library/Frameworks/ -framework SDL2_image CMakeFiles/tfe.dir/TheForceEngine/TFE_A11y/accessibility.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_A11y/filePathList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/archive.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/gobArchive.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/gobMemoryArchive.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/labArchive.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/lfdArchive.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/zipArchive.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/zstdCompression.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Archive/zip/zip.c.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/assetSystem.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/colormapAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/dfKeywords.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/fontAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/gameMessages.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/gifWriter.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/gmidAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/imageAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/levelList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/modelAsset_jedi.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/paletteAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/spriteAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/spriteAsset_Jedi.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/textureAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/vocAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Asset/vueAsset.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/MidiSynth/fm4Opl3Device.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/MidiSynth/opl3.c.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/MidiSynth/soundFontDevice.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/RtMidi.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/audioDevice.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/audioFilters.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/audioSystem.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Audio/midiPlayer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/actor.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/actorSerialization.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/animTables.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/bobaFett.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/dragon.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/enemies.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/exploders.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/flyers.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/mousebot.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/phaseOne.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/phaseThree.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/phaseTwo.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/scenery.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/sewer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/troopers.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/turret.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Actor/welder.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/agentMenu.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/delt.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/editBox.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/menu.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/missionBriefing.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/pda.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/GameUI/uiDraw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/cutscene.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/cutsceneList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/cutscene_film.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/cutscene_player.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lactor.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lactorAnim.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lactorCust.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lactorDelt.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lcanvas.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/ldraw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lfade.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lfont.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lmusic.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lpalette.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lrect.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lsound.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lsystem.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/ltimer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/lview.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/Landru/textCrawl.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/agent.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/animLogic.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/automap.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/briefingList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/cheats.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/config.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/darkForcesMain.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/gameMessage.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/gameMusic.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/generator.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/hitEffect.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/hud.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/item.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/logic.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/mission.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/pickup.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/player.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/playerCollision.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/projectile.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/random.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/sound.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/time.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/updateLogic.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/util.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/vueLogic.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/weapon.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_DarkForces/weaponFireFunc.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FileSystem/filewriterAsync.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FileSystem/memorystream.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FrontEndUI/console.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FrontEndUI/modLoader.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FrontEndUI/profilerView.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_FrontEndUI/uiTexture.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Game/igame.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Game/reticle.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Game/saveSystem.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Input/input.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Input/inputMapping.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Collision/collision.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imConst.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imDigitalSound.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imMidiCmd.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imMidiPlayer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imSoundFader.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imTrigger.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/imuse.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/IMuse/midiData.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/InfSystem/infState.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/InfSystem/infSystem.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/InfSystem/message.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/level.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/levelBin.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/levelData.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/levelTextures.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/rfont.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/robjData.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/robject.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/roffscreenBuffer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/rsector.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/rtexture.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Level/rwall.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Math/core_math.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Math/cosTable.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Memory/allocator.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Memory/list.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/rclassicFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/rclassicFixedSharedState.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/redgePairFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/rflatFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/rlightingFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed/robj3dFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed/robj3dFixed_Clipping.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed/robj3dFixed_Culling.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed/robj3dFixed_PolygonDraw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed/robj3dFixed_PolygonSetup.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed/robj3dFixed_TransformAndLighting.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/rsectorFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Fixed/rwallFixed.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/rclassicFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/rclassicFloatSharedState.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/redgePairFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/rflatFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/rlightingFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/robj3d_float/robj3dFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/robj3d_float/robj3dFloat_Clipping.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/robj3d_float/robj3dFloat_Culling.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/robj3d_float/robj3dFloat_PolygonDraw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/robj3d_float/robj3dFloat_PolygonSetup.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/robj3d_float/robj3dFloat_TransformAndLighting.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/rsectorFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_Float/rwallFloat.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/debug.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/frustum.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/modelGPU.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/objectPortalPlanes.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/rclassicGPU.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/renderDebug.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/rsectorGPU.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/sbuffer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/screenDrawGPU.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/sectorDisplayList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/spriteDisplayList.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/jediRenderer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/rcommon.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/rscanline.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/rsectorRender.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/screenDraw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Renderer/virtualFramebuffer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Serialization/serialization.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Jedi/Task/task.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Memory/chunkedArray.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Memory/memoryRegion.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Outlaws/outlawsMain.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Polygon/clipper.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Polygon/polygon.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_PostProcess/blit.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_PostProcess/bloomDownsample.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_PostProcess/bloomMerge.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_PostProcess/bloomThreshold.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_PostProcess/overlay.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_PostProcess/postprocess.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/lineDraw2d.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/lineDraw3d.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/lineDrawMode.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/modelDraw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/quadDraw2d.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/texturePacker.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/triDraw2d.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderShared/triDraw3d.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/dynamicTexture.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/glad.c.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/glslParser.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/indexBuffer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/openGL_Caps.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderState.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderTarget.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/screenCapture.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/shader.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/shaderBuffer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/textureGpu.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_RenderBackend/Win32OpenGL/vertexBuffer.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Settings/settings.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/cJSON.c.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/frameLimiter.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/iniParser.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/log.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/math.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/memoryPool.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/parser.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/profiler.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/system.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/tfeMessage.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_System/utf8.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/markdown.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/ui.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui_draw.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui_impl_opengl3.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui_impl_sdl2.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui_tables.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui_tfe_widgets.cpp.o CMakeFiles/tfe.dir/TheForceEngine/TFE_Ui/imGUI/imgui_widgets.cpp.o CMakeFiles/tfe.dir/TheForceEngine/main.cpp.o -o theforceengine -F/Library/Frameworks  -Wl,-rpath,/Library/Frameworks /Library/Frameworks/SDL2.framework/Versions/A/SDL2
Undefined symbols for architecture x86_64:
  "FileStream::readBuffer(void*, unsigned int, unsigned int)", referenced from:
      TFE_A11Y::loadCaptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) in accessibility.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::open(char const*) in gobArchive.cpp.o
      GobArchive::open(char const*) in gobArchive.cpp.o
      GobArchive::open(char const*) in gobArchive.cpp.o
      GobArchive::readFile(void*, unsigned long) in gobArchive.cpp.o
      ...
  "FileStream::writeBuffer(void const*, unsigned int, unsigned int)", referenced from:
      GobArchive::create(char const*) in gobArchive.cpp.o
      GobArchive::create(char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      LfdArchive::create(char const*) in lfdArchive.cpp.o
      ...
  "FileStream::readContents(FilePath const*, void*, unsigned long)", referenced from:
      TFE_DarkForces::gameStartup() in darkForcesMain.cpp.o
      TFE_Jedi::level_loadPalette() in level.cpp.o
  "FileStream::open(FilePath const*, Stream::AccessMode)", referenced from:
      TFE_GmidAsset::get(char const*) in gmidAsset.cpp.o
      TFE_Model_Jedi::get(char const*, AssetPool) in modelAsset_jedi.cpp.o
      TFE_Sprite_Jedi::loadFrameHd(char const*, WaxFrame const*, AssetPool, HdWax*, WaxCell const*) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::getFrame(char const*, AssetPool) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::getWax(char const*, AssetPool) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::loadWaxHd(char const*, Wax const*, AssetPool, HdWax*) in spriteAsset_Jedi.cpp.o
      TFE_VocAsset::loadSoundFile(char const*) in vocAsset.cpp.o
      ...
  "FileStream::open(char const*, Stream::AccessMode)", referenced from:
      TFE_A11Y::loadCaptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) in accessibility.cpp.o
      GobArchive::create(char const*) in gobArchive.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::open(char const*) in gobArchive.cpp.o
      GobArchive::openFile(char const*) in gobArchive.cpp.o
      GobArchive::openFile(unsigned int) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      ...
  "FileStream::seek(int, Stream::Origin)", referenced from:
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::open(char const*) in gobArchive.cpp.o
      GobArchive::openFile(char const*) in gobArchive.cpp.o
      GobArchive::openFile(unsigned int) in gobArchive.cpp.o
      GobArchive::seekFile(int, int) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      LabArchive::openFile(char const*) in labArchive.cpp.o
      ...
  "FileStream::close()", referenced from:
      TFE_A11Y::loadCaptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) in accessibility.cpp.o
      GobArchive::~GobArchive() in gobArchive.cpp.o
      GobArchive::~GobArchive() in gobArchive.cpp.o
      GobArchive::~GobArchive() in gobArchive.cpp.o
      GobArchive::create(char const*) in gobArchive.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      ...
  "FileStream::flush()", referenced from:
      TFE_System::logWrite(LogWriteType, char const*, char const*, ...) in log.cpp.o
  "FileStream::getSize()", referenced from:
      TFE_A11Y::loadCaptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) in accessibility.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      TFE_GmidAsset::get(char const*) in gmidAsset.cpp.o
      TFE_Model_Jedi::get(char const*, AssetPool) in modelAsset_jedi.cpp.o
      TFE_Sprite_Jedi::loadFrameHd(char const*, WaxFrame const*, AssetPool, HdWax*, WaxCell const*) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::getFrame(char const*, AssetPool) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::getWax(char const*, AssetPool) in spriteAsset_Jedi.cpp.o
      ...
  "FileStream::FileStream()", referenced from:
      __GLOBAL__sub_I_accessibility.cpp in accessibility.cpp.o
      Archive::getArchive(ArchiveType, char const*, char const*) in archive.cpp.o
      Archive::getArchive(ArchiveType, char const*, char const*) in archive.cpp.o
      Archive::getArchive(ArchiveType, char const*, char const*) in archive.cpp.o
      Archive::createCustomArchive(ArchiveType, char const*) in archive.cpp.o
      Archive::createCustomArchive(ArchiveType, char const*) in archive.cpp.o
      Archive::createCustomArchive(ArchiveType, char const*) in archive.cpp.o
      ...
  "FileStream::~FileStream()", referenced from:
      __GLOBAL__sub_I_accessibility.cpp in accessibility.cpp.o
      GobArchive::~GobArchive() in gobArchive.cpp.o
      GobArchive::~GobArchive() in gobArchive.cpp.o
      GobArchive::~GobArchive() in gobArchive.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::validate(char const*, int) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      GobArchive::addFile(char const*, char const*) in gobArchive.cpp.o
      ...
  "TFE_CrashHandler::setThreadExceptionHandlers()", referenced from:
      _main in main.cpp.o
  "TFE_CrashHandler::setProcessExceptionHandlers()", referenced from:
      _main in main.cpp.o
  "FileUtil::deleteFile(char const*)", referenced from:
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
  "FileUtil::getFilePath(char const*, char*)", referenced from:
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
  "FileUtil::makeDirectory(char const*)", referenced from:
      TFE_A11Y::findCaptionFiles() in accessibility.cpp.o
      TFE_A11Y::findFontFiles() in accessibility.cpp.o
      TFE_DarkForces::console_exportTexture(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) in playerCollision.cpp.o
      TFE_SaveSystem::setCurrentGame(GameID) in saveSystem.cpp.o
      TFE_SaveSystem::setCurrentGame(GameID) in saveSystem.cpp.o
      _main in main.cpp.o
      _main in main.cpp.o
      ...
  "FileUtil::readDirectory(char const*, char const*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&)", referenced from:
      TFE_A11Y::FilePathList::addFiles(char const*, char const*, std::__1::function<bool (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>)>) in filePathList.cpp.o
      TFE_Audio::SoundFontDevice::getOutputCount() in soundFontDevice.cpp.o
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
      TFE_FrontEndUI::readFromQueue(unsigned long) in modLoader.cpp.o
      TFE_FrontEndUI::readFromQueue(unsigned long) in modLoader.cpp.o
      TFE_FrontEndUI::readFromQueue(unsigned long) in modLoader.cpp.o
      ...
  "FileUtil::directoryExits(char const*, char*)", referenced from:
      TFE_A11Y::findCaptionFiles() in accessibility.cpp.o
      TFE_A11Y::findFontFiles() in accessibility.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
      TFE_SaveSystem::setCurrentGame(GameID) in saveSystem.cpp.o
      TFE_SaveSystem::setCurrentGame(GameID) in saveSystem.cpp.o
      ...
  "FileUtil::convertToOSPath(char const*, char*)", referenced from:
      TFE_Ui::openFileDialog(char const*, char const*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, bool) in ui.cpp.o
      TFE_Ui::directorySelectDialog(char const*, char const*, bool) in ui.cpp.o
      TFE_Ui::saveFileDialog(char const*, char const*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>, bool) in ui.cpp.o
  "FileUtil::replaceExtension(char const*, char const*, char*)", referenced from:
      TFE_Sprite_Jedi::loadFrameHd(char const*, WaxFrame const*, AssetPool, HdWax*, WaxCell const*) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::loadWaxHd(char const*, Wax const*, AssetPool, HdWax*) in spriteAsset_Jedi.cpp.o
      TFE_Jedi::bitmap_loadHD(char const*, TextureData*, int, AssetPool) in rtexture.cpp.o
  "FileUtil::readSubdirectories(char const*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&)", referenced from:
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
  "FileUtil::getFileNameFromPath(char const*, char*, bool)", referenced from:
      TFE_A11Y::loadFont(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool) in accessibility.cpp.o
      TFE_Audio::SoundFontDevice::getOutputCount() in soundFontDevice.cpp.o
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_DarkForces::console_exportTexture(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) in playerCollision.cpp.o
      TFE_SaveSystem::loadHeader(Stream*, TFE_SaveSystem::SaveHeader*, char const*) in saveSystem.cpp.o
  "FileUtil::exists(char const*)", referenced from:
      TFE_A11Y::tryLoadFont(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool) in accessibility.cpp.o
      TFE_A11Y::tryLoadFont(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool) in accessibility.cpp.o
      Archive::getArchive(ArchiveType, char const*, char const*) in archive.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      ...
  "FileUtil::copyFile(char const*, char const*)", referenced from:
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
  "FileUtil::fixupPath(char*)", referenced from:
      TFE_FrontEndUI::loadGpuImage(char const*, TFE_FrontEndUI::UiImage*) in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_Settings::autodetectGamePaths() in settings.cpp.o
      TFE_Settings::autodetectGamePaths() in settings.cpp.o
  "TFE_Paths::appendPath(TFE_PathType, char const*, char*, unsigned long)", referenced from:
      TFE_AssetSystem::openArchiveFile(char const*, ArchiveType, char const*) in assetSystem.cpp.o
      TFE_AssetSystem::readAssetFromArchive(char const*, ArchiveType, char const*, std::__1::vector<unsigned char, std::__1::allocator<unsigned char>>&) in assetSystem.cpp.o
      TFE_AssetSystem::readAssetFromArchive(char const*, ArchiveType, char const*, std::__1::vector<char, std::__1::allocator<char>>&) in assetSystem.cpp.o
      TFE_AssetSystem::readAssetFromArchive(char const*, char const*, std::__1::vector<unsigned char, std::__1::allocator<unsigned char>>&) in assetSystem.cpp.o
      TFE_AssetSystem::readAssetFromArchive(char const*, char const*, std::__1::vector<char, std::__1::allocator<char>>&) in assetSystem.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      TFE_DarkForces::openDarkPilotConfig(FileStream*) in agent.cpp.o
      ...
  "TFE_Paths::getFilePath(char const*, FilePath*)", referenced from:
      TFE_GmidAsset::get(char const*) in gmidAsset.cpp.o
      TFE_Model_Jedi::get(char const*, AssetPool) in modelAsset_jedi.cpp.o
      TFE_Sprite_Jedi::loadFrameHd(char const*, WaxFrame const*, AssetPool, HdWax*, WaxCell const*) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::getFrame(char const*, AssetPool) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::getWax(char const*, AssetPool) in spriteAsset_Jedi.cpp.o
      TFE_Sprite_Jedi::loadWaxHd(char const*, Wax const*, AssetPool, HdWax*) in spriteAsset_Jedi.cpp.o
      TFE_VocAsset::loadSoundFile(char const*) in vocAsset.cpp.o
      ...
  "TFE_Paths::mapSystemPath(char*)", referenced from:
      TFE_A11Y::findCaptionFiles() in accessibility.cpp.o
      TFE_A11Y::findFontFiles() in accessibility.cpp.o
      TFE_A11Y::tryLoadFont(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool) in accessibility.cpp.o
      TFE_A11Y::tryLoadFont(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool) in accessibility.cpp.o
      TFE_A11Y::loadDefaultFont(bool) in accessibility.cpp.o
      TFE_Audio::SoundFontDevice::getOutputCount() in soundFontDevice.cpp.o
      TFE_Audio::SoundFontDevice::beginStream(char const*, int) in soundFontDevice.cpp.o
      ...
  "TFE_Paths::setProgramPath()", referenced from:
      _main in main.cpp.o
  "TFE_Paths::addLocalArchive(Archive*)", referenced from:
      TFE_DarkForces::agentMenu_load(TFE_DarkForces::LangHotkeys*) in agentMenu.cpp.o
      TFE_DarkForces::escapeMenu_load(TFE_DarkForces::LangHotkeys*) in escapeMenu.cpp.o
      TFE_DarkForces::menu_openResourceArchive(char const*) in menu.cpp.o
      TFE_DarkForces::lsystem_init() in lsystem.cpp.o
      TFE_DarkForces::lsystem_init() in lsystem.cpp.o
      TFE_DarkForces::openGobFiles() in darkForcesMain.cpp.o
      TFE_DarkForces::openGobFiles() in darkForcesMain.cpp.o
      TFE_DarkForces::openGobFiles() in darkForcesMain.cpp.o
      TFE_DarkForces::openGobFiles() in darkForcesMain.cpp.o
      TFE_DarkForces::openGobFiles() in darkForcesMain.cpp.o
      ...
  "TFE_Paths::clearSearchPaths()", referenced from:
      TFE_DarkForces::DarkForces::exitGame() in darkForcesMain.cpp.o
  "TFE_Paths::addSingleFilePath(char const*, char const*)", referenced from:
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
      TFE_DarkForces::loadCustomGob(char const*) in darkForcesMain.cpp.o
  "TFE_Paths::removeLastArchive()", referenced from:
      TFE_DarkForces::agentMenu_load(TFE_DarkForces::LangHotkeys*) in agentMenu.cpp.o
      TFE_DarkForces::escapeMenu_load(TFE_DarkForces::LangHotkeys*) in escapeMenu.cpp.o
      TFE_DarkForces::menu_closeResourceArchive() in menu.cpp.o
      TFE_DarkForces::lsystem_init() in lsystem.cpp.o
  "TFE_Paths::addLocalSearchPath(char const*)", referenced from:
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
  "TFE_Paths::clearLocalArchives()", referenced from:
      TFE_DarkForces::DarkForces::exitGame() in darkForcesMain.cpp.o
  "TFE_Paths::removeFirstArchive()", referenced from:
      TFE_DarkForces::cutscenePlayer_start(int) in cutscene_player.cpp.o
      TFE_DarkForces::cutscenePlayer_start(int) in cutscene_player.cpp.o
  "TFE_Paths::setProgramDataPath(char const*)", referenced from:
      _main in main.cpp.o
  "TFE_Paths::fixupPathAsDirectory(char*)", referenced from:
      TFE_DarkForces::processCommandLineArgs(int, char const**, char*) in darkForcesMain.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
      TFE_FrontEndUI::modLoader_read() in modLoader.cpp.o
  "TFE_Paths::setUserDocumentsPath(char const*)", referenced from:
      _main in main.cpp.o
  "TFE_Paths::addAbsoluteSearchPath(char const*)", referenced from:
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      TFE_DarkForces::processCommandLineArgs(int, char const**, char*) in darkForcesMain.cpp.o
  "TFE_Paths::addLocalArchiveToFront(Archive*)", referenced from:
      TFE_DarkForces::cutscenePlayer_start(int) in cutscene_player.cpp.o
  "TFE_Paths::getPath(TFE_PathType)", referenced from:
      TFE_A11Y::findCaptionFiles() in accessibility.cpp.o
      TFE_A11Y::findCaptionFiles() in accessibility.cpp.o
      TFE_A11Y::findFontFiles() in accessibility.cpp.o
      TFE_Audio::SoundFontDevice::getOutputCount() in soundFontDevice.cpp.o
      TFE_Audio::SoundFontDevice::beginStream(char const*, int) in soundFontDevice.cpp.o
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      TFE_DarkForces::buildSearchPaths() in darkForcesMain.cpp.o
      ...
  "TFE_Paths::hasPath(TFE_PathType)", referenced from:
      validatePath() in main.cpp.o
      validatePath() in main.cpp.o
  "TFE_Paths::setPath(TFE_PathType, char const*)", referenced from:
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      TFE_FrontEndUI::configGame() in frontEndUi.cpp.o
      validatePath() in main.cpp.o
      _main in main.cpp.o
      _main in main.cpp.o
      ...
  "FileStream::isOpen() const", referenced from:
      TFE_Memory::region_serializeToDisk(MemoryRegion*, FileStream*) in memoryRegion.cpp.o
      TFE_Memory::region_restoreFromDisk(MemoryRegion*, FileStream*) in memoryRegion.cpp.o
      TFE_System::logWrite(LogWriteType, char const*, char const*, ...) in log.cpp.o
ld: symbol(s) not found for architecture x86_64

Presumably either the linking step is missing object definitions for the files containing those bits or they aren't being built in the first place. Not in a place I can sink more of my own research into this but hopefully this gets concerned parties further along.

In short:

  • The CMake configuration for pulling in SDL2_image needs to be modified to work with the SDL-distributed dmg-packaged framework (whether this works for homebrew too I don't know)
  • The target list needs to be inspected to determine if FileStream and other related local dependencies are being pulled into the build correctly.

@mlauss2
Copy link
Contributor

mlauss2 commented Oct 24, 2024

in TheForceEngine/TFE_FileSystem/CMakeFiles.txt
change line 7 to "elseif(UNIX)"

index 5c524aa8..a4ba6151 100644
--- a/TheForceEngine/TFE_FileSystem/CMakeLists.txt
+++ b/TheForceEngine/TFE_FileSystem/CMakeLists.txt
@@ -4,7 +4,7 @@ if(WIN32)
                "${CMAKE_CURRENT_SOURCE_DIR}/fileutil.cpp"
                "${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp"
         )
-elseif(LINUX)
+elseif(UNIX)
        target_sources(tfe PRIVATE
                "${CMAKE_CURRENT_SOURCE_DIR}/filestream-posix.cpp"
                "${CMAKE_CURRENT_SOURCE_DIR}/fileutil-posix.cpp"
'''

@mlauss2
Copy link
Contributor

mlauss2 commented Oct 24, 2024

Got it, SDL2_image's CMake config file (on macOS at least) doesn't define SDL2_IMAGE_* prefixed include and link paths, rather, it exports a library interface of SDL2_image::SDL2_image. This turns this chunk from

		find_package(SDL2 2.0.20 REQUIRED)
		pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
		target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
		target_include_directories(tfe PRIVATE ${SDL2_INCLUDE_DIRS})
		target_include_directories(tfe PRIVATE ${SDL2_IMAGE_INCLUDE_DIRS})
		target_link_libraries(tfe PRIVATE SDL2::SDL2main SDL2::SDL2
					${SDL2_IMAGE_LIBRARIES}
		)

to

                find_package(SDL2 2.0.20 REQUIRED)
                find_package(SDL2_image 2.6.0 REQUIRED)
                target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
                target_include_directories(tfe PRIVATE ${SDL2_INCLUDE_DIRS} SDL2_image::SDL2_image)
                target_link_libraries(tfe PRIVATE SDL2::SDL2main SDL2::SDL2
                                        SDL2_image::SDL2_image
                )

Works for me(tm) on Linux, though I'm not sure whether it works with the github job (due to its old ubuntu version).

@gilmorem560
Copy link
Contributor

in TheForceEngine/TFE_FileSystem/CMakeFiles.txt change line 7 to "elseif(UNIX)"

index 5c524aa8..a4ba6151 100644
--- a/TheForceEngine/TFE_FileSystem/CMakeLists.txt
+++ b/TheForceEngine/TFE_FileSystem/CMakeLists.txt
@@ -4,7 +4,7 @@ if(WIN32)
                "${CMAKE_CURRENT_SOURCE_DIR}/fileutil.cpp"
                "${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp"
         )
-elseif(LINUX)
+elseif(UNIX)
        target_sources(tfe PRIVATE
                "${CMAKE_CURRENT_SOURCE_DIR}/filestream-posix.cpp"
                "${CMAKE_CURRENT_SOURCE_DIR}/fileutil-posix.cpp"
'''

This did the trick for part of it, which then lead to an issue finding "st_mtim" on struct stat. Digging in a little bit, this is defined in POSIX...so much for Apple's whole certification process, looks like Darwin's libc exposes this field instead as "st_mtimespec" leading to this needing to replace the single line at line 363 in TFE_FileSystem/fileutil-posix.cpp:

                #ifdef __APPLE__ 
                        tslw = st.st_mtimespec;
                #else
                        tslw = st.st_mtim;
                #endif

But macOS gets to call itself UNIX while Linux does not...hooray for standards!

Anywho, in addition to this, TFE_System/CrashHandler/CMakeLists.txt needs the same change from the LINUX to UNIX constant.

With this all in place, it finally builds and links, although I did have to manually fudge the build to spit out the executable as "tfe" rather than "theforceengine". I was getting:

ld: open() failed, errno=21 for 'theforceengine'

Despite Darwin being a "UNIX" system (haw) and that implying it should have case-sensitive filenames, this seems to happen if the linker tries to create any file with a case-insensitive name that matches an existing path in the build directory. One such path is "TheForceEngine". If I copy out the link line and type this as tfe, it works.

So in conclusion the remaining volley of build errors I found need fixing are:

  • Apple's so-called UNIX-like operating system exposes file modification times on the stat structure as st_mtimespec not st_mtim, naughty naughty.
  • The "LINUX" check in the TFE_System/CrashHandler/CMakeLists.txt must be swapped to check for "UNIX" instead.
  • The output binary inexplicably can't have a case-insensitive match with any of the directories generated during the build.

Now, trying to run it, this happens, which I'm not going to look at today

2024-Oct-25 10:32:50 - [Main] The Force Engine v1.10.000-157-g620d3b6a+ 
2024-Oct-25 10:32:50 - [Paths] Program Path: "${HOME}/Desktop/TheForceEngine/build/"
2024-Oct-25 10:32:50 - [Paths] Program Data: "${HOME}/.local/share/TheForceEngine/"
2024-Oct-25 10:32:50 - [Paths] User Documents: "${HOME}/.local/share/TheForceEngine/"
2024-Oct-25 10:32:50 - [Paths] Source Data: ""
2024-Oct-25 10:32:50 - [Startup] TFE_System::init
2024-Oct-25 10:32:50 - [Display] Fullscreen enabled.
2024-Oct-25 10:32:50 - [Display] Vertical Sync enabled.
2024-Oct-25 10:32:50 - [RenderBackend] SDL Videodriver: cocoa
2024-Oct-25 10:32:50 - [RenderBackend] GL Info: 2.1 INTEL-22.5.11, Intel(R) Iris(TM) Plus Graphics OpenGL Engine
2024-Oct-25 10:32:50 - [RenderBackend] OpenGL Device Tier: 1
2024-Oct-25 10:32:50 - [Error : RenderBackend] Insufficient GL capabilities!
2024-Oct-25 10:32:50 - [Critical : GPU] Cannot initialize GPU/Window.

Granted I didn't put any assets in place, this was just trying to launch at all. Something with the OpenGL capability polling down in the renderer. I was able to get the OpenGL surface to pop up on macOS once upon a time...so it should just be some bug squashing in the renderer. If I do pick this thread up again sometime I might dig around in that further. Good luck!

@thermophylae33
Copy link

thermophylae33 commented Oct 26, 2024

Thanks for these hints, I was also able to successfully compile an Intel 32bit build of the latest version of the source on my MacBook running Snow Leopard, however the binary also refuses to initialize the GPU due to insufficient GL capabilities (GeForce 9600M GT).
I'm a bit stumped cause if the OGL drivers aren't supported, shouldn't it have been impossible to compile the code in the first place?

@mlauss2
Copy link
Contributor

mlauss2 commented Oct 26, 2024

@gilmorem560 does this patch help?

index 960dc91e..82868a36 100644
--- a/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp
+++ b/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp
@@ -120,6 +120,13 @@ namespace TFE_RenderBackend
                        return nullptr;
                }
 
+#ifdef __APPLE__
+               SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
+               SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+               SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
+               SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+               SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
+#endif
                SDL_GLContext context = SDL_GL_CreateContext(window);
                if (!context)

@thermophylae33
Copy link

thermophylae33 commented Oct 26, 2024

2024-Oct-26 19:19:13 - [Startup] TFE_System::init
2024-Oct-26 19:19:13 - [Display] Fullscreen enabled.
2024-Oct-26 19:19:13 - [Display] Vertical Sync enabled.
2024-Oct-26 19:19:13 - [RenderBackend] SDL Videodriver: cocoa
2024-Oct-26 19:19:13 - [Error : RenderBackend] SDL_GL_CreateContext() failed: OpenGL Core Profile is not supported on this platform version
2024-Oct-26 19:19:13 - [Critical : GPU] Cannot initialize GPU/Window.

Same error on 10.6 Snow Leopard, 10.10 Yosemite and 10.13 High Sierra - didn't test on later OSX versions (yet).

@mlauss2
Copy link
Contributor

mlauss2 commented Oct 26, 2024

what if you change MAJOR_VERSION from 4 to 3, and MINOR_VERSION from 1 to 3?

@thermophylae33
Copy link

same error - tried it with a couple different numbers down to 2.0 but doesn't change anything unfortunately.

@gilmorem560
Copy link
Contributor

So on my machine at least the capability check is failing for two reasons:

  • The "UBO" capability is not being detected (check for "GL_ARB_uniform_buffer_object" extension)
  • The texture buffer maximum size is being reported as 0 (check for GL_MAX_TEXTURE_BUFFER_SIZE via glGetIntegerv)

I think what's happening here is a result of mix-matching SDL and native OpenGL calls. For instance, in TFE_RenderBackend/Win32OpenGL/openGL_Caps.cpp, the OpenGL major/minor version are being requested via:

glGetIntegerv(GL_MAJOR_VERSION, &gl_maj);
glGetIntegerv(GL_MINOR_VERSION, &gl_min);

Both gl_maj and gl_min are 0 on my machine after these lines run. However, if I swap these with

SDL_GL_GetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, &gl_maj);
SDL_GL_GetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, &gl_min);

I get back a major.minor of 2.1. Still, the minimum requirements (defined as DEV_TIER_2) appear to be OpenGL 3.3 capabilities and a maximum texture buffer size of at least 0x10000.

I'm not sure if there is an SDL equivalent of the texture buffer size lookup. I tried briefly to find one to no avail. Some Googling around suggests that getting higher OpenGL profiles than 2.1 to work on macOS is a mixed bag. I wonder if this simply means macOS may need some significant work in the renderer. However, I do recall getting an OpenGL surface to pop up in Cocoa for this once upon a time...so there is probably a way. If I figure out any more I'll share that info here.

@gilmorem560
Copy link
Contributor

@gilmorem560 does this patch help?

index 960dc91e..82868a36 100644
--- a/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp
+++ b/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp
@@ -120,6 +120,13 @@ namespace TFE_RenderBackend
                        return nullptr;
                }
 
+#ifdef __APPLE__
+               SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
+               SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+               SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
+               SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+               SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
+#endif
                SDL_GLContext context = SDL_GL_CreateContext(window);
                if (!context)

Adding just the last three actually finally got me a surface, looks like without the hints OpenGL defaults to 2.1 on macOS. With the hints I get OpenGL 4.1 on my machine. This also resolves the matter of not getting a maximum texture buffer size.

So in addition to adding this to the context setup right before creating the context (I chose 3.3 because that's the minimum the code is looking for):

#ifdef __APPLE__
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
#endif

I also had to edit the capability check because it was only checking for extensions that can provide the 3.3 experience on lower versions. In other words, the check on capabilities goes from:

((m_supportFlags & CAP_3_3_FULL) == CAP_3_3_FULL)

to

(((m_supportFlags & CAP_3_3_FULL) == CAP_3_3_FULL) || ((gl_maj >= 3) && (gl_min >= 3)))

The reason being that the individual checks are being done by looking up certain extension names, extension names that are no longer present when a given extension gets promulgated into the actual profile. Doesn't mean that bit isn't supported, just means it's been incorporated into the core profile and no longer exposes that extension handle.

This can probably be done more gracefully to allow macOS machines that do reach tier 3 (OpenGL 4.5) to also utilize whatever that adds in, but in any case this should be the root of getting a surface. After I make these changes, TFE launches and creates a full-screen, albeit blank, OpenGL surface. In the console I get the following:

2024-Oct-28 12:57:35 - [RenderBackend] SDL Videodriver: cocoa
2024-Oct-28 12:57:35 - [RenderBackend] GL Info: 4.1 INTEL-22.5.11, Intel(R) Iris(TM) Plus Graphics OpenGL Engine
2024-Oct-28 12:57:35 - [RenderBackend] OpenGL Device Tier: 2
2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/overlay.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/blit.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/blit.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/blit.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/blit.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/blit.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Failed to compile 'Shaders/blit.vert'!

2024-Oct-28 12:57:36 - [Error : Shader] Error: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.


2024-Oct-28 12:57:36 - [Error : Shader] Error: 

2024-Oct-28 12:57:36 - [Error : Shader] Error: 

2024-Oct-28 12:57:36 - [Error : Shader] Error: 

2024-Oct-28 12:57:36 - [Warning : TextureGPU - OpenGL] Pre-existing OpenGL error: 0x501 when calling TextureGpu::create().
2024-Oct-28 12:57:36 - [Startup] TFE_AudioSystem::init
2024-Oct-28 12:57:36 - [Audio] SDLAudio using interface 'coreaudio'
2024-Oct-28 12:57:36 - [Audio] Device 00: MacBook Pro Speakers
2024-Oct-28 12:57:36 - [Audio] Device 01: Microsoft Teams Audio
2024-Oct-28 12:57:36 - [Audio] Starting up audio stream for device 'System Default'
2024-Oct-28 12:57:36 - [Startup] TFE_MidiPlayer::init
2024-Oct-28 12:57:36 - [Startup] TFE_Image::init
2024-Oct-28 12:57:36 - [Startup] TFE_FrontEndUI::init
2024-Oct-28 12:57:36 - [MemoryRegion] Allocated new memory block in region 'game' - new size is 1 blocks, total size is '8388608'
2024-Oct-28 12:57:36 - [MemoryRegion] Allocated new memory block in region 'level' - new size is 1 blocks, total size is '8388608'
2024-Oct-28 12:57:36 - [Progam Flow] The Force Engine Game Loop Started
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader! With GLSL: #version 130

ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader! With GLSL: #version 130

ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! With GLSL #version 130

ERROR: One or more attached shaders not successfully compiled

2024-Oct-28 12:57:39 - [Audio] Shutdown
2024-Oct-28 12:57:39 - [Audio] Stop Audio Stream.
2024-Oct-28 12:57:39 - [MidiPlayer] Shutdown
2024-Oct-28 12:57:39 - [Progam Flow] The Force Engine Game Loop Ended.

Looks like the next domino is the shader GLSL versions. Hopefully all of these notes help.

@gilmorem560
Copy link
Contributor

https://stackoverflow.com/questions/68268197/is-glsl-1-30-always-supported-in-opengl-3-x-4-x

Food for thought:

...
Apple is known to be paranoid in following OpenGL specs and usually generates errors on
every deviation from it. And here we see that Apple engineers read the other portion of
OpenGL 3.2 specification listing supported GLSL versions as 1.40 and 1.50 - so that it does not
accept GLSL 1.30.
...
In contrast, Apple never has OpenGL 3.0/3.1 and implemented OpenGL 3.2 Core Profile straight
ahead (without any interest in implementing Compatible Profiles). That's why, I guess, they
preferred to read specs that GLSL 1.30 (OpenGL 3.1) is not supported.
...

Sounds like the GLSL version may be suspect in this specific case. Since this is getting into the realm of potentially reworking components altogether, I think the solution to this one will need some attention from @luciusDXL and other central folks. In any case, the details in this thread should provide a roadmap for getting the build system and basic C++ bits behaving better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that enhances the project.
Projects
None yet
Development

No branches or pull requests

9 participants