Building errors with visual studio - c++

I have a solution for a previous c++ project provided to me. When I open the solution in visual studio and try to build, I get the error:
1>------ Build started: Project: Test Proj, Configuration: Release Win32 ------
1>Build started 9/19/2011 8:28:56 PM.
1>InitializeBuildStatus:
1> Touching "Release\Test Proj.unsuccessfulbuild".
1>ClCompile:
1> example1.cpp
1>c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
1> InitShader.cpp
1>c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.85
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I had to change the input linker settings of my project to include glew32d.lib. That fixes it, and it compiles and runs properly.
However, when I alter example1.cpp(even by just adding a comment), I am no longer able to build it and I get this error:
1>------ Build started: Project: Test Proj, Configuration: Release Win32 ------
1>Build started 9/19/2011 8:25:29 PM.
1>InitializeBuildStatus:
1> Creating "Release\Test Proj.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> example1.cpp
1>c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.67
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
glew32d is still being linked so I'm not sure where I'm getting the error and why I can't build

That's not a linker error, it's a compile error.
c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083:...
^^^^^^^^^^^
I bet on line 38 of Angel.h, you're trying to include...
...Cannot open include file: 'GL/glew.h': No such file or directory
^^^^^^^^^^^
...and the compiler can't find the header file.
You need to make sure that the OpenGL header files (whatever folder contains a folder named GL that contains a file called glew.h) are available to the compiler; you can add this folder to the Additional Include Directories in the properties of your C++ project.

Related

Visual Studio Compiling Cl doesn't interpret whitespace?

I'm trying to add CL (MSVC) to my sys env and executable directories, but an error pops up that is seperating the paths by whitespace.
1>------ Build started: Project: ConsoleApplication10, Configuration: Debug x64 ------
1>Program
1>c1xx : fatal error C1083: Cannot open source file: 'C:\Program': No such file or directory
1>Microsoft
1>c1xx : fatal error C1083: Cannot open source file: 'Files\Microsoft': No such file or directory
1>Visual
1>c1xx : fatal error C1083: Cannot open source file: 'Visual': No such file or directory
1>x64
1>c1xx : fatal error C1083: Cannot open source file: 'Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64': No such file or directory
1>ConsoleApplication10.cpp
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
1>Generating Code...
1>Done building project "ConsoleApplication10.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========```

Error C1083: How do I fix my broken Visual Studio compiler?

My Visual Studio always fails to compile any C++ program. I have not tampered or modified the compiler.
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
}
Gives Output:
1>Program
1>c1xx : fatal error C1083: Cannot open source file: 'C:\Program': No such file or directory
1>Files
1>c1xx : fatal error C1083: Cannot open source file: 'Files': No such file or directory
1>Microsoft
1>c1xx : fatal error C1083: Cannot open source file: '(x86)\Microsoft': No such file or directory
1>Visual
1>c1xx : fatal error C1083: Cannot open source file: 'Visual': No such file or directory
1>x64
1>c1xx : fatal error C1083: Cannot open source file: 'Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64': No such file or directory
1>test.cpp
1>Generating Code...
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I think that one of the paths is missing double quotes but I don't know where to fix this.
I suggest that you could check if the following path settings are correct.
Windows Settings->Advanced system settings->Environment Varibles->Path->Environment variable
Visual Studio Project->Properties->VC++ Directories->Include Directories
If it still doesn't work, you could reset the Environment Varibles in Tools->Import and Export Settings->Reset all settings.

fatal error C1083: Cannot open include file: 'iostream'; Also getting error -> No such file or directory and 'stdlib.h'

I keep getting these issues when trying to compile this certain project :
1>------ Build started: Project: X, Configuration: Debug Win32 ------
1>ESPWork.cpp
1>D:\X\test\ESPWork.cpp(1,9): fatal error C1083: Cannot open include file: 'iostream': No such file or directory
1>Source.cpp
1>D:\X\test\Source.cpp(1,9): fatal error C1083: Cannot open include file: 'iostream': No such file or directory
1>MemoryManager.cpp
1>D:\X\test\MemoryManager.cpp(1,9): fatal error C1083: Cannot open include file: 'iostream': No such file or directory
1>DirectXM.cpp
1>D:\MicrosoftDirectXSDK\Include\d3d9.h(37,10): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
1>Generating Code...
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have include directories set to (D:\MicrosoftDirectXSDK\Include)
and library directories set to (D:\MicrosoftDirectXSDK\Lib\x86)
New issue:
1>------ Build started: Project: SAFU_IRAQ, Configuration: Debug Win32 ------
1>DirectXM.cpp
1>D:\Eary\test\MemoryManager.h(7,32): error C2039: 'wstring': is not a member of 'std'
1>D:\Stufff\VC\Tools\MSVC\14.24.28314\include\list(24): message : see declaration of 'std'
1>D:\Eary\test\MemoryManager.h(7,39): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>D:\Eary\test\MemoryManager.h(7,39): error C2143: syntax error: missing ',' before '&'
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Visual Studio cannot find vcvars64.bat when compiling even though it exists

When trying to compile a C++ file in Visual Studio 2019 the compiler gives me this error:
1>------ Build started: Project: ConsoleApplication4, Configuration: Debug Win32 ------
1>Program
1>c1xx : fatal error C1083: Cannot open source file: 'C:\Program': No such file or directory
1>Files
1>c1xx : fatal error C1083: Cannot open source file: 'Files': No such file or directory
1>Microsoft
1>c1xx : fatal error C1083: Cannot open source file: '(x86)\Microsoft': No such file or directory
1>Visual
1>c1xx : fatal error C1083: Cannot open source file: 'Visual': No such file or directory
1>vcvars64.bat
1>c1xx : fatal error C1083: Cannot open source file: 'Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat': No such file or directory
1>ConsoleApplication4.cpp
1>Generating Code...
1>Done building project "ConsoleApplication4.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm assuming that happens because of the spaces causing issues? Any help on how to fix that?
Visual Studio 2019, using the "Local Windows Debugger" for a standard C++ console app. The vcvars64.bat exists.

building cryptopp 5.6.2 with msvc 2010

I am trying to build cryptopp 5.6.2 with msvc 2010. According to Readme.txt file in project's directory, if you want to compile project as a static library that contains all algorithms, you should build cryptest project. So i select this project from solutions and try to build it. But i get this message :
1>------ Build started: Project: cryptest, Configuration: Debug Win32 ------
1>Build started 12/30/2013 9:43:43 PM.
1>InitializeBuildStatus:
1> Touching "Win32\cryptest\Debug\cryptest.unsuccessfulbuild".
1>ClCompile:
1> adhoc.cpp
1>c1xx : fatal error C1083: Cannot open source file: 'adhoc.cpp': No such file or directory
1> bench.cpp
1> bench2.cpp
1> datatest.cpp
1> dlltest.cpp
1> fipsalgt.cpp
1> regtest.cpp
1> test.cpp
1> validat1.cpp
1> validat2.cpp
1> validat3.cpp
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:26.23
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
There is adhoc.cpp.PROTO in project's firectory. I change it's suffix to .cpp and try to build it again. But i get this Message :
1>------ Build started: Project: cryptest, Configuration: Debug Win32 ------
1>Build started 12/30/2013 9:51:24 PM.
1>InitializeBuildStatus:
1> Touching "Win32\cryptest\Debug\cryptest.unsuccessfulbuild".
1>ClCompile:
1> adhoc.cpp
1> bench.cpp
1> bench2.cpp
1> datatest.cpp
1> dlltest.cpp
1> fipsalgt.cpp
1> regtest.cpp
1> test.cpp
1> validat1.cpp
1> validat2.cpp
1> validat3.cpp
1> Generating Code...
1>LINK : fatal error LNK1104: cannot open file 'E:\Utality for Windows\crypto\cryptopp\Win32\Output\Debug\cryptlib.lib'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:27.22
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any solution?
So does that library exist?
E:\Utality for Windows\crypto\cryptopp\Win32\Output\Debug\cryptlib.lib
If not, then you need to build that library from the cryptopp sources (and I am sure it is more files than what your build log is showing).