llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.08k stars 11.99k forks source link

Blocks Runtime Error #89321

Open RuiCuco opened 6 months ago

RuiCuco commented 6 months ago

Consider 'testblocks.c':

#include <stdio.h>

int main(void)
{
    ^void(void){printf("Hello!\n");}();
    return 0;
}

If I say (in MSYS2 in Windows 11):

clang -std=c17 -fblocks -o testblocks.exe testblocks.c -lBlocksRuntime

I get the following error:

C:\Developer\msys64\ucrt64\bin\ld: C:\Developer\msys64\tmp\testblocks-767281.o:testblocks.c:(.text+0x53): undefined reference to 'impNSConcreteGlobalBlock' clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is this a bug or am I doing something wrong?

Sirraide commented 6 months ago

At a glance, this looks like an issue w/ your runtime, but someone more familiar with blocks/objective-c might know more about this.