Try setting the linkage to “api” for the library:
sources.hello.cpp { lib library: 'tryHello', linkage: 'api' }