I was coding in win32, and my program actually works in debug mode in vs, however not in release mode and not outside vs.
int _tmain(int argc, _TCHAR* argv[])
{
//assert that there are 3 parameters.
assert(argc==4);
LPCTSTR inputPath = argv[1];
LPCTSTR sharedName = argv[2];
LPCTSTR logPath = argv[3];
sometimes argc is not correct (over 300000, while it should be 4), and sometimes the
LPCTSTR sharedName = argv[2];
line is just ignored!
when debugging this program in release mode, it jumps over it, and when hoovering above the variable name nothing happens.
When right-clicking a variable and choosing Add Watch, I get the error logPath CXX0017: Error: symbol "logPath" not found
of course, I have set the command arguments in vs to be "a b c" (without the quotes)
What could it be? running the simplified program: // test.cpp : Defines the entry point for the console application. //
#include "stdafx.h"
#include "stdafx.h"
#include <windows.h>
#include <assert.h>
#include "conio.h"
int _tmain(int argc, _TCHAR* argv[])
{
assert(argc==4);
LPCTSTR inputPath = argv[1];
LPCTSTR sharedName = argv[2];
LPCTSTR logPath = argv[3];
_getch();
}
yields the same result. the debugger just jumps to the getch line, and if I try to add watch, I get logPath CXX0017: Error: symbol "logPath" not found
inputPath CXX0017: Error: symbol "inputPath" not found
sharedName CXX0017: Error: symbol "sharedName" not found