Closed yohannd1 closed 1 year ago
Did this only happen with SDL or does it also happen with a hello world program?
This error happens when you have multiple copies of LLVM linked into your program, so if SDL (or a dependency) was linked against LLVM, that could cause it.
It could also be something in the LLVM build itself and you might benefit from using our official LLVM builds (if you built from source): https://github.com/terralang/llvm-build/
So far it's only happened with SDL. A program that just calls C.printf
doesn't have that error.
I also tried using the custom LLVM build (downloaded latest release and added it to path) but it doesn't seem to be helping (I might have used it wrong, though - see screenshot):
Also: how could I go about solving the second potential issue you mentioned? Would I have to compile SDL without LLVM?
If it goes away when you don't use SDL, then SDL is probably the culprit, either directly or indirectly.
There are a few options for how to deal with this:
terralib.linklibrary
and make sure to pass the right link flags to terralib.saveobj
.)ldd
on the SDL shared library, just to confirm that LLVM is there. But from there, you'll have to do some digging to figure out if it's a direct or indirect dependency, which can be a bit of a rabbit hole.Option 1 worked fine for me, so I think I'll stick with that. Thanks for the help!
Hello! I'm experimenting Terra (
Release 1.1.0
) and trying to build an SDL app with it. So far, my code is the following:Overall it seems fine but it's having an odd error which I can't really figure out (seemingly with LLVM):
Removing the
var win
anddefer C.SDL_DestroyWindow
statements solve the issue, so I suppose the problem is coming from there.