Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Why does my Visual Studio project constantly say it can't find stdint.h but it builds fine?

Everywhere I try to include stdint.h and use it's associated types like int32_t or uint8_t, Visual Studio reports "Error: Cannot open source file "stdint.h" ".

When I specify these types as "std::int32_t" the usages are underlined as errors, but I can use VS's "peek definition" feature to see the file where they are defined.

As long as I only build, and don't rebuild, everything appears to build fine. Why is Visual Studio so confused here? Here's a screenshot of what I'm seeing, with the usage underlined, but "peek definition" still working:

alt text

Product Version: UE 4.10
dumb.png (26.3 kB)
more ▼

asked Dec 15 '15 at 05:47 PM in C++ Programming

avatar image

437 20 97 123

avatar image Doug E ♦♦ STAFF Dec 15 '15 at 09:09 PM

Hey janimatriond-

I was able to add an include for stdint.h as well as declare an int32_t, both of which compiled without issue. Can you post the full compile error that you receive? Looking at the screenshot I can't tell if what is highlighted is intellisense giving a false positive or if it is an actual error. Also, can you try adding the stdint.h include in a new project with no additional content and see if you have the same compile errors.


Doug Wilson

avatar image janimationd Dec 17 '15 at 07:05 PM

They are build errors, not intellisense errors. Intellisense can actually find the header file, which is why it can Peek Definition. I created a new project and I don't have the same issue. These errors only pop up occasionally and can often be fixed by rebuilding rather than building, or vice versa. The errors are pretty non-deterministic.

avatar image RuBa1987 Dec 16 '15 at 01:03 AM

Could be an intellisense error... Maybe?

Edit: What I mean by that is intellisense kinda sucks for UE4/C++ in my experience so I just turn it off but I see a lot of weird stuff like that. I normally just use Resharper carefully configured.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question