#VS can see include file but compiler can't open it

39 messages · Page 1 of 1 (latest)

odd topaz
#

I posted yesterday and seemed to fix my issue but alas... I'm getting C1083 "cannot open include file" when compiling, but VS displays the file when auto-completing the #include & it's included in 'External Dependencies' folder where i can open & view it.

Have tried vcpkg, nuget, manually including and reinstalling VS. Only time it hasn't gotten stuck is when I include the full file location but it then gets stuck on it's own include files.

winter bluffBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

atomic coyote
odd topaz
atomic coyote
#

its on the right side

#

the 3 dots

odd topaz
atomic coyote
#

so i can see evaluated value

odd topaz
atomic coyote
#

okay now show compiler error

#

the output tab

odd topaz
atomic coyote
odd topaz
#

Set both projects to use c++ 17 under language

atomic coyote
#

do both projects have same include dir

odd topaz
#

So I've got NetCommon which is headers-only wrapping everything to do with asio, then NetClient includes the NetCommon headers to run a script - which appears to be working the only errors are back at the NetCommon #include asio

#

I'll add a cpp file to NetCommon to see if it'll work in only that project

atomic coyote
#

add the include dir to that project too

#

also idk whats the point of a whole projects for header only files

#

just make a directory

odd topaz
#

following a tut to get my head around this stuff

#

thats NetClient set up with both include directiories

atomic coyote
#

not asking about net client

#

the issue is on netcommon

odd topaz
#

yeah yeah, all the earlier screenshots are from Netcommon

#

made a whole new project with the h and cpp files all in one and it seems to be working... maybe I've messed something up when creating the project or it just doesn't like working cross-projects

#

I'll go away and copy all the code over to a brand new project set up like this and see what happens

modern harbor
#

unfortunately too easy to miss (or mess this up)
the standard (imo) is to put additional folders into C/C++ - General - Additional include directories
not in the global VC++ Directories

odd topaz
#

holy moley I fixed it...somehow. Made a whole new project and all. It seems like the NetClient also needed to have the library as an included directory but I definitely tried that, so possibly I'd messed something else up along the way. But it was definitely giving me the wrong error for what the problem actually was

#

ah well, back to actually coding, thanks for the help team

#

!solved