I am getting a UWP App Compiler Error ILT0038 in x86 Release mode but not Debug mode - debugging

I have a UWP app that compiles and runs fine in debug mode, but when I compile in x86 release mode, I get the following error:
Severity Code Description Project File Line Source
Error ILT0038: 'Microsoft.CodeAnalysis.Formatting.AutoFormattingOptions' is a value type with a default constructor. Value types with default constructors are not currently supported. Consider using an explicit initialization function instead.
I do have Microsoft.CodeAnalysis analyzers installed, but they should have no effect while compiling, right?
Has anyone seen this before or have any idea how to resolve? Any help appreciated.

Related

Resource-related error condition in Windows Forms C++ application

I am working on a legacy Windows Forms application using VS 2008 under C++ and face a weird problem. The form uses an ImageList object, to which two bitmap images have been added. At run-time, I get the following error in Debug mode (in the Release mode, the application just doens't launch):
An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture or the neutral culture.
Make sure "MyApp.Form1.resources" was correctly embedded or linked into assembly "MyApp" at compile time,
or that all the satellite assemblies required are loadable and fully signed.
The crash occurs at the first line of this block:
this->imageList1->ImageStream = (__try_cast<System::Windows::Forms::ImageListStreamer* >(resources->GetObject(S"imageList1.ImageStream")));
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
this->imageList1->Images->SetKeyName(0, S"Nok32.png");
this->imageList1->Images->SetKeyName(1, S"Ok32.png");
This is pretty puzzling, because I copied the application from an existing one which works fine. I just changed the namespaces. And if I remove the two images from the list, the application works.
I found several posts on forums about this or similar problems, but none could really help me. I don't think that Visual Studio can be blamed. I tried with frameworks 2.0 and 3.0, to no avail. Fully comparing the sources of both applications, I can't see a significant difference.
Any hint ?
Solved: there was an old namespace left in the project file (.vcproj) !

ros::init(...) throws an error - Windows roscpp

I'm trying to use ros in cpp with Visual Studio 2012. I wrote the publisher and subscriber tutorial (http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29) and first, I configure the project as says in the guide (http://wiki.ros.org/win_ros/hydro/Msvc%20SDK%20Projects).
Then i compiled an linked the publisher, but when I tried to run it, ros::init(argc,argv,"talker") throws an exception... The console says that I ROS_MASTER_URI is not defined but I've got it defined
There are 2 images here:
https://www.dropbox.com/s/o12m0l38gaxiugi/error1.png -
https://www.dropbox.com/s/ocdmf0wj6rj0962/error.png
Can anyone helps me?
Thanks in advance
So, I had the same issue, although I didn't set the ROS_MASTER_URI globally.
I managed to get around this specific issue by adding
ROS_MASTER_URI=http://localhost:11311
to the debugging environment variables (Project->Properties->Configuration Properties->Debugging->Environment).
However, after implementing the above I got an uncaught exception (Unhandled exception at 0x768bc41f in ros_demo.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0028f0e4..).
That went away when I built, compiled and ran the project in release mode (which matched my ROS SDK build).
I got the idea for the release/debug build from here:
xstring isn't an OSG specific object, so the error is elsewhere in the
3rd party dependency chain. As I know nothing about your OS and
software setup I can't speculate what this might be.
In general though this type of error could well be a linking issue -
for instance Visual Studio is hopeless at handling different libs
being built debug and release and will crash randomly.
That was fun to discover..

IAR directive for Simulator

I'm using IAR EWARM 5.4 , I wondered if there is a directive to show the compiler in Simulator mode.
For example, I want a part of my code to be only compiled in Simulator mode but will be ignored in target mode.
Thanks,
The compiler don't know if the end result will be executed on the simulator or on the target hardware.
However, you can always defined your own preprocessor symbol, say MY_SIMULATOR, when using the simulator. Your code could then check if it present using #ifdef MY_SIMULATOR.
Update: If you would like to check the difference between the Debug and Release modes, you can check the symbol NDEBUG. It is defined in Release mode.

Access violation when compiling in debug

I'm trying to profile a C++ project in Embarcadero RAD Studio 2010. To do this I wanted to use AQTime, but I'm running into a bit of a problem.
I can compile and run the application in release mode. But when I compile in debug mode, using the settings mentioned at http://smartbear.com/support/viewarticle/18053/, I get an access violation.
... faulted with message: 'access
violation at 0x062324bd: read of
address 0x62324bd'. Process stopped.
Use Step or Run to continue.
It seems to come when I load a bunch of dll's at the startup. But since it goes well in release mode I can't seem to figure out what could be the cause.
When the access violation occurs I get thrown out into assembly and that isn't one of the languages I'm fluent in ;)
EDIT : When scanning the .exe with Dependency Walker I get a message saying that the following files can't be found
CC32100MT.DLL
INET140.BPL
RTL140.BPL
VCL140.BPL
IESHIMS.DLL
Could this be the problem somehow? Are these debugspecific or is Dependency Walker not giving me correct information? The same files are said to be missing when I try a release compiled version to.
I'm running on Windows 7 x64, if that could be part of the issue. I have had problems before with the symlink-look-alike (user/AppData/Local...) that MS used for some folders. Notably when I ran an apache server and the htdocs folder actually wasn't located where the server thought it was (and where it appeared to be) :)
Have you tried disabling dynamic rtl which can be found in the C++ builder linker options pane?

OpenCV_HelloWorld project in VC++ 2010 Runtime Error:

I set up the environment according to this tutorial:
http://opencv.willowgarage.com/wiki/VisualC%2B%2B_VS2010
However the picture they want you to use is no longer there, so I just saved the supplied screen shot with the same name as the original file.
Builds fine, Begins to run but then I get a runtime error
Here is the runtime error:
OpenCV_HelloWorld.exe - Application Error : The application was unable to start correctly (0xc0150002). Click OK to close the application.
I looked in Event Viewer and found that it also set off a another error but did not announce
Here is the unannounced error:
Activation context generation failed for "C:\OpenCV2.1\bin\cxcore210d.dll". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.
As you can see it says to use sxstrace.exe however I don't appear to have that program. After a quick Google I read that the program was included in the Microsoft Windows Platform SDK, so I'm downloading the most relevant version (windows 7 version for c# and .net) and installing that to follow up on that, I'll post what I find as it comes.
Any help is very much appreciated
Unexpectedly the project builds and runs now. The only modifications made were removing spaces in the c++ directory and linker options from the tutorial. External changes were the completed installation of the windows platform SDK, however OpenCV has no dependencies with windows platform sdk. I am unsure how it was resolved, but it's no longer a problem.

Resources