Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top