I want to start dfhack from a terminal on Linux and have Dwarf Fortress run with xinit.
I'm guessing you mean "from the Linux console" rather than a generical terminal (xterm, etc.).
I tried doing something like that with dfhack, but inserting xinit before every instance of ./libs/Dwarf_Fortress doesn't work but fails with
xinit: symbol lookup error: ./hack/libdfhack.so: undefined symbol: _ZTV8renderer
I have no idea what that means and how to deal with that.
So wait, you're running ./dfhack from the console, rather than within the X session? Most likely, the shared library environment variables that dfhack sets are not being propagated through to the Dwarf_Fortress process running in the X session.
Try some variant of this, from the Linux console:
startx /usr/bin/rxvt -e /wherever/you/put/dfhack
If you don't have rxvt installed, run some other terminal emulator. If you insist on skipping the entire dfhack script, then you'll have to set the shared library environment variables yourself.
I really think you're going to need a window manager though, unless you painstakingly set the geometry for the terminal emulator window so it doesn't overlap the Dwarf_Fortress window, since you won't be able to raise one above the other at will.
If you REALLY want to have the dfhack command line interface running on the Linux console, and Dwarf_Fortress running within an X session, with no X terminal emulator at all, then I have no idea how to achieve that. I wouldn't even attempt it.