Summary: I'm trying to compile a NVIDIA SDK app in Visual Studio 2012 on Windows 8 and I get the error message: FXC : error X3501: 'main': entrypoint not found. I'm new to Windows programming and trying to figure out what this means.
Details:
I'm trying to compile the Multi-View Soft Shadows NVIDIA SDK app. After downloading it I had a vcproj file. I opened this in Visual Studio 2012 on Windows 8 and had some warnings during the conversion but it seemed to open the project correctly.
However, when I build the project I get the following error: FXC : error X3501: 'main': entrypoint not found.
At first I thought this might be because there is no main function in the application. But then I found the wWinMain which I guess is supposed to replace main in some Windows applications. So I think that the source code is correct, but perhaps there is some setting with Visual Studio 2012 that needs to be changed. But searching for that error message hasn't answered my question, so I'm wondering if someone can explain what the cause of the error is and any advice about how I could fix it.
This isn't a C++ problem... the shader compiler, fxc.exe, is looking in your shader code for a function called main. It isn't finding it and throws an error as a result. Right click on your HLSL files and go to Properties -> Configuration Properties -> General. There should be an Item Type field. Change it from HLSL Compiler to Does not participate in build. That should prevent the HLSL compiler from coming along and giving you those errors.
You need to change (in Project Properties -> Linker -> System -> SubSystem) the subsystem of your application from CONSOLE to WINDOWS. After that, the entry point will be changed from Standard C/C++ main to Windows-specific wWinMain.
Related
I am a complete beginner to Unity, as well as Visual Studio 2022.
I was trying to make a 2D game, and have been following along this tutorial, https://www.youtube.com/watch?v=7iYWpzL9GkM. At 25:11, we are shown how to make a script to control the player movement. While I was going to use Visual Studio Code, the Unity debugger for VScode is deprecated, and no longer functions.
To solve this I switched to Visual Studio 2022. I installed the 'Game Development with Unity' and the '.NET desktop development' modules, and set the default external editor within Unity to Visual Studio 2022. I also regenerated the .csproj files as I was instructed in another form.
Despite this, I encounter error CS0246: The type or namespace name 'InputValue' could not be found (27:29 in the video, I am using the 'Player Input' module from Unity)
The libraries also do not light up green, but I am not sure if that is just a theme difference between us, but this is a clean install with the default dark mode.
At 22:20 in the video they get the Input System package from the Package Manager.
The documentation for InputValue says it's from the UnityEngine.InputSystem namespace, so when you see the error:
error CS0246: The type or namespace name 'InputValue' could not be found
It's the compiler telling you it can't find the namespace where InputValue is defined.
To solve this problem, you need to add a "using" statement at the top of the file to tell the compiler where to find that function.
using UnityEngine.InputSystem;
Their code won't work without it, either and actually at 31:50 in the same video you see them realize the error and correct it as well.
is it possible to build the OpenCV-DNN module for 32-Bit UWP? I cloned the official OpenCV repository and generated the VS-Projectfiles with the Generator "Visual Studio 14 2015" and set the flags -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0. However building for UWP will cause the dnn-module to not be included, so I changed the cmake files to include the module and I was able to build the binaries with Visual Studio.
Now here is the problem:
When I create a C++ UWP-Application, link the opencv_dnn.lib file, consume it and launch my app, I get the error:
"Unable to activate Windows Store app MYAPP. The MYAPP.exe
process started, but the activation request failed with error 'The app
didn't start'."
This happens for the debug and release configuration. If I link it, but don't use it at all in my code, I do not get the error. I looked the error up, but was not able to fix it.
Since the unmodified cmakefiles provided in the repo exclude the dnn-module when targeting UWP, I tought, that it is not possible to build this specific module.
Does anyone why this error would occur or if it is possible to build it with UWP as target? I did find this , which suggests that it is possible, although there bugs (not related to linking).
Thanks in advance.
Ok, so i figured it out. I did get the same error for every other opncv module. The problem was that Visual Studio didn't find the opencv dlls despite them being listed under the PATH env variable. I added the dlls to my project folder and was able to launch my program and use opencv.
I have a project in visual c++ where I am referring some external DLL.
I have already included the lib directory in linker section and mention it in the input section of the linker and also included the same in c/c++ General Additional Include Directories section.
Thus the project compiles successfully but whenever I try to run it; it fails with an error "Application was unable to start correctly" but if I see the output section it seems everything is loaded correctly but against that particular Dll it says that "Cannot find or open the PDB file".
How to fix this error so that I can run my program. It is an MFC program running in Visual Studio 2010.
when I run the program through the Dependency Walker, most of the API-MS-WIN-CORE-HEAP, FILE, and EXT-MS-WIN-SESSION USERMGR -l1-1-0.dll many similar to this are unavailable. I even tried to repair the visual studio it didn't work. Is there any idea how to go about it
0x0000007b sounds familiar to me.
Most likely that is due to 32/64 bit library mixture you are linking with.
Either you are building for x64 and linking with a win32 external library or vice versa.
In your Visual Studio project settings separately configure platform architectures you are compiling for and then you can choose the profile which you are actually compiling for.
Trying to build a project that uses managed C++/CLI and it compiles successfully when in the 64-bit build config. When I switch to Win32 config it fails siting the managed C++/CLI dll is not a strong named assembly. When switching configs I have verified that both have the Project -> Configuration Properties -> Linker -> Advanced -> Key File entry has the proper path to the snk file ($(SolutionDir)key.snk)
Not sure if I'm missing something here. I haven't been able to find anything on Google...
[UPDATE]
If I use a post build event in the C++/CLI project the output window shows the following error:
c:\path\file.dll does not represent a strongly named assembly
I'm using the following post build event:
sn -Ra "$(TargetPath)" "$(SolutionDir)key.snk"
Again - the above post build event works on the x64 config but not the win32. (I have tried compiling on both 32-bit & 64-bit machines w/ same result)
Just ran into the same problem today, after some digging it looks like this is caused by a bug introduced in Microsoft Visual Studio 2010 SP 1.
A description of what caused the bug and a workaround can be found at the following link:
http://blogs.msdn.com/b/vcblog/archive/2011/03/11/10140139.aspx
I made a program in Visual Studio 2010 on Windows 7 64-bit.
When I try to run it on Windows XP 32-bit I got message that msvcr100.dll is missing. When I try to copy that file from Win7 to WInXP I got message that msvcr100.dll is wrong.
How to set building in VS so msvcr100.dll would not be necessary?
First you need to make sure you're building a 32 bit executable - 64 bit ones won't run on 32 bit Windows.
Then you can either...
Ship the 32 bit redistributables with your application.
Remove the runtime dependency altogether and link statically to the C++ runtimes. To do this, set Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library to Multi-threaded (/MT).
Linking the runtime libraries statically should help. Go to Project Options -> C/C++ -> Code Generation -> Runtime Library and change the value to Multithreaded or Multithreaded Debug and recompile. This way your application shouldn't depend on the runtime DLLs.
Also don't forget to build a 32bit executable.
The answers above helped me along, but I was still getting the error:
fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
So to help other who may have, like me, spent way too much time stumbling around in search of a clear solution, I'd like to add the bit of information that solved this issue for me. As it turns out, my project had the wrong "Use of MFC" setting to make use of the answer above.
To put it in clear terms:
Open up the project properties (alt-F7 or Project-menu -> [My Project] Properties) and go to Project -> Properties -> Configuration Properties
If General -> Use of MFC is set to Use MFC in a Static Library
you must set
C/C++ -> Code Generation -> Runtime Library
to either Multi-threaded Debug (/MTd) or Multi-threaded (/MT)
and if
General -> Use of MFC is set to Use MFC in a Shared DLL
you must set
C/C++ -> Code Generation -> Runtime Library
to either Multi-threaded DLL (/MD) or Multi-threaded Debug DLL
I got this answer from the Microsoft community answers website and all credit should go to David Wilkinson.
The keyword here is "redistributable" since this error message may occur when attempting to run a .exe that was not developed on the end-user's PC.
The following is a good (and trusted) source to download redistributables without having to download the entire VC++ package or patch:
https://visualstudio.microsoft.com/vs/older-downloads/#microsoft-build-tools-2015-update-3
In my case I needed the "Visual Studio 2010 VC++ Redistributable" even though we are in year 2022.
enter image description here
Step 1.: Go to this website dll-files.com.
enter image description here
dll-files.com is a great repository of Windows DLL files and has almost all the DLL files that are existent on Windows.
Step 2. Now type there your DLL error in the search window of the website.
Step 3. DLL-Files.com will immediately list out the zip file containing that particular DLL file. Download this zip file to your computer and extract it. The extracted folder will contain the DLL error file.
enter image description here
Step 4. Copy the download DLL file (Only that file) and paste this file in your default system folder based on your operating systems below.
C:WindowsSystem (Windows 95/98/Me)
C:WINNT\System32 (Windows NT/2000)
C:\Windows\System32 (Windows XP, Vista, Windows 7/Windows 8.1/Windows 10)
Windows will ask you whether you want to replace the existing DLL file with the new one. Say yes and let Windows copy the file. Restart your computer and voila, you can now run the game/app that was not opening and giving the DLL error, easily.
There are many other websites which will give you DLL files that you want