[Help] Undefined symbols - Pythonista Template
Hi everyone, I’m trying to compile the Pythonista Template with Theos using a Makefile. When I’m making the package I always get this error:
Undefined symbols for architecture arm64: "_OBJC_CLASS_$_OMTextColorTheme", referenced from: objc-class-ref in PAAppViewController.m.417963fe.o "_OBJC_CLASS_$_PAEExtensionContext", referenced from: objc-class-ref in PAAppDelegate.m.417963fe.o "_OBJC_CLASS_$_PAStandaloneOutputView", referenced from: objc-class-ref in PAAppViewController.m.417963fe.o "_OBJC_CLASS_$_PythonInterpreter", referenced from: objc-class-ref in PAAppDelegate.m.417963fe.o ld: symbol(s) not found for architecture arm64 clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
I don’t know almost nothing of obj-c but i can assume there’s an error when importing this objects from the .h file (though the header has the #import somename.h) since all that objects are defined in their respective somename.h
Si how can I import the object or fix that undefined symbol? Or it is something about the arm64 and armv7 (I don’t think so)?
search the source for OMTextColorScheme, and make sure the file where that class was defined has a corresponding .o file, and that .o file is on the linker path. then do the same for all of the other missing classes.
The imort somename.h are used by the compiler-- objects defined outside of the particular c file are left as symbolic names, rather than duplicating all of the code. The imported files have associated .m's that result in .o's that contain the actual code, and it is the linker that is then responsible for stitching together all of the references.
if you are trying to generate the makefile yourself, that seems rife with problems. You might consider starting with XCode, then using its makefile as a starting point.
Thank you for your answer @JonB .
Okay, I was making some test and I can’t make it work. I tried:
- Duplicating de .h and changing its name to .o, then linking it to the .m (both of them .h and .o). But I have a dublicated symbol error. I got the same error linking the .o to the .h.
- Replacing the .h for a .o and linking it to the .m but I get the same link error.
- Making a .o for every undefined symbol of the error and linking it to the .m. I got the same error (I think I don’t remember, but it was an error)
What am I doing wrong? Where to link it? Thank you for your time by the way.
PD: I’m not compiling it in Xcode because I don’t a have a Mac, and if I could make this make file to work it will be awesome
@AlejandroDDD uhh, no you don't to rename .h files to .o, since the former is a text header file, while the latter is a binary object file...
This is going to be hard if you are not familiar with the tools, or c compilation in general.
You might try CMake,
to try to automatically create your make files. Or maybe find a theos forum.