having trouble compiling old VC++ 6 c++ code - c++

I am trying to compile MSVC 6 C++ code using MSVC 2008 Express on 64 bit windows 7. When I tried to open the .sln file, I get the error "project file dpcwebcfx.vproj could not be loaded". I don't have the .vproj file, but I do have dpcwebcfx.dsw file. So in the .sln file I changed
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dpcwebcfx", "dpcwebcfx.vcproj", "{355F3EB4-3B37-4272-B454-340E9B3BD9D3}"
to
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dpcwebcfx", "dpcwebcfx.dsw", "{355F3EB4-3B37-4272-B454-340E9B3BD9D3}"
Now I get an error converting the dsw file: Cannot load the project due to a corrupt project file. What should I do? Am I missing a file so that I can't open this project?

Related

trouble with setting up OpenCV 4.1.1 on Visual "Microsoft studio 2019" ? (Illegal Instruction.)

I am trying to use Open Cv on Visual studio to write c++ code. I tried a lot of ways to reach this goal for 3 days. here is what I did in these days:
**1.download and extract open cv 4.1.1 (C:\opencv).
2.download and install Visual Microsoft Studio 2019.
3.copy the bin directory of open cv to the system variable path.
(in my case:"C:\opencv\build\x64\vc15\bin;C:\opencv\build" )
4.add include folder to the project's properties(my project name is opencv):
(properties->configuration properties ->edite include directories value to : (C:\opencv\build\include )
5.edite library directory to ( C:\opencv\build\x64\vc15\lib)
6.then in linker menu->inpute->adittional dependancies -> edit its value to "opencv_world411d.lib" .**
now I write a simple code to test open cv:
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main() {
Mat im = imread("cameraman.tiff", 0);
}
this code built correctly but when I run it It doesn't work with error :
Unhandled exception at 0x000007FEBA8D3AE2 (opencv_world411d.dll) in opencv.exe: 0xC000001D: Illegal Instruction.
gfluidimgproc_func.simd.hpp not found
You need to find gfluidimgproc_func.simd.hpp to view the source for the current call stack frame
"I added screenshot"
error report
also, I tried Cmake too.
first, configure and generate OpenCV's source file.
second, open the project in Microsoft visual studio and build all
then I build the install folder.all has been done successfully.
questions:
1.how can I fix this error to run OpenCV on Microsoft visual studio 2019 ?
does Microsoft visual studio 2019 support open cv 4.1.1? have you tried it?
tanks for your attention.
my operation system is: windows 7
intel core i5
>>4.add include folder to the project's properties(my project name is opencv): (properties->configuration properties ->edite include directories value to : (C:\opencv\build\x64 )
This is wrong, you should add C:\opencv\build\include and C:\opencv\build\include\opencv2 to the include directories in your case.
I test your case on My PC, I use VS2019 and OpenCV4.1.1 to make a test. Your other steps are correct. This step will cause the header file not to be found, so the corresponding function can not be identified and will be displayed as illegal instructions.
I have the same problem and from what I understand it is because we compile in x64 bit and execute it on an old CPU which doesn't support sse3 instructions (in my case an old i5 750). I believe your only solution is to recompile OpenCV either in 32bit or in 64bit with sse3 disabled.

Error: Cannot open include file: 'MQTTAsync.h': No such file or directory

OS -Windows 10 x64
Library mqtt
Microsoft Visual Studio Community 2017 Version 15.9.15
Programming Language - C++17
Installed paho-mqtt paho-mqttpp3 paho-mqttpp3[ssl] using vcpkg
I am creating a c++ program using mqtt.
But whenever I am using below given header
#include <mqtt/async_client.h>
It is giving following error
d:\vcpkg\installed\x64-windows\include\mqtt\async_client.h(27): fatal error C1083: Cannot open include file: 'MQTTAsync.h': No such file or directory
But MQTTAsync.h file is available on the given location
D:\vcpkg\installed\x64-windows\include\paho-mqtt
I had followed below link by creating new console project
https://github.com/Microsoft/vcpkg/issues/1848
Still issue is not getting resolved
Verify the correct name in your vcpkg-directory.
In my case that would be C:\Users\USERNAME\vcpkg\installed\x64-windows\include\paho-mqtt
Here you will see that the header file you are looking for is actually called MQTTAsync.h
To add it in your project you will have to change your inlcude to #include <paho-mqtt/MQTTAsync.h>

How to fix Cannot open source file: 'seal/util/config.h'

I am currently using VS studio 2019 and cloned from GIT MicrosoftSEAL using Visual Studio i am having problems making it run.
I already downloaded C++ packages along with SDK 10.0.16299.0 then retargetted the whole projects but still getting the 34 errors (1 E196 and 33 C0183) from a file called mscv.h which has the include line underlined
// Read in config.h
#include "seal/util/config.h"
Errors:
Error (active) E1696 cannot open source file "seal/util/config.h"
Error C1083 Cannot open include file: 'seal/util/config.h': No such file or directory

Visual Studio C++ cannot open some headers I didn't deliberately include

today I wanted to start learning C++.
However I keep getting these errors:
Cannot open source file "stdio.h"
Cannot open source file "tchar.h"
Cannot open source file "SDKDDKver.h"
However, I even get these in a default empty win32 console project.
Does anyone know how to fix this?
OS: windows 10
My default code looks like this:
// HelloWorld.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main()
{
return 0;
}
The errors are:
Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "stdio.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\stdafx.h 10
Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "tchar.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\stdafx.h 11
Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "SDKDDKVer.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\targetver.h 8
Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "stdio.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\stdafx.h 10
In the OUTPUT window:
1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
EDIT:
I believe I have C++ installed, cause first when I went to
file > new > project > Visual C++
It would only show me "Install ... for C++", So I installed one of the first options (don't remember which one it was) and after installing it allowed me to create projects.
Check your stdafx.h contents. Headers can be included transitively. In particular, the three ehaders you quote are in the VC++ stdafx.h for new projects. You can simply remove them if you're programming C++.
(It says something about Microsoft's struggle to choose between C and C++ : They don't support C99, but they default to a C header instead of C++. Not even <cstdio>. )

Why won't my generated .sln file open in Visual Studio 2010?

I'm dealing with a fairly large C++ code base. The code base is normally intended to be compiled under Linux, using custom build scripts and makefiles. I'm porting the code into Visual Studio, which as anyone who's used Visual Studio would agree, is a pain to do manually.
My own looking has been kind of fruitless, so I started writing my own utility in Qt to analyze the codebase and generate a solution file and accompanying .vcxproj files. I've been using the QUuid class to generate GUIDs for each of the projects, and I'm using QTextStream to write the .sln file.
Now, here's the problem: When I open the generated .sln file, I see the following errors.
I'm currently trying to generate a solution that I've already manually created within the Visual Studio IDE. I've compared my generated .sln file against the the one Visual Studio created, and apart from the projects appearing in a different order and the GUIDs not matching (obviously), I can't spot a difference. I'm including a simplifed example of my problem here.
Visual Studio generated this:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mylib", "mylib\mylib.vcxproj", "{35BAFEEE-35FA-4313-AF67-AF8AB7458451}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35BAFEEE-35FA-4313-AF67-AF8AB7458451}.Debug|Win32.ActiveCfg = Debug|Win32
{35BAFEEE-35FA-4313-AF67-AF8AB7458451}.Debug|Win32.Build.0 = Debug|Win32
{35BAFEEE-35FA-4313-AF67-AF8AB7458451}.Release|Win32.ActiveCfg = Release|Win32
{35BAFEEE-35FA-4313-AF67-AF8AB7458451}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
And I generated this:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mylib", "mylib\mylib.vcxproj", "{A09FDB84-49CD-4C14-9D7D-D813D2D905EF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A09FDB84-49CD-4C14-9D7D-D813D2D905EF}.Debug|Win32.ActiveCfg = Debug|Win32
{A09FDB84-49CD-4C14-9D7D-D813D2D905EF}.Debug|Win32.Build.0 = Debug|Win32
{A09FDB84-49CD-4C14-9D7D-D813D2D905EF}.Release|Win32.ActiveCfg = Release|Win32
{A09FDB84-49CD-4C14-9D7D-D813D2D905EF}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Here are my questions:
What do these specifc error messages mean?
Is there any way I can get more specific information on what's wrong with the .sln file?
Is there something wrong with the GUIDs I'm generating? Should I be using the Visual Studio tool to create GUIDs?
Is there some metadata or other invisible special sauce in the file that I'm missing?
I'm pretty sure the issue isn't with text encoding--I used notepad to create a UTF-8 version of the .sln and tried opening that instead.
In light of everything, it seems like my GUIDs are causing the issue--though I'm not sure how or why.
Update
The only major difference I noticed between these files was the file size. The two files differ by exactly 3 bytes, but I couldn't see anything in the file using my text editor. However, an article by Joel Spolsky got me thinking. There ain't no such thing as plain text--everything's just a representation of 1's and 0's, after all.
I opened up the two files in a hex editor, and presto, I found the 3 bytes at the start of the Microsoft-generated file! (0xEF, 0xBB, 0xBF). These three bytes also appear in a Visual Studio 2008 solution I had lying around on a different machine. I could probably write my code to slip these bytes into the file before I start writing the solution, but that still begs the question:
What the heck are these bytes for, and why is Microsoft using them?
What you are contemplating is a UTF-8 byte order mark.
It is used to indicate that the file is UTF-8 encoded, and it is supposed to be rendered as a blank, zero width space. If you have the choice, please don't use it -- it makes the file more difficult to read with standard text editors.
Opening the file with notepad and saving it as UTF-8 encoded text will add those three bytes for you. But again, don't use the BOM on files which are meant to be portably read.
Debug Visual Studio with Visual Studio:
Before opening your generated solution with Visual Studio, open another instance of Visual Studio, go to Debug->Exceptions and check all the check boxes, then go to Debug->Attach to Process... and attach to devenv.exe. Now open the solution in the other VS, and you'll get a break and a call stack which might give you more information.
To add to the answer I accepted, in the case of Qt, I made use of the following method in the QTextStream object I was using to write the solution file:
void QTextStream::setGenerateByteOrderMark ( bool generate )
Syntax is like so:
QFile fileHandle("mylib.sln");
QTextStream fileStream(&fileHandle);
// ...file open and error handling goes here...
fileStream.setGenerateByteOrderMark(true);
fileStream << "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n";
//etc, etc
This will make sure that your file has the Byte Order Mark, which in this specific case, Visual Studio needs in order to open the file.