exe never runs main or any other operations

ok so I'm writing a compiler for a language that ive made up, that has c++ like syntax. I've tried compiling it on a unix sun system and visual studios with no luck on either of them. It compiles fine with some warnings about float to int possible loss of data, but when the program is run it just keeps running until killed. I have tried setting break points inside every operations and at the beginning of main but these are never hit??????? On the unix system I tried putting couts at the start of every operation and main with nothing output??? I have a few classes I created and a set of execution operations in separate files. Also I use 2 command line arguments one to take in the high level code and one to output the machine code. My code is very long so i will get it to ya if you ask. Any comments much appreciated.
See if you're using any static objects (globals, static local data, static member data) whose constructors enter infinite loops.
thanks for quick response, I am using some static constants. is that what you are refering to?

1
2
3
4
5
static const int MAX_variable_array = 500;
static const int MAX_variable_name_len = 6;
static const int MAX_number_of_statements = 10000;
static const int MAX_length = 10000;
static const int machine_calc_variable  = 249;


I use one or more of these in every class header and .cpp and in execution file and in my main program. I define and use them where ever needed except in my main program (since execution.cpp is included and they are all defined there). Can I define them in my main program and no where else? Am i on the right track?
Just basic types? No objects?
Make sure you are flushing the output at those cout statements if you don't have any newlines.
nope no static objects but I did put breaks in all the class .cpp operations and for some reason one of the classes has no functions other that the constructor and destructor. the funny thin is that i breaks at the constructor 3 or 4 times then moves on and just keep running.
ok i have found that if i rearranged my global variables so that a different class (from the post above) variable is defined first in my main program, however visual studios tells me that the breakpoints in the variables.cpp contsuctortor and destructor will never be hit and no executable code is associated with this line.
the problem was that one of the other classes I made has an never ending loop in one of its operations. For some reason, I put breaks in the operation and visual studios never actually broke execution it would just stall???
Topic archived. No new replies allowed.