> How are you compiling? Unity build or multiple .cpp files?
> Is handmade_platform.h file included before Win32ReadDataFromFile function?
Unity build, of course. The header file is included in the very beginning of the main.m platform source file. I'm aiming at maximum compatibility, only the platform code implemented partially with Obj-C: bitmap bliting, sound and event processing is done via Cocoa API to run on OS X.
The structure of the application is identical to what Casey is doing.
I even did an experiment and transferred the definition of the inline function right before the Win32ReadDataFromFile, just to be sure. I still get the same error without static.
The error:
| Undefined symbols for architecture x86_64:
"_SafeTruncateUInt64", referenced from:
_osxReadDataFromFile in main-7e1169.o
ld: symbol(s) not found for architecture x86_64
|
Compilation:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | /usr/bin/clang++ \
./src/main.m \
-g -O0 \
-pthread \
-Wall -Werror \
-pedantic \
-Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations \
-Wno-gnu-anonymous-struct -Wno-nested-anon-types -Wno-switch \
-Wno-gnu-zero-variadic-macro-arguments \
-Wno-gnu-empty-initializer -Wno-language-extension-token \
-DGAME_INTERNAL=1 -DGAME_SLOW=1 \
-lstdc++ \
-framework OpenGL -framework Cocoa \
-framework AudioUnit \
-o ./build/game
|