Parse error: Syntax Error in compiled shader, Unity 4.3.1 [free]

Greeting everyone.

I am trying to follow the Cg Tutorial from nvidia’s developer site to get familiar with shaders, and I am also consulting the porting tips from the wiki here:

Now I am trying to re-create the shader from example “C3E5_DoubleVision”.
At first I tried following only the cg tutorial from nvidia’s site and correcting my errors alone. When it was all ready, with no compile errors i got this one:

Shader error in ‘Custom/doubleTexture’: Parse error: syntax error at line 1049

This Error appears in the compiled shader file and the line reads:

SetTexture 0 [$_mainTex] 2D 0

I could not find what’s wrong so I tried making a new shader file named test and copying the example as it was from the wiki.
Same Error happens (although the compiled shader has less lines because that code doesn’t #include “UnityCG.cginc” like mine does, so the error occures in line 799 of the compiled shader).

Also, if I select any of the shader file, in the inspector this message appears:

Shader has Errors or is not supported by your graphics cards.

Any Ideas why that is? My graphics card is quite new so I doubt it doesn’t support some shader model…
Could it have something to do with vertex/fragment profiles mentioned in the cg tutorial? and If so what can i do in unity to set a profile?
Or could it be sometihng else entirely?

Thank you very much in advanced.

I also tried to implement the fix for older GPUs, using two texture units instead of one (in case my gpu did not indeed support the shader), from Cg tutorial as seen in:

Example 3-7. The C3E7f_twoTextures Fragment Program

but I get the same problem.

I tried to implement other shaders too, and it seems the problem is produced every time by a call to:

float4 tex2D(sampler2D samp, float2 s)

and in the compiled shader this errors in the “d3d11” subprogram block.
(i.e. I tried adding #pragma only_renderers d3d9 and it compiled but the shader did not behave as it should).

The code on that wiki page looks incomplete/wrong. Try this instead:

Shader "Custom/C3E5_DoubleVision"
		_MainTex ("Diffuse", 2D) = "white" {}
		_leftSeparation ("Left Separation", Vector) = (-0.5,0,0,0)
		_rightSeparation ("Right Separation", Vector) = (0.5,0,0,0)
		_lerpValue ("Linear Interpolation Value", Float) = 0.5
			#pragma vertex vert
			#pragma fragment frag

			uniform float2 _leftSeparation;
			uniform float2 _rightSeparation;
			uniform sampler2D _MainTex;
			uniform float _lerpValue;

			struct a2v {
				float2 pos : POSITION;
				float2 texCoord : TEXCOORD0;

			struct v2f {
				float4 oPos : SV_POSITION;
				float2 leftTexCoord : TEXCOORD0;
				float2 rightTexCoord : TEXCOORD1;

			v2f vert(a2v IN)	
				v2f o;
				o.oPos = float4(IN.pos, 0, 1);
				o.leftTexCoord = IN.texCoord + _leftSeparation;
				o.rightTexCoord = IN.texCoord + _rightSeparation;
				return o;
			float4 frag(v2f IN) : COLOR
				float4 leftColor = tex2D(_MainTex, IN.leftTexCoord);
				float4 rightColor = tex2D(_MainTex, IN.rightTexCoord);
				return lerp(leftColor, rightColor, _lerpValue);