The solution to the error is to keep C source files in resources/scala-native and also remove the @link("HelloWorld") from HelloWorld.scala as I already point a custom path to find the .so file using nativeLinkingOptions config in my build.mill
The solution was provided by a Scala Native Lead dev in Scala forum. Link to it here