-4

I have multiple .cpp files and .h files in VS2022, there are no red squiggly things under text (yeah I have no idea what to call them), and the code has forward decl. and no circular includes or anything, this I am certain of.

Yet when I build the project, I get tons of errors like these:

missing type specifier - int assumed. Note: C++ does not support default-int
syntax error: missing ';' before identifier 'Player'
'_POINT': unknown override specifier
missing type specifier - int assumed. Note: C++ does not support default-int
'Object': undeclared identifier
'Object': is not a class or namespace name
'std::vector': 'object' is not a valid template type argument for parameter '_Ty'
'std::vector': too few template arguments
'std::vector': use of class template requires template argument list
'Object': is not a class or namespace name
syntax error: missing ';' before '*'
missing type specifier - int assumed. Note: C++ does not support default-int
unexpected token(s) preceding ';'
'Object': is not a class or namespace name

It appears like the compiler doesn't recognize all of my defined functions, classes enum, etc here.

Yet there is one strange thing, When I chose the option to generate .i files for info, the compilation went smoothly, no errors, as it should have been, yet as soon as it got to the linker phase, the build process stopped with the fatal error LNK1104: Can't open file 'C:\Program.obj'

The .obj files were all generated and in the correct destination, yet the strange thing was all the folders. The path to the debug folder in my project is C:\Users\User\source\repos\Project\Project\x64\Debug

I have tried everything, changing the vcxproj file, changing between C++ versions, visual studio versions, and also creating a fresh project and copy paste all the code,

Nothing

12
  • 4
    BTW, Your question is very far from a minimal reproducible example as a result it will not be taken well at StackOverflow because we don't have the information we need to be able to help without guessing and that by definition isn't good for helping future readers solve the same problem. Remember that the #1 purpose of a question is its usefulness to help future readers. It's not about helping the person asking. Commented Nov 14 at 16:32
  • 2
    You can only really trust the first error message which could be as simple as a single missing semi colon just prior to Player. You need to distil it down to a minimal reproducible example that shows the error when compiling a simple single file program. You may also figure it out yourself whilst trying to produce the MRE. Commented Nov 14 at 16:35
  • 3
    The "red squiggly things under text" are called red squiggly lines. Commented Nov 14 at 16:47
  • 2
    We cannot really do much if you don't show your source, have you declared and defined Player, and/or included it's header file? Also do not fully trust intellisense.. the red squiggles, it shows are sometime not quite correct, to be fast the tool takes shortcuts. Commented Nov 14 at 16:51
  • 2
    @Eljay or red squiggles for short :D Commented Nov 14 at 16:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.