question

MaxDenning-3859 avatar image
0 Votes"
MaxDenning-3859 asked MaxDenning-3859 edited

Visual Studio False Build Errors

I am working on a C++ project and am having trouble with false build errors. This used to happen every once in a while but usually restarting VS would be enough to fix it however, this time it hasn't worked. I have looked into this and have tried following many suggestions like deleting my .vs file, re-installing VS, and trying to turn off the IntelliSense errors (this does lower the amount of false errors), however I am still not have to compile my program.

This problem seems to stem from one cpp file since this used to happened when I made changes to it. This file is a decent size and uses a decent amount of macros (I am not sure if that has anything to do with it)

Any ideas? I can post code if necessary.

c++
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


At least post the first build errors.

1 Vote 1 ·
WayneAKing-0228 avatar image
0 Votes"
WayneAKing-0228 answered

A couple of things that look problematic to me:

(1) In ecs.cpp this line is ill-formed:

void (u_int id, float rad, float h_rad){

It appears to be missing a function name.

(2) typedef unsigned int u_int;

You may be having an issue with the use of typedef to
define a type that is used in macros. Macros are
processed by the preprocessor before the compiler
takes over. But typedefs are processed by the
compiler. So a typedef won't be effective for
macro use - you need to use a #define instead.

 #define u_int unsigned int

  • Wayne

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

WayneAKing-0228 avatar image
0 Votes"
WayneAKing-0228 answered

If you wish to share the code and project files (properties,
etc.) so others can try to replicate the errors, the usual
procedure is to post all relevant files to a file sharing
service such as Microsoft's OneDrive. Then post a link to
that code in a reply here in the forums. Obviously you
can invalidate the link and/or delete the files once
the problem has been resolved (or abandoned).

However, as Viorel-1 has suggested, you should at least
give us some clue as to what the exact errors are
that you are seeing. Just saying that you get errors
is hardly sufficient for a diagnosis. It's also needed
if someone tries to build your code. How are they to
know exactly what errors they are supposed to expect?

  • Wayne

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MaxDenning-3859 avatar image
0 Votes"
MaxDenning-3859 answered MaxDenning-3859 edited

Sorry for the lack of information, it is my first time posting. I attached a link to a zip file of my project on my google drive. The file that seems to be causing most of the issues is ecs.cpp. It seems like it does not recognize I am including ecs.h. Some other issues might show up since I have some paths are that go to files on my pc, so those might show up as errors. I attached an images for what some of my errors look like:
88881-vs-error.png

Here are my errors without IntelliSense:88835-vs-error-2.png

It seems really anger when I have u_int, however I redefined that in ecs.h so it shouldn't be an issue. Let me know if you need any more info.

(I deleted the google drive link)



vs-error.png (46.1 KiB)
vs-error-2.png (35.5 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for supplying more specifics, however easier
access to your project files would be useful.

What good does it do us when you post something to your
Google drive? How are we supposed to access it?

The link you supply must be to a repository that is
immediately accessible by anyone just by doing a copy
and paste of the link into their browser, or by clicking
on the link. Speaking for myself, I don't have a Google
account, don't want one, and don't use Google's Chrome
browser.

  • Wayne

0 Votes 0 ·
MaxDenning-3859 avatar image
0 Votes"
MaxDenning-3859 answered MaxDenning-3859 edited

Whoops I guess I thought that link would allow access. Does this one drive link work?

(link removed)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MaxDenning-3859 avatar image
0 Votes"
MaxDenning-3859 answered

It looked like changing the typedef unsigned int u_int to #define u_int unsigned int pretty much fixed everything. All my errors have disappeared after I deleted my .vs folder. I had been working with typedef unsigned int u_int for a while, but I can see how this caused an issue.

I am not sure how my function name got removed, but I fixed that too.

Thank you so much!!!!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.