If you are not an administrator on your own machine you may get an access violation error when using the Yap dvi viewer supplied with MikTex. The error is Windows API error 5: Access is denied. The happens because the user does not have write access to the MikTex directories. Right click on the directory, say, C:\Apps\MiKTeX, and make the directory, and all subdirectories, read-write. This should solve the problem.
Posted in Uncategorized | No Comments »
When compiling in Microsoft Visual C++ you may come across the preprocessor directive NOMINMAX. This undefines the macros MIN and MAX which are specified in the windows headers. In Visual C++ v 6.0 this may be in C:\Program Files\Microsoft Visual Studio\VC98\Include\windef.h where we have
#ifndef NOMINMAX
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif #ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* NOMINMAX */
Using macros to do this is a bad idea, as discussed here. The standard library has templated functions std::min and std::max which are much better. Defining NOMINMAX before any #includes of windows.h prevents the macros from being defined and allows the use of the templated functions defined in algorithm.
Posted in Software | No Comments »