TUIO #ifndef WIN32 gets ignored - winapi

I am using the TUIO framework in Visual Studio 2013. When I build, the error 'pthread.h no such file or directory' appears. It seems TUIO runs on Linux and Windows and the #ifndef WIN32 checks for the operating system. While Visual seems to get it right it still gives the error when I build.
See image below:

Related

Visual studio loses assembly reference

Running Visual Studio 2019 Community with Unity 2020, I regularly get loss of assembly connections.
Say asm A refers to asm B and C, opening a script from asm A could show errors for all usage of asm B while still being ok with asm C code.
One occurance is opening a text file (json), it would open notepad instead of VS and shows the loss of connection in VS on opened files.
It also displays the warning in Visual studio about the project not being generated from Unity.
I tried to fix that with linking the exe from Edit/Preferences/Editor but it keeps coming as it has been explained in other threads.
The solution I have to use is to add/remove an assembly reference in the asm inspector to trigger a reload. Then it will be fine for a while until it shows up again.
I already had the issue with VS 2017 and hoped the update to 2019 would fix it.

Multi-byte character set is not found in VS2015 VC++ Redistributables

I have created a simple plane MFC application using VS 2015 and if i try to run the exe in another windows 10 machine where VC++ 2015 redistributables are present, then exe is not getting launch.
If i change it to Unicode then it works fine in another machine where VC++ 2015 redistributables are present, its failing specific MBCS.
in the Event viewer i noticed below error,
"Application popup: MFCApplication2.exe - System Error : The code execution cannot proceed because mfc140.dll was not found. Reinstalling the program may fix this problem."
i checked the mfc140.dll its present in system 32 folder, also i placed the same dll at the exe level and run. again new error noticed in event viewer like
Application popup: MFCApplication2.exe - Application Error : The application was unable to start correctly (0xc000007b). Click OK to close the application.
For testing purpose, i made the application as static linkage, in that case its working fine in another machine, but for dynamic linkage the exe is not launching in another machine.
Here are the list of VC++ Redistributes present in the windows 10 machine.
How we can fix the issue?
Edit,
Here i found MBCS installer for 2013 (http://go.microsoft.com/?linkid=9832071). But if i run i'm seeing below error, why we require VS for running MBCS i'm not understanding.
thanks

PDB remains open after debugging (Windows 10, Visual Studio)

Our previous development systems used Windows XP and Windows 7. Debugging C++ DLLs from Visual Studio worked great.
A recent move to Windows 10 has resulted in an annoying problem. We can debug once (using F5), but the 2nd time results in a linker error:
MyProg fatal error LNK1201: error writing to program database 'MyProg.pdb'
Trying to delete the .pdb manually in Explorer while Visual Studio is still open results in the error:
The action can't be completed because the file is open in devenv.exe
It doesn't matter whether you hit a breakpoint or not. Just start debugging once results in the problem. Re-starting Visual Studio resolves the issue (in the sense that you can debug once, but then you get the problem again).
If relevant:
x86 Visual Studio 2003.NET
targeting another x86 application
x64 Windows 10 Pro v1803
After hunting around for several hours some related, but unanswered, questions were found. Following suggestions in this MSDN article, along with some debugging of my own, this solution works:
Download FreePDB, a script written by MSDN user Toni76 (thanks Toni!)
Copy this script to a local folder (say C:\Apps\FreeDPB)
Download the latest version of SysInternals tool Handle (currently v4.21)
Copy handle.exe to C:\Apps\FreeDPB
NB! From the command line, run handle /? once. This is to agree the EULA. The script will not work if you skip this step!
Open Visual Studio, then Project > Properties > Build Events > Pre-Build Event
Set Command Line to C:\Apps\FreeDPB\freepdb $(ProjectName)
Set Description to Delete lock on PDB
...and now you don't need to restart Visual Studio to debug a 2nd time!
From comments, this works with multiple versions of Visual Studio on multiple versions of Windows.
Update
A more radical solution is described here which involves replacing a core Visual Studio DLL (NatDbgDE.dll). This solution only works for Visual Studio 2003 SP1, though.
In my case it was due to "Process Explorer" program, which was open alongside with my Visual Studio(I used it to check some properties of the exe I've created). After closing it problem solved.

Exe builds from Visual Studio also open a terminal

When building and running an OpenGL Solution, it opens the OpenGl window and a terminal. My question is how do I set it so that this terminal appear in my debug build but not my final build?
I'm using Visual Studio 2017.
Set the Debug configuration to use the CONSOLE subsystem and WINDOWS for Release.
Don't forget to adapt your entry-point (main() vs WinMain()) if your application framework (if any) doesn't handle that internally. SDL2 for example handles that for you via some #ifdef logic.

debugging cuda files in visual studio

i have a cpp function (function.cpp") which i "mex"-ed. then i open the function.cpp file in visual studio and attach visual studio to a running matlab process.
when i call the function in matlab i am able to set breakpoints in the function.cpp file and step through it observing the variables.
The debugging process breaks down when i change the function to a cuda file (function.cu). Following the process described above i am still able to stop within function.cu but i cannot see any variables. when i try to "watch" a variable it says "Error symbol .. not found"
i have nsight installed in visual studio. question: how can i observe my variables in the file function.cu in the debug mode as i do for the function.cpp file. Is this possible ?
Note that the function.cu is not in a project. it is just a standalone file with cpp code of a function (say somefunction(){}). for debugging purpose i am opening it up in visual studio. i am compiling the function.cu file in matlab using "nvmex -g wrapper.cu" the wrapper.cu is a matlab mexfunction wrapper which makes calls to somefunction() written inside function.cu
You're using the VS debugger which is a host debugger, so it doesn't know how to debug device programs. To debug device code in Windows you should look at Parallel Nsight Visual Studio Edition.
You can search the docs for a guide to attaching to a running process, for the current release (2.2) the specific page is here.
You attached VS in, but stopped in function 'main'. Looks like you are still hitting the CPU code. When you follow Tom's suggestion to attach the debugger, have you choosed "NVIDIA GPU Debugger" in the Transport dropdown?
To debug any cuda-code you'll need a gpu on which no desktop environment/server is running. For windows that means, that you need a second gpu. I'm not to 100% sure if it has to be a nvida gpu, too. Than you will be able to bedubg your code.
Under linux you're able to debug with only one gpu because you can shut down the x-server and debug with cuda-gdb per command line.
Further informations will give you the cuda-gdb manual

Resources