I'm trying to develop C++ code in VS Code on a mac. I have no problems building and debugging. However, my editor is full of red ink. Is there a way to fix my editor so it is as smart as the compiler?
Here's a simple example: https://github.com/TradeIdeasPhilip/compress/tree/master/mac-os/eight. I can open this folder in VS code and build and run, but the editor is ugly.
One of the first error messages is on line 22 of EightShared.C:
const std::string preloadContents = "\xdc\xe4\xeb\xf1\xf6\xfa\xfd\xff";
This should be very straightforward. It's a string constant. I'm importing <string> through another header file. (And adding directly to the top of this file did not make a difference.) But VS code marks the first : in red and when I hover over it I see expected a ; and when I ask it to help me, it offers to disable the red squiggles.
The editor also complains about the class keyword on line 31 even though it accepts classes in other files.
The editor also complains about most (but not all) references to types like uint32_t even though I #include <stdint.h> and that works without any red ink. Here's an example from EightShared.h
Those are just a couple of samples. My editor is filled with red marks.
I'm using Microsoft's C++ extensions for VS Code. I'm guessing that one of these needs to be configured better.
Any thoughts on how to get rid of all of these red marks? Maybe a sample of a working config file or a suggestion of what I'm doing wrong? Thanks.
I eventually found a problem in my .vscode/c_cpp_properties.json file. I removed "/Library/Developer/CommandLineTools/usr/include/c++/v1" from the "includePath". Then intellisense started working again.
I have no idea how that line got into that file. I certainly didn't type it.
The change in GitHub.
Related
I'm trying to debug a program in Visual Studio for which I have the symbols, but not the source code (it's a Unity game, the source in question is for the UnityPlayer.dll. I do have the source for the actual exe file).
The symbols load correctly, I can break into the debugger and can see call stacks with function names, as I expect to.
However, when I try to add a function breakpoint, it does not work: the breakpoint gets added, but it shows a little error icon in the Breakpoint window, and it's never hit.
If I double-click on a stack frame, I can get to the disassembly window, and the "Address" bar correctly shows the function name. However, if I try to enter any symbol name in the bar - including just copying the one it's already showing - I get an error message saying "identifier "whatever" is undefined". It's as if some part of Visual Studio is not aware of the loaded symbols.
One suspicious thing I noticed is that in the call stack window, all frames not in the actual exe file are shown with the "Unknown" language. I have no idea what is causing this.
Here's a picture to hopefully make this a little clearer:
What can I do to fix this, or at least work around the issue somehow? I've encountered this on VS 2017 and tried updating it to the latest version, and installing VS 2019, but nothing helped.
Notice in the names it's showing you, you get the parameter types too. Like, it's showing you FMOD_OS_Time_Sleep(unsigned int) and not just FMOD_OS_Time_Sleep. This is because the name is mangled, random looking characters are added on either side of the name to encode how many parameters it takes, and what types those parameters are.
One possibility is that it's expecting you to put in the mangled representation of the name. You can also try putting in the name exactly as it appears in the call stack, I would try both with UnityPlayer.dll! and without. Failing that, run strings on the dll to get the mangled representation of the function name and try that.
I am struggling with getting VS2015 intellisense to work for my requirejs based app.
I followed this article http://blogs.msdn.com/b/visualstudio/archive/2015/04/20/using-requirejs-with-visual-studio.aspx plus some assorted tips from various forums.
I have now gotten so far as to actually make VS realise there are script loader calls in my files.
In the output from the Javascript Language Service the first line indicates that require.config.js has been loaded.
However. As soon as I start typing in one of my module files, the output window is filled with lines like this:
File C:\repository\...\invoices.js contains a script loader file reference
(url = ../services/formvalidator.js, type = text/javascript) that will be
ignored because the upper limit (50) of references that can be added via
script loaders has been reached.
...and intellisense just gives me "Intellisense was unable to determine an accurate completion list for this expression" on all referenced modules.
What do I do now? Surely the whole point of using something like requirejs is to split your code up into separate module files. But if some limit is reached, and no intellisense can be loaded, it seems useless...
Can I change this limit?
Or is something else wrong?
Any suggestions on what to try next?
Cheers!
Kim
I have a coworker who needs to have multiple versions of LabVIEW on his computer. He has a bad habit of opening LV2010 code in LV2013. LabVIEW doesn't warn that you are about to change all of the code to a new version of LabVIEW, and this breaks the code running on a test system on the production floor.
Here is my question: does anyone know of any kind of hack or legitimate method of changing the windows title bar for a single application? I would like to be able to change the color of the title bar only on LabVIEW 2013 from blue to red or something.
If this isn't possible, does anyone have an idea of how to distinguish one application from another that looks almost identical?
Thanks for any advice you have to give.
Well, the good news is that LabVIEW 2014 on will have the version number in their icon. That doesn't help your situation much, though. I'm not sure about changing the title bar, but I think I can help with your second question.
The icons for those versions are indistinguishable, however, the mass compile LabVIEW does when you open a project from an older version is a dead giveaway. You know LabVIEW is performing a mass compile if, while the project is loading, "Compiling:" appears where "Loading:" normally does. Close out of LabVIEW without saving and open the right version of LabVIEW. If he still goofs, there's always reverting in whatever version control software you're (hopefully) using, and you can always save back to older versions in LabVIEW itself.
I currently have four (older) versions installed to support projects that are under warranty. One trick I've found to be helpful is to put a .txt document in the same directory I save my .lvproj with the LabVIEW version as the title. For example, if the code is written in LabVIEW 2012 I include a text document called LV2012.txt in my _Project folder. Not a foolproof plan, but it has definitely made me double check my open version of LabVIEW before double-clicking.
I would suggest to use get VI version property described here: http://digital.ni.com/public.nsf/allkb/0C72D335AA87DD6486256FC40069C17F
Than using version information change you title bar text or transparency(I am not sure about color) or other FP component using VI ref property node.
This is a pretty niche question, so I am not expecting a huge response...
Basically, I am learning how to use the UDK by following some tutorials, namely this one:
http://forums.epicgames.com/showthread.php?p=27043379#post27043379
So far everything is going pretty well. The only real hangup I've had is getting everything to work in Visual Studio 2005 using this nFringe plugin. For a long time, couldn't get them to work at all. I've gotten into two or three chapters of the tutorial, and I've managed to use Visual Studio to edit the code, but I can't build the scripts within VS; I have to go to UDK Frontend to do that. And worse still, I can only really use Log commands in the unrealscripts to debug anything.
So my question is this: is it even possible to configure these tools in a way that I can put breakpoints in VS and have them be caught when I test the game? I feel as though I don't have something setup correctly.
Yes it is possible. Here are some info which might be useful to you.
First, both your .sln and your .ucproj files must be located in Development/src. Then, under visual studio, right-click your project (.ucproj file in the solution explorer) and open its properties.
You must set, under the General tab:
Target Game: UnrealEngine 3 Mod
UCC Path: ....\Binaries\Win32\UDK.exe
Reference Source Path: ..\Src
Under the Build tab:
check "Build debug scripts"
Under the Debug tab:
Start Game Executable: ....\Binaries\Win32\UDK.exe
Load map at startup: the name of your startup map, without path nor extension
Start with the specified game type: put your GameInfo class used for your mod, ie. MyMod.MyGameInfo
Disable startup movies can be checked to gain time at launch
Enable unpublished mods must be checked.
In your command line, the parameter -vadebug specifies that the breakpoints will be enabled.
After that, you must be able to build your script from Visual, and launch your game by pressing F5.
Breakpoints should work but you can't put them on a variable declaration, you have to put them on a function call, an assignment or a condition statement.
Hope this will help.
I havnt tried using breakpoints yet but I know its possable to build with nfringe and visual studio . You need to add a line to the
udk game / config / udk engine .ini
search for
editpackages
exactly like that , then youll see a block like this
EditPackagesInPath=....\Development\Src
EditPackages=Core
EditPackages=Engine
EditPackages=GFxUI
EditPackages=GameFramework
EditPackages=UnrealEd
EditPackages=GFxUIEditor
EditPackages=IpDrv
EditPackages=OnlineSubsystemPC
EditPackages=OnlineSubsystemGameSpy
EditPackages=OnlineSubsystemLive
EditPackages=OnlineSubsystemSteamworks
then add your own line pointing to a folder named what ever you want but make sure it has a folder in it named Classes and it has the uc files you wnat to compile in it
ModEditPackages=MyTestProject
if you used that line then you are tellign udk you have a folder named
MyTestProject
located in your development/src folder and you want it to compile everything in there
I have some C code for an ARM926 target. I am trying to debug it using "Arm Xtended Debugger" (AXD). The main() of this code, takes 14 command line arguments which are mentioned in the code warrior project settings at proper place and behavior of the code is as expected.
But when I try to use the same AXF (Arm eXecutable Format file) file and try to do source level debugging using the RVDEBUG by changing the settings of the Codewarrior project, and start debugging, then the argc value is 1. Then the behavior of the code is unexpected.
When I select RVDEBUG in code warrior settings I give the same options as I used during AXD debug session.
So my question is:
I am using the same AXD for both the debugging sessions(AXD and RVDEBUG), why are they behaving differently? They should behave the same.
I don't use CodeWarrior but I know AXD and RVD: I remember Code Warrior can invoke AXD with the suitable arguments for the image, and so on. I don't know if Code Warrior can invoke RVD as well. So I suppose you run RVD yourself, outside any Code Warrior menu, don't you?
Then you just have to add the arguments in the dedicated input box at the bottom of the Load Image menu.
If this still does not work, I suggest you have a look at the semihosting options (they're rather in the connections options of RVD than in Code Warrior's).
Good luck!