Closed ewancg closed 2 years ago
A minimal reproduction worked with the same compiler and settings.
#define INCBIN_PREFIX r_
#include "incbin.h"
#include <iostream>
INCBIN(grc, "./test.txt");
int main(int argc, char *argv[]) {
std::cout << r_grcData;
}
I'm not sure how else this problem could be caused, but it certainly isn't your fault. I'm closing this issue.
In a situation where the file is included properly and no compile-time errors are encountered, trying to refer to the Data variable will yield nothing.
This code crashes because r_grcData is empty. I am using GCC 11 and glibc. The tar processing code works perfectly and does everything I want it to do when using it's normal filename-based open function. The memory stream counterpart is given a direct copy of the r_grcData variable, which should contain the tar file all the same, but doesn't.