Release build does not work - error with Eigen library? - c++

When I build my program in debug mode, everything works fine. However, when I switch to release build, I get the following errors. It seems that there is a problem with Eigen. Could anyone please help?
1>------ Build started: Project: qtdemo, Configuration: Release Win32 ------
1> moc_qtdemo.cpp
1>c:\users\documents\visual studio 2012\projects\qtdemo\qtdemo\generatedfiles\release\../../qtdemo.h(6): fatal error C1083: Cannot open include file: 'Eigen/Dense': No such file or directory
1> main.cpp
1>c:\users\documents\visual studio 2012\projects\qtdemo\qtdemo\qtdemo.h(6): fatal error C1083: Cannot open include file: 'Eigen/Dense': No such file or directory
1> qtdemo.cpp
1>c:\users\documents\visual studio 2012\projects\qtdemo\qtdemo\qtdemo.h(6): fatal error C1083: Cannot open include file: 'Eigen/Dense': No such file or directory
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The include directories need to be set for both debug and release mode. (And, more generally, for whichever configuration you support).
This is because you may want different settings for a specific configuration mode. For example, you'd want to link to a debug library for a debug build, or turn optimizations on for a release build, and so on.
This can be done under Visual Studio through Project --> "name of project" properties --> VC++ directories, and selecting in the top bar the configuration you want to change the settings of.
Also note that setting can be changed for all the configurations at the same time by selecting "All configurations", like shown in the following picture:

Related

I cannot open source file clang64.exe and a crtdbg.h Error?

Build started...
1>------ Build started: Project: ConsoleApplication6, Configuration: Debug x64 ------
1>clang64.exe
1>c1xx : fatal error C1083: Cannot open source file: 'C:\msys64\clang64.exe': No such file or directory
1>ConsoleApplication6.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...`enter code here`
1>Done building project "ConsoleApplication6.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Is there a way to not call on msys64? I've already set up all the Windows SDK files, so I don't know what else I'm doing wrong.
I often get this error when I forget to close the executable. Check if it's open. If not, look in the Task Manager. That fixed it when I had this problem

Unreal Engine 4.10.1 can't compile Visual Studio 2015 project

I recently installed the most recent version of UE on my Windows 7 and made a new empty C++ project. After creating the project it gave me an error saying it failed to compile. I opened the project in VS to manually compile it and this is the output I got.
I looked online but got no answers.
EDIT: I use these headers with no issues when compiling non-UE projects.
1>------ Build started: Project: RPG, Configuration: Development_Editor x64 ------
1> Performing 7 actions (2 in parallel)
1> [2/7] Resource PCLaunch.rc
1>C:\Program Files\Epic Games\4.10\Engine\Source\Runtime\Launch\Resources\Windows\PCLaunch.rc(10): fatal error RC1015: cannot open include file 'windows.h'.
1>
1> PCH.RPG.h.cpp
1>C:\Program Files\Epic Games\4.10\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(5): fatal error C1083: Cannot open include file: 'new': No such file or directory
1> [3/7] Resource ModuleVersionResource.rc.inl
1>C:\Program Files\Epic Games\4.10\Engine\Source\Runtime\Core\Resources\Windows\ModuleVersionResource.rc.inl(3): fatal error RC1015: cannot open include file 'windows.h'.
1>
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Jack\Documents\Unreal Projects\RPG\Binaries\Win64\UE4Editor-RPG.dll
1> Total build time: 3.64 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""C:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" RPGEditor Win64 Development "C:\Users\Jack\Documents\Unreal Projects\RPG\RPG.uproject" -rocket -waitmutex -2015" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The part that really confuses me is that it apparently can't open new.h and windows.h though Visual Studio has no problem opening the file when I check where they were included.
After creating an Unreal Engine project you may face errors like:
"fatal error RC1015: cannot open include file 'windows.h' "
"fatal error C1083: Cannot open include file: 'new': No such file or directory".
To fix it open your project (not EU4 project) properties/VC++ Directories.
If you see empty fileds like "Include Directories", "Library Directories" then click on the combo box on the right side and choose "inherit from parent or project defaults".
Then compile the project again.
Images below:
Default project template
Build errors
choose inherit from parent or project defaults

Clan lib error LNK1104: cannot open file 'clanCore-static-mt-debug.lib'?

1>------ Build started: Project: clanlib 2, Configuration: Debug Win32 ------
1>Build started 24-07-2012 16:34:27.
1>InitializeBuildStatus:
1> Touching "C:\Users\Voldy\documents\visual studio 2010\Projects\clanlib 2\clanlib 2\Build\Debug\clanlib 2\clanlib 2.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>LINK : fatal error LNK1104: cannot open file 'clanCore-static-mt-debug.lib'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.16
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This is the error I am getting this error when trying to make a clan lib application. Please help me resolve the prob.
From official documentation, possible causes:
Not enough disk space
File does not exist. For example, you will get this error if you try to use the PGINSTRUMENT parameter to the /LTCG linker option on a machine with a 32-bit operating system.
When specifying libraries in a project's property pages dialog box, library names should be separated by spaces (and not commas).
Incorrect filename or path.
Invalid drive specification.
Insufficient file permissions.
Path for filename expands to more than 260 characters.
If the given file is named LNKn, which is a filename generated by the linker for a temporary file, the directory specified in the TMP environment variable may not exist, or more than one directory is specified for the TMP environment variable. (Only one directory path should be specified for the TMP environment variable.)
If the error message occurs for a library name, and you recently ported the .mak file from a previous Microsoft Visual C++ development system, the library may no longer be valid. Ensure that the library still exists in this circumstance.
Another program may have the file open and the linker cannot write to it.
Incorrect LIB environment variable. For information on how to update the LIB environment variable, see VC++ Directories, Projects, Options Dialog Box. Make sure any directories with libraries you need are listed here.
You should have to include the lib file in the project property.
Project Property-->Linker-->Input-->Additional Dependencies-->clanCore-static-mt-debug.lib
ClanLib uses pragmas under Visual Studio to automatically link required libraries. So if you get that message, it means Visual Studio can't locate the lib files. It probably means you haven't set up the directories where Visual Studio should look for library files correctly.
Detailed explanations how to set this up is located at http://clanlib.org/wiki/VisualStudio2010GlobalIncludes

Creating com library with starting from empty project

.
I found sample called "Creating a COM Server Using a Text Editor" in MSDN.
http://msdn.microsoft.com/en-us/library/2wad1c0e(v=vs.71).aspx
It compiles fine from command promt, but not from Visual Studio IDE.
I decided to move this project to Visual Studio.
I have created new project (File>>New>>Project>>Empty project) and add MyServer.cpp file to "Source Files" and MyIncludes.h to Header Files. I got following error after I tried to build project:
1>------ Build started: Project: Myserver, Configuration: Release Win32 ------
1>Compiling...
1>MyServer.cpp
1>.\MyServer.cpp(26) : warning C4581: deprecated behavior: '"apartment"' replaced with 'apartment' to process attribute
1>Linking...
1> Creating library C:\Myserver\Release\Myserver.lib and object C:\Myserver\Release\Myserver.exp
1>LINK : fatal error LNK1561: entry point must be defined
1>Build log was saved at "file://c:\Myserver\Myserver\Release\BuildLog.htm"
1>Myserver - 1 error(s), 1 warning(s)
========= Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How to solve this problem?
The translation errors told you need a entry function in an EXE module.
you must define a main(...) function as the entry, otherwise is an invalid EXE since there is no startup point.
Simply, you can create an console window project for IDE, or just add main(...) manually as I said.

Build issues with Visual Studio 11

I am building a simple program on VS 11 Professional beta edition.
#include <iostream>
int main(){
std::cout << "Hello World" << std::endl;
}
But I am getting RC errors.
1>------ Build started: Project: Stephen, Configuration: Debug Win32 ------
1>Build started 5/23/2012 8:31:30 PM.
1>InitializeBuildStatus:
1> Touching "Debug\Stephen.unsuccessfulbuild".
1>ClCompile:
1> Source.cpp
1>RC : fatal error RC1106: invalid option: -ologo
1>
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.67
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If I just compile the source file alone (i.e., not building the project), it compiles. I googled on this error but didn't find much useful information. I have seen the compiler and linker properties. No, where -ologo option is seen. I amn't sure where this invalid option is coming from.
I have VS 2005, 2010 installed on my system. Does this has anything to do with this error ? Any help is aprreciated.
Go to project -> Properties -> Configuration Properties -> General. Change the platform toolset to the correct toolset you are using. Or just change Suppress Startup Banner to 'no'.
If you are migrating your sourcecode from 32-bit to 64-bit platform and you encounter this error during build, do the following:
Select your Project on the Solutions explorer.
From menu, select Project->Properties->Configuration Properties->VC++ Directories
On "Executable Directories", check if "$(WindowsSdkDir)\bin" exist -
Check first what is "WindowsSdkDir" by clicking the down arror->edit->click "Macros" button and see where it is pointing...
Usually it is in "C:\Program Files (x86)\Windows Kits\8.1\bin"
Check if there are executable files under "C:\Program Files (x86)\Windows Kits\8.1\bin"
If none, then there could be folders under "C:\Program Files (x86)\Windows Kits\8.1\bin"
Go to "C:\Program Files (x86)\Windows Kits\8.1\bin\x86" and check if "RC.exe" exist
If "RC.exe" exist then go back to Step 1, Step 2.
On "Executable Directories", change "$(WindowsSdkDir)\bin" to "$(WindowsSdkDir)\bin\x86"
Click "Apply" then "Ok" button.
Rebuild your project and that should solve your problem.