Why does my IDE say stdlib files are "not found" when my code compiles and runs just fine? - ide

I am getting errors all over my CLion IDE saying that stdlib files like 'fstream' and 'iostream' are not found. As a result, I'm getting many "Use of undeclared identifer 'std'" errors and more (see photo: ). Also, all variables I make of a type from these stdlib files, like a string or set for example, are reported as an error in the IDE.
I'm pretty sure the CLion IDE is the only issue here because my code compiles and runs just fine. So I've thought it's something the IDE is failing to recognize somewhere. I've tried clearing my caches and completely reinstalling the software. None of these attempts have solved the issue.
I've been trying to ignore this weird glitch-y type error for a while, but it's gotten to the point now where I can't find my real errors until I build my code because they're hiding in all of the falsely-reported errors.
How do I fix this IDE problem?

Related

IntelliJ not correctly analyzing grpc-kotlin generated code

I have followed the instructions here: https://github.com/grpc/grpc-kotlin/tree/master/compiler for Gradle, and everything is working fine, but IntelliJ is seeing errors in the generated code, even though when I run the application and manually write code I know would work it runs just fine.
Intellisense was disabled in one of the generated code files because of file size, causing all the others to have errors. I was able to increase the intellisense max file size and now everything works!

Compiler failing, but no error lines detected

I use jgrasp, but when I try to run a project it says "Compilation failed, but no error lines were detected. Check for non-clickable errors in compilation output." I have the JDK, not just the JRE. What should I do?
As it says, check the compiler output for non-clickable errors. Most likely there is some message in the output that will tell you what went wrong. Clickable errors are compilation errors in the format that javac uses.
Occasionally javac spits out a non-standard-format error for some unusual condition. For example, recent versions of javac do not properly handle OneDrive on-demand files, and will report "javac: not a file ...". If that is what is happening, you will need to change the OneDrive settings to turn on-demand off, or copy the files to a local folder to work on them then back to the OneDrive folder when you are done.
Other possibilities are that javac is crashing due to a bug, or that you have some other "javac" that is running instead of the actual Java compiler. You can turn on "Settings" > "Verbose Messages" in jGRASP and compile to verify that the correct "javac" is being invoked.

Coroutines working but IntelliJ shows errors

I am working on a project using kotlinjs for nodejs and I start to learn coroutines and integrate them into my code to say goodbye to the callback hell.
I managed to get coroutines working, my code can be compiled and executed, everything seems fine.
...except: The IDE still shows me errors. It seems to be confused by the additional libraries I added in order to get coroutines running.
I am currently fiddling around with the library dependencies, sometimes some errors go away, but then some code gets red which was okay before...
This is what I see:
Case 1:
Cannot access class 'kotlinx.coroutines.experimental.CoroutineContext'. Check your module classpath for missing or conflicting dependencies
Case 2:
Unresolved reference: JsModule
Modifier 'external' is not applicable to 'class'
You see, launch is recognized when I add the stdlib, but then the IDE complains with the other two errors.
Again, please note: In both cases, actual compilation is successful!
I am using IntelliJ 2018.1 with Kotlin Plugin 1.2.41.
Thanks to Alexander Chernikov at youtrack.jetbrains I could resolve my problem.
I cite his explanation:
The issue is that JavaScript libraries should be marked with special attribute to be recognized.
When they are imported from pom.xml or build.gradle, this mark is set, so the feature works.
In your project they are not marked.
At the moment, to correct the libs manually, please open .idea/libraries/org_jetbrains_kotlin_kotlin_stdlib_js_1_2_41.xml and .idea/libraries/org_jetbrains_kotlinx_kotlinx_coroutines_core_js_0_22_5.xml.
In both files find type="repository" and replace it with type="kotlin.js".
Make sure IDEA sees the change. (You can exit IDEA, make the change and restart.)
Then you can keep only these two libs in dependencies. The editor should work.
Here is the issue link:
https://youtrack.jetbrains.com/issue/KT-24575
There I have also attached a sample project with the problem.

How do I resolve Netbeans "cannot find symbol" in working tests?

I have this issue where NetBeans will highlight and throw "cannot find symbol" errors in the editor in some of my unit tests. It doesn't afflict all tests, nor does it happen to all objects used in the tests (most of which are in the exact same source directory). It also does not impact running the tests... The code runs fine in and outside of NetBeans as do the tests. Yet, the NetBeans IDE insists that some of the objects referenced in the unit tests cannot be found.
It's very consistent which unit tests are impacted. Sometimes merely opening the referenced object source files will cause the IDE to correct itself and remove the false alerts. Sometimes not though...
Is there some configuration option I might have missed? The source and test directory properties are pointing to the correct places (if they were wrong I'd expect everything to be wrong too).
Looks like it's probably just a NetBeans thing as it comes and goes. Oddly it will stay throughout shutdowns/restarts, but at some point perhaps some config file is rewritten... Dunno.

Msbuild command line: MSB3021 error in CopyWebApplicationLegacy task

I've seen several questions on here about this error, but all of them seem to be related to the "Access is Denied" flavor of this error, can't find any that deal with the message I'm getting:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(177,5): error MSB3021: Unable to copy file "bin\MyApp.MyLib.dll" to "C:\Temp\Publish\staging\MyApp\MyApp_1478_5\bin\MyApp.MyLib.dll". Could not find a part of the path 'bin\MyApp.MyLib.dll'. [C:\Temp\Tags\MyApp\2011-10-27-00-NoBuildVs\src\MyApp.com\MyAppn.csproj]
I get 30 of these errors when I build my proj. I'm building my csproj file from the command line. The proj compiles fine, it's only when it gets to the CopyWebApplicationLegacy task that things screw up. The odd thing: the app runs fine and the dlls that it is trying to copy are present in the target dir in the end. So these errors seem to have no bearing on whether the files end up where they should be or whether the app will behave correctly.
I'd consider just suppressing them, but that seems like it'll bite me later.
My command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "C:\Temp\Tags\MyApp\2011-10-27-00-NoBuildVs\src\MyApp.com\MyApp.csproj" /p:OutDir="C:\Temp\Publish\binOutput\" /p:WebProjectOutputDir="C:\Temp\Publish\staging\MyApp\MyApp_1478" /p:Configuration=Debug
Tried building the solution instead of the csproj and that got the same error.
I'm stumped here. The files aren't being locked (unless they are being locked during the build somehow and released later, but it seems like I'd get a different error). What could be causing this error? I need to get this going so my automated publish can work.
What I see from the error log: source file "bin\Debug\MyApp.MyLib.dll" should be used instead of "bin\MyApp.MyLib.dll" for Debug configuration, IMO.