Troubleshooting Compilation Errors

Top  Previous  Next

Compiler errors complain of no such functions snprintf and/or vsnprintf?

JrDebug tries to se a version of printf (sprintf) that checks for and protects against printinf lines that are too long (bigger than 4096 bytes).  But some compilers may not provide this function.  Uncomment the following line in jrdebug.h to force it to compile with normal sprintf and vsprintf:.

//#define JrDebugDIRECTIVE_DontTryToUseSnprintf

You might alternatively try to force JrDebugLogger to try different versions of _snprintf if you suspect it is failing to properly guess whether your compiler uses _snprintf or snprintf, by uncommenting one of the following:

//#define JrDebugDIRECTIVE_DontUseSnprintfUnderscores

//#define JrDebugDIRECTIVE_UseSnprintfUnderscores

 

Linker errors about missing external static variables from the JrDebug class?

You probably forget to #include "jrdebug_main.cpp" from your main .cpp file (or alternatively to add it to your project or makefile). More Information...

 

Linker errors about multiple definitions for static variables from the JrDebug class?

You probably #included "jrdebug_main.cpp" from more than one of your .cpp files (or both added the #include and added the .cpp to your project file). More information...