Cannot Open Metadata file iostream in C++ - error-handling

I just downloaded Visual Studio 2012 and when I started my preprocessor directive
#using <iostream>
I get an error message saying "Error: cannot open metadata file "iostream". Anyone know what might be causing this issue? Thanks so much!

For C++, you want #include <iostream> instead of #using <iostream>. #Using is a c# thing for the most part.

You typed iosteam instead of iostream

Related

C++ Webcam Capture in VS 2012 - Library Error: "Unable to Start Program"

Trying to capture video from my webcam device using Visual Studio 2012 with C++. My goal is to be able to view live feed from a USB camera for some ROV projects. I found a website (http://www.codeproject.com/Articles/559437/Capturing-video-from-web-camera-on-Windows-and) that has a Visual Studio solution. However, when I compile, I get an error that reads: "Unable to start program. VideoInputVS2012\videoInput\Debug\videoInput.lib". I tried including the library in the solution, but it didn't seem to work. Any suggestions?
What type of project are you building? If it is a static library you will not be able to run it. You may want to check your Project settings for the output target type.
-----------------------Updated Edit--------------------------------------------------
The codeproject code you downloaded has a project that generaters a static .lib file.
You will need to create a another project that references this .lib file in order to use it.
There are actually two downloads that show the .lib class being used.
TestVideoInputVS2012x86.zip - uses the OpenCV framework for presenting live video
The second example is based on the SimpleCapture example from the
Windows SDK (this code -SimpleCaptureVS2012x86.zip, application -
SimpleCaptureVS2012x86-exe.zip).
Here is also an example provided of how to call the videoInput.lib static class:
For using this library it is enough to include videoInput.h and videoInput .lib in your project. This class is made as a singleton which makes managing of resources easy.
//TestvideoInput.cpp
#include "stdafx.h"
#include "videoInput.h"
#pragma comment(lib,"videoInput.lib")
...
The codeproject being referenced and discussed was created by Evgeny Pereguda

Building boost 1.55 with Visual Studio 2013 Express

Well, this question was already raised a while ago: "Building boost with Visual Studio 2013 (Express)".
It seems the questioner was able to do the job. So I followed the instructions by patching the according files, but I'm still not able to compile the serialization library (need for serialization support is the reason why I tried to compile boost myself)
What else could be necessary to get it compiled?
Thanks for any response in advance!
Modify these files :
https://svn.boost.org/trac/boost/attachment/ticket/9410/config_decltype_n3276_new.patch
Then
Add #include <algorithm> to the four files
libs\serialization\src\basic_text_*primitive.cpp
this is more or less the start of the build.log; in total there are 8 Targets skipped:
output deleted - I found a way to compile boost's serialization library - see below

How to use FLTK 1.1 dll in MinGW?

I am trying to compile a project with MinGW that uses the fltk library. Whenever it gets to the file using fltk, it tells me "cannot find -lfltk".
I know it comes down to getting the .dll for the library and where I put it, but I am having a lot of trouble figuring this out. I found two files in the fltk folder named fltk.lib.dsp and fltkdll.dsp. I tried to just put these files in my system32 folder, but that did not work. I'm guessing thats because these are both VC++ 6 project files and not actually .dll and .lib files. I found this article:
http://www.fltk.org/articles.php?L372+I0+TFAQ+P1+Q
but I don't understand what it is saying.
you will need to define the FL_DLL preprocessor symbol to get the correct linkage commands embedded within the FLTK header files.
What does that mean? Do I need to #define something before my includes? How does this sentence translate into code?
If I am not on the right track please tell me. Any help is appreciated.
edit:
Also, I have my PATH variable set to C:\MinGW/bin/. I tried setting the files in there, but that did not work either. I know I have to do something to these .dsp files, but don't know what.
the error message is not related to dll.
it actually says that the linker library named 'libfltk.a' is not found.
so you should have that library first for compiling your program.

Visual C++ compile error C2871 - <namespace> : a namespace with this name does not exist

I am trying to create a ManagedWrapper dll that can be called from an MFC application that will not be compiled using /clr switch. In a header of my test MFC, I have declared the following:
#import "ManagedProxy.tlb"
using namespace ManagedProxy;
When I try to compile the test MFC application, I get error C2871: 'ManagedProxy' : a namespace with this name does not exist. I am sure this has worked as recently as yesterday. If I specify a wrong tlb file name, I get compile error C1083, which indicates to me that the tlb file is being loaded correctly.
Why is Visual Studio now complaining and why did it work before?
Addition:
I just found out that my proxy stopped working after I changed the namespace to ManagedProxy. I have recompiled the Managed project, and the native application has as an Additional Include Path, the Debug folder of the managed project, so it should be referencing the latest tlb but it is not. I tried an absolute path to the tlb, cleaned and rebuilt project with no luck.
Why is the tlb not the namespace change?
Addition
Used Object Browser to see what is in TLB and the namespace ManagedProxy is somehow renamed to something else. I am also missing a couple of interfaces although they are marked with ComVisible(true).
Someone please help....
TIA.
You can rename the namespace when you import.
#import "ManagedProxy.tlb" rename_namespace("ManagedProxy")
The interfaces not showing up are likely not marked public.

How do I fix fatal error C1113: #using failed on 'Mylib.lib'

I have a project which uses C++/CLI to implement a GUI and some background processing to talk to a sensor. I've got that all working and a lot of the comms stuff which we use to communicate the the sensor sits in a .dll. The problem is that I'd like to combine the library into the main executable to avoid having to worry about distributing .dlls.
I've got a demo project which works fine using a .lib but when I try and switch the mani code body to produce a .lib instead of .dll I get the following error:
1>------ Build started: Project: MyTool, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>.\stdafx.cpp : fatal error C1113: #using failed on 'c:\projects\MyTool\debug\MyLib.lib'
A bit of googling suggests this happens when you've not got the MSIL switch applied, but it's definitely in there in the library project.
I have a mixture of managed and unmanaged code in both my demo project and the real thing so I'm really struggling to see what the problem is here.
Any suggestions would be very gratefully received!
I am guessing a bit, but I suspect the "MyTool" project has the "MyLib" project as one of its "references" ("Project" menu >> Properties >> Common Properties >> References).
When you change the type of the MyLib project to a LIB instead of a DLL, you need to remove "MyLib" from the project references. You then update the project dependencies of the solution ("Project" menu >> "Project Dependencies...") so that MyTool depends on MyLib.
If you are linking to a mixed mode (managed/native) DLL you may get this error. Which you shouldn't if the project uses CLR even if one of the source files doesn't. But anyway, if that is the case, then try removing the reference from Project|Properties|Common Properties|References and then re-adding it.
I also ran into this. The reason it was failing was because I was compiling my native/managed C++ DLL to target .NET 4.0. And the DLL I was #using was a .NET 2.0 DLL. As such it was failing, even though the paths and file names lined up perfectly. In this case the error message was absolutely of no help at all.
I solve it by updating the independent DLL to .NET 4.0. So that both assemblies were using the same .NET framework.