Hi, I was updating my project to use the new 3.0 version. I fixed all deprecated stuff, but I still get compile error that I don’t quite understand how to fix. Compiler gives many this kinda errors: error C3130: Internal Compiler Error: failed to write injected code block to PDB
Has anybody else had this issue or know how to fix it?
All I found from internet is that the most common reason for the failure is lack of disk space, but I have lots of free space so it doesn’t make sense and the same project have worked nicely with older cocos2d-x versions.
This error happened in windows. Both visual studio 2012 and 2013 give the same error.
I get the same when trying to compile with vs2013, but they only happen in the actual test projects. The binaries of the actual library still compile fine. Maybe the same is the case for you?
Yeah the cocos library alone compiles fine for me also. But with my project it errors with the 3.0 version.
I did managed to get it compile by setting debug information format to none, so it didn’t generate any PDB file, but that is hardly any fix cos now cannot debug.
The PDB file size grows really big during compiling of my project. First it is compiling fine, but when PDB file size gets to around 300 MB then it start spamming the “Internal Compiler Error: failed to write injected code block to PDB” error. My project is having about 400 files and 40’000 lines of code. With smaller projects this doesn’t cause problem tough cos the PDB file never grows that big.
Looking inside the PDB file there seem to be lots of this kinda stuff with different actions:
//+++ Start Injected Code
::cocos2d::Action * ::cocos2d::Place::clone() const
They all say that clone method, but have different action. Maybe some template stuff.
My guess would be that some template is maybe causing code to be bloated by creating copy of some long template code for all the permutations of CCAction cloning.
But the fix seemed to be just to use /Z7 instead of /Zi.
The issue happens in debug mode also tough and not just release. And just always using /Z7 and not being able to use newer /Zi or Edit and Continue is not very nice “fix”.
I dont know too much about this PDB file but it seems to me bit strange that it’s full of this start inject clone code for actions. Like this is spammed many times in that PDB file:
Did bit more testing. Changing to not inherit Action from Clonable made the PDB size a lot more smaller. From over 330 MB (possibly would have grow even more but that error stopped it), to now only 46 MB and no “failed to write injected code block to PDB” error.
So yeah could somebody check this cloning implementation and see what is wrong with it?
I had this problem before and fixed it, then upgraded to 3.3 final (along with many updates to the game itself) and have the issue again on the first attempt to build solution. Tried changing debug to just database (no edit continue). Still get the error. Thought maybe it was limited disk space, but freed up 15GB and still error.
I removed debugging from all 4 projects (box2d, cocos2d, spine, mygame) and it builds fine.