Why not use a resource then? In case you did not know, you can embed virtually anything there.
For example, in the .rc file, add
APP_XML_DATA RCDATA "app.xml"
where
APP_XML_DATA
is the identifier you will use to load this resource,
RCDATA
indicates this is a user resource type, and "app.xml" is the path to your file.
And now you can load the resource easily in wxWidgets with wxLoadUserResource(), for example load it into wxCharBuffer
wxCharBuffer buffer = wxCharBuffer::CreateNonOwned(wxLoadUserResource("APP_XML_DATA", RT_RCDATA));
// use the buffer as read-only
or into wxMemoryInputStream that can be used as any input stream
const void* xmlData = nullptr;
size_t xmlDataSize = 0;
if ( wxLoadUserResource(&xmlData, &xmlDataSize, "APP_XML_DATA", RT_RCDATA) )
{
wxMemoryInputStream(xmlData, xmlDataSize);
// read from the stream
}
I am Windows only, so I have no idea how this would be done on other platforms; however, I do not think MacOS or Linux have a similar mechanism for embedding data into the executable or library.