• Advertisement
Sign in to follow this  

fxc looking for main()?

This topic is 3480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When compiling my shader, I get the following error when compiling with fxc.exe: error X3501: 'main': entrypoint not found When even google failed me n this topic, I decided to post here. Anyone know how to fix this? What causes it?
int numLights;

float  lengths[32];
float2 positions[32];

bool perPixelLighting = false;

float2 camPos;

texture tex : Diffuse
<
    string ResourceName = "rgbcheck.bmp";
>;
sampler TextureSampler = sampler_state
{
    Texture = (tex);
    MinFilter = linear;
    MagFilter = linear;
    MipFilter = linear;
    AddressU = mirror; 
    AddressV = mirror;
};

struct VertexIn
{
    float2 pos : POSITION;
    float2 texCoord : TEXCOORD0;
    float4 color : COLOR0;
};
struct VertexOut
{
    float4 pos : POSITION;
    float2 texCoord : TEXCOORD0;
    float2 wPos : TEXCOORD1;
    float4 color : COLOR0;
};
struct PixelIn
{
    float2 texCoord : TEXCOORD0;
    float2 wPos : TEXCOORD1;
    float4 color : COLOR0;
};

VertexOut VertexShaderFunction(VertexIn inval)
{
	VertexOut outval = (VertexOut)0;
	outval.wPos = inval.pos;
	outval.pos = float4((inval.pos-camPos).xy,0,0);
	outval.texCoord = inval.texCoord;
	outval.color = inval.color;
}

float4 PixelShaderFunction(PixelIn inval) : COLOR0
{
    float4 color = tex2D(TextureSampler, inval.texCoord);
    float litval = 1;
    return float4(color.rgb*litval,color.a);
}

technique Lighter
{
    pass pass0
    {
	VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}

Share this post


Link to post
Share on other sites
Advertisement
You need to specify what you want compiled. For example:

fxc /T fx_2_0 file.fx
Will compile the entire file with vs and ps 2.0.

fxc /T ps_2_0 /E PixelShaderFunction file.fx
Will compile PixelShaderFunction with ps 2.0.

Share this post


Link to post
Share on other sites
Okay, great, that seemed to fix that problem!
Now I have a different one...

Failed to create D3D device
Please check your SDK installation.
disassembly failed; no disassembly produced

???
Louis

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement