compile error on wrong line

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I use Microsoft Visual C++ .NET (version 7.1.3088)
Sometimes (with big codes?) when I get a compile error and click on the error, the cursor is placed next to the wrong piece of code. The line number in the error message and that of the cursor do match but the real error is somewhere else.
The same I get when debugging my code, the piece of code the cursor is at is no way the code that is actually debugged.
This is very frustating!

I re-compiled the complete project but this does not help!

Any suggestions?

Thanx in advance
 
bob said:
Hello,

I use Microsoft Visual C++ .NET (version 7.1.3088)
Sometimes (with big codes?) when I get a compile error and click on the
error, the cursor is placed next to the wrong piece of code. The line
number in the error message and that of the cursor do match but the real
error is somewhere else.
The same I get when debugging my code, the piece of code the cursor is at
is no way the code that is actually debugged.
This is very frustating!

I re-compiled the complete project but this does not help!

Any suggestions?

Thanx in advance

Forgive me if these seem trivial questions, but are you talking about
misidentification a line or two away, or farther off than that? How big is
"big code", and is there any pattern to the type of code where this happens?
 
bob said:
Hello,

I use Microsoft Visual C++ .NET (version 7.1.3088)
Sometimes (with big codes?) when I get a compile error and click on the error, the cursor is placed next to the wrong piece of
code. The line number in the error message and that of the cursor do match but the real error is somewhere else. The same I get
when debugging my code, the piece of code the cursor is at is no way the code that is actually debugged.
This is very frustating!

I re-compiled the complete project but this does not help!

Any suggestions?

I've seen this happening when the code
has mixed line endings.
Thanx in advance


Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
Peter

The code consists of 3 libs and 1 console application and has several ten thousand lines of code
Recently, I added some new *.h files. The errors (wrong compile line error and wrong debug line) only happen in the new part of the code
The compile error is typically 5 to 10 lines wrong
When debugging, whole shunks of new code are omitted

According to Schobi a reason could be "I've seen this happening when the code has mixed line endings." although I've no idea what mixed line endings are

Bo
 
I experience the same problem but with much "shorter" code (2 C files of about 400 lines each

What do you mean by "line endings
 
/r versus /n versus /r/n versus /n/r at the end of your lines of source.

Ronald Laeremans
Visual C++ team
 
bob said:
[...]
According to Schobi a reason could be "I've seen this happening
when the code has mixed line endings." although I've no idea what
mixed line endings are?
Mac/Win/Unix

Bob


Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
Stéphane said:
Bob,

I'v got the same problem.

How did you correct the line endings?


I used an in-house tool.
However, I believe the IDe will correct
line endings when you save a file.

Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
Stéphane said:
[...]
What I don't understand is how the problem first occurred.
Is it a cut and paste problem? I will continue to investigate!

It usually happens when you copy code between
platforms.
Thank you for your help.

Steph


Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
Back
Top