Troubleshooting Error in .cc File: Missing '/' or '\

Click For Summary

Discussion Overview

The discussion revolves around troubleshooting an error encountered in a C++ source file (.cc) related to a missing character in the code. Participants are trying to identify the source of the error message that indicates a missing '/' or '\' at or after line 37.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant shares a snippet of their .cc file and describes the error message received when attempting to run the file.
  • Another participant questions whether the error might be in the corresponding header file (*.hh) and requests clarification on what is meant by "run the file."
  • A participant specifies that line 37 contains a macro definition for namespace and highlights the need for more context to diagnose the issue.
  • Some participants clarify that C++ source code must be compiled and linked into an executable before it can be run, indicating a misunderstanding about the process.
  • There is a request for additional lines of code prior to line 37 to better understand the context of the error.

Areas of Agreement / Disagreement

Participants generally agree on the need for more information to diagnose the error, but there is some disagreement regarding the understanding of how to execute C++ code and the specific location of the error.

Contextual Notes

Limitations: The discussion lacks specific details about the surrounding code and the exact nature of the error, which may hinder accurate troubleshooting.

malawi_glenn
Science Advisor
Messages
6,735
Reaction score
2,436
I have this in my .cc file:

#ifndef __FASTJET_FASTJET_BASE_HH__
#define __FASTJET_FASTJET_BASE_HH__

// define this for easier readability (and obfuscation?) in
// a range of places
#define FASTJET_BEGIN_NAMESPACE namespace fastjet{
#define FASTJET_END_NAMESPACE}

#endif // __FASTJET_FASTJET_BASE_HH__

When Iam trying to run the file, the prompt says:

Error: Missing one of '
\/' expected at or after line 37.

And I have NO idea what Iam suppose to fix =/
 
Technology news on Phys.org
Did you mean in your *.hh file? And what do you mean by "run the file"?

It's kind of hard to guess what the problem is when you don't even quote line 37; a few lines before that might even be necessary!
 
I wrote filename in root, to run the file.

The line 37 is:
#define FASTJET_BEGIN_NAMESPACE namespace fastjet{
 
You can't run C++ source code... you have to compile & link them into an executable, and then run the executable...
 
Hurkyl said:
You can't run C++ source code... you have to compile & link them into an executable, and then run the executable...


Iknow, I just wanted to ask what error I have made in the code.
 
Post at least 5 lines before line 37 too.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
12K
  • · Replies 27 ·
Replies
27
Views
6K
Replies
3
Views
3K
Replies
1
Views
2K
  • · Replies 75 ·
3
Replies
75
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 89 ·
3
Replies
89
Views
6K
Replies
5
Views
16K
  • · Replies 4 ·
Replies
4
Views
9K