Skip to content
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

Build failed(Error C1060) with big resource files. #32

Open
dhckdaks opened this issue Oct 22, 2021 · 5 comments
Open

Build failed(Error C1060) with big resource files. #32

dhckdaks opened this issue Oct 22, 2021 · 5 comments

Comments

@dhckdaks
Copy link

dhckdaks commented Oct 22, 2021

I have a few resource files around 155 MB.
In the building process, the following error occurred:
(I used msvc tool set.)

~~~resourceFileName.cpp(1): fatal error C1060: compiler is out of heap space

(And overloads memory and disk. My computer almost died...)

How to solve this problem?

@dhckdaks dhckdaks changed the title Build failed(Error C1060) with huge resource files. Build failed(Error C1060) with big resource files. Oct 22, 2021
@vector-of-bool
Copy link
Owner

Interesting issue. Are all of the files around the same size of 155 MB? It's possible that there is no good solution. The "embed as character array" is mostly just a hack. I've not encountered any cases with such large individual files. Something smarter with generated assembly code might be warranted in this case, which CMakeRC doesn't yet do.

@dhckdaks
Copy link
Author

dhckdaks commented Nov 1, 2021

Not all resource files are 155 MB in size.
But at least 35 MB.

Could you give me some guide(or some reference) for "generated assembly code"?

@vector-of-bool
Copy link
Owner

Some assemblers support "include this binary file." As far as I know, MSVC's MASM does not, unfortunately. I do not know an easy way to include such a large file as a single block of data. Large data like this may require a smarter resource compiler than CMakeRC.

@dhckdaks
Copy link
Author

dhckdaks commented Nov 2, 2021

Thank you for answer. Let's find another way. (Unfortunately I'm using MSVC).

@themarpe
Copy link

@dhckdaks just as an idea - Windows offers Resource Compiler tool (https://docs.microsoft.com/en-us/windows/win32/menurc/resource-compiler) which might be applicable if you only target Windows. I've tried incorporating it as part of my PR #21, but haven't perused further as the usage differs from a "compiled read only data" approach (seems like it gets added to some other part of the final compiled file and some sort of runtime is used to read it out). The runtime code also needs to know whether the data was part of the application or dll, etc...

If you are however okay with this differences, I suggest you to use this - it should lift the big file restrictions. If you still want cross platform usage, then use my #21 PR for other compilers, which easily handle such large files as the compiler performs the insertion of the binary file directly, compared to compiling a large char array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants