-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSVC tool doesn't work #57
Comments
You need to list the source files which use INCBIN you want preprocessed by this tool, you don't list the data files, those are read from the // source.c
INCBIN(data, "phong_lighting.glsl"); Then you'd run the tool with If you have multiple source files which use |
Ah I see, I was confused, thank you! |
I was confused too. I think the description of how to use it should be clearer. I didn't understand that Maybe you should add a little counter so it's easier to understand that nothing was found? diff --git a/incbin.c b/incbin.c
index fd1e72b..ca6abe4 100644
--- a/incbin.c
+++ b/incbin.c
@@ -104,7 +104,7 @@ static const char *styled(int style, int ident) {
}
int main(int argc, char **argv) {
- int ret = 0, i, paths, files = 0, style = kCamel;
+ int ret = 0, i, paths, files = 0, style = kCamel, written = 0;
char outfile[FILENAME_MAX] = "data.c";
char search_paths[SEARCH_PATHS_MAX][PATH_MAX];
char prefix[FILENAME_MAX] = "g";
@@ -263,6 +263,7 @@ usage:
fprintf(out, i != size - 1 ? "0x%02X, " : "0x%02X", data[i]);
count++;
}
+ written++;
free(data);
fclose(f);
}
@@ -282,6 +283,7 @@ end:
fprintf(out, "#endif\n");
fclose(out);
printf("generated `%s'\n", outfile);
+ printf("number of files included: %d\n", written);
return 0;
}
|
I compiled the incbin.c file and made an executable if I run it with help I get:
If I try to run it normally (without the help flag) this is the data.c file that gets generated:
No errors or warnings are thrown by the tool.
I am on windows 10
The text was updated successfully, but these errors were encountered: