Visual Studio 2012?

Discuss any topic somewhat related to computers, and software development.

Visual Studio 2012?

Postby DreamCore » November 29th, 2012, 9:38 am

Hi,

the source code doesn't work in Visual Studio 2012. In the introduction (Demo Setup for Visual Studio) i follow every step and it works fine in Visual Studio 2010. In Visual Studio 2012 however I first get the following error:

1>FXC : error X3501: 'main': entrypoint not found

I fixed this by telling the color.fx to "not compile" in the properties.

Then when I compile I get a whole bunch of warnings and the following linker errors:

1>Effects11d.lib(EffectAPI.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>Effects11d.lib(EffectNonRuntime.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>Effects11d.lib(EffectLoad.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>Effects11d.lib(EffectReflection.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>Effects11d.lib(d3dx11dbg.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>Effects11d.lib(d3dxGlobal.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>Effects11d.lib(EffectRuntime.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Camera.obj
1>C:\Users\Robin\Documents\Visual Studio 2012\Projects\DirectX_Test\Debug\DirectX_Test.exe : fatal error LNK1319: 7 mismatches detected


Will the source code be fixed so that it works with Visual Studio 2012?

Best Regards
Robin
Last edited by DreamCore on November 29th, 2012, 9:44 am, edited 1 time in total.
DreamCore
 
Posts: 4
Joined: November 29th, 2012, 9:33 am

Re: Visual Studio 2012?

Postby admin » November 29th, 2012, 9:42 am

You need to rebuild the Effects11 library with VS12. This forum post has more details:

viewtopic.php?f=4&t=295
admin
Site Admin
 
Posts: 197
Joined: November 5th, 2010, 8:31 pm

Re: Visual Studio 2012?

Postby DreamCore » November 29th, 2012, 9:48 am

How do I rebuild it? The post only said that I must rebuild it but now HOW TO rebuild it.
DreamCore
 
Posts: 4
Joined: November 29th, 2012, 9:33 am

Re: Visual Studio 2012?

Postby admin » November 29th, 2012, 6:38 pm

In the June 2010 SDK there is the Effects11 project:

E:\DXSDKJune10\Samples\C++\Effects11

Open the solution and build in debug mode (naming the output Effects11d.lib) and in release mode (naming the output Effects11.lib). Then copy these two .lib to the book's common directory.
admin
Site Admin
 
Posts: 197
Joined: November 5th, 2010, 8:31 pm

Re: Visual Studio 2012?

Postby DreamCore » November 30th, 2012, 4:35 am

Thanks that worked.

Is it a good idea to set the "color.fx" to "exclude from build" though or is there a better way to get around that problem?
DreamCore
 
Posts: 4
Joined: November 29th, 2012, 9:33 am

Re: Visual Studio 2012?

Postby admin » November 30th, 2012, 9:50 am

Hmmm I didn't have the fx problem when I ported one of the samples to win8 + VS12. VS12 now recognizes hlsl programs, so color.fx might have mistakenly been set to be build as a shader program instead of as an effect file. So I think you need to set the build for color.fx to custom, and add the build configuration as described in the book.
admin
Site Admin
 
Posts: 197
Joined: November 5th, 2010, 8:31 pm

Re: Visual Studio 2012?

Postby shloob » April 7th, 2013, 2:29 pm

I have had success getting the .fx files to work by right clicking on the .fx files and opening the properties. From there click on HLSL Compiler and then General. Delete the Entrypoint Name which will say main. Then click in the shader type area and choose Effect (/fx). Then under Shader Model choose Shader Model 4 (/4_0). Once you do this you will no longer run into that error.
shloob
 
Posts: 4
Joined: April 7th, 2013, 2:18 pm

Re: Visual Studio 2012?

Postby shloob » April 7th, 2013, 2:30 pm

Also set the effect file back to it's original compile settings.
shloob
 
Posts: 4
Joined: April 7th, 2013, 2:18 pm

Re: Visual Studio 2012?

Postby nullgobz » May 19th, 2013, 5:21 pm

Thank you!
This helped me too.
nullgobz
 
Posts: 1
Joined: May 19th, 2013, 5:17 pm

Re: Visual Studio 2012?

Postby novellof » October 3rd, 2013, 6:32 pm

Try this:

Start from desktop
Go to where ever you installed the capter6 box solution and open it. Make sure its the solution.
look at the properties of the color.fx file. You will see that the properties are completely different from the properties if you were to make your own blank project and import the common,FX,and source cpp file. You must change the color.fx properties to match the original box solution. Also
make sure you add the right dependencies when you run the box solution.

Also make sure you have a physical FX folder in your projects directory.

Please let me know how it works for you :)
novellof
 
Posts: 18
Joined: December 5th, 2012, 5:48 pm


Return to General Discussion

Who is online

Users browsing this forum: Bing [Bot], dvdged3 and 1 guest

cron