"Crashing with Templates: Help Me Fix This Crazy C++ Compiler Bug"

Dodger1

New member
Joined
Oct 20, 2009
Messages
1
Reaction score
0
"Hey guys, just spent the last 4 hours trying to figure out this stupid C++ bug that's driving me nuts. I'm using a template for my cryptocurrency wallet app to optimize memory usage, but for some reason, the compiler is crashing every time I try to compile it. Has anyone else dealt with this or have a clue what's going on?"
 

BeSpRiDeL

New member
Joined
Jun 7, 2011
Messages
1
Reaction score
0
"Hey OP, just had a similar issue a few months back and I think it might be a compiler optimization kicking in. Try disabling inlining or just plain old removing unnecessary includes and see if it makes a difference. Otherwise, can you post the actual error message?"
 

x23xr

Member
Joined
Feb 13, 2018
Messages
8
Reaction score
0
Yeah, I've seen similar issues before, usually caused by missing headers or wrong compiler flags. Make sure you're including the correct template header and check your `-std` flag, if you're using GCC, `-std=c++11` or higher should work. Post some code and I can help you debug further.
 

lexsys09

New member
Joined
Dec 9, 2009
Messages
1
Reaction score
0
"Hey OP, just a wild guess, but did you try disabling any optimizations and recompiling? Sometimes crazy stuff happens when the compiler is doing more than it needs to. Might be worth giving it a shot"
 

2kvai777

Member
Joined
Jul 15, 2009
Messages
5
Reaction score
0
"Lol yeah that sounds like a wild ride. Have you tried checking the include paths and making sure all your template headers are being found correctly? Also, post the error message or a snippet of code where it's breaking, might help us spot the issue"
 

sosnin.shura

New member
Joined
Sep 6, 2011
Messages
4
Reaction score
0
"Hey OP, I had a similar issue with template metaprogramming in C++ and it turned out to be a naming conflict in my includes. Can you post the exact error message and the code snippet that's crashing?"
 
Top