Closed OttoHatt closed 11 months ago
try adding the -lstdc++
to the list of arguments passed to cc
. nicegraf metal backend is c++ and likely to remain so (we're trying to escape objective-c). This means a dependency on the c++ runtime, even if we didn't use stl at all. cc
doesn't link against libstdc++ by default which is why you got these errors.
Linking stdc++
(or c++
works). Should this be a public dependency in the CMake file?
Also, I didn't realise there was a C++ duplicate of the metal backend! Is it at feature parity / preferable to use over the obj-c one?
Linking stdc++ (or c++ works). Should this be a public dependency in the CMake file?
Probably, yes. All code that currently uses nicegraf is C++ so we didn't run into that issue previously.
Also, I didn't realise there was a C++ duplicate of the metal backend! Is it at feature parity / preferable to use over the obj-c one?
There are no more major TODOs there, however it's not used in "production" yet. You'd be the first client outside of nicegraf samples to use it. It should eventually replace the legacy implementation and the replacement should be completely transparent to the clients, so I recommend sticking with the default implementation.
I'm curious as to what your production use case for this library is? I'm using it for a game engine, though the apparent lack of bindless & indirect may prove it difficult to scale. Do those features align with your goals at all?
It is currently being used for a game engine as well. Indirect draw support is planned at some point in the near future (there is a ticket tracking it). Bindless is something I want to support as well, though it is not likely to happen soon. Neither of these have been a limiting factor so far.
Compiling a C program w/
cc
linkingnicegraf-mtl
gives a number of linker errors:I can cut down on these by disabling exceptions. What's left is related to
basic_string
. But I can fix this by linking thec++
lib in my consuming application. Is that the intended solution?