If the pain really is directly behind the kneecap, this is correct. There are a number of ways you can modify training to correct it.
1) Make sure your form is sound. I don't mean competitive powerlifting sound or retard-strong strongman sound (much love to both), I mean correct every time. This may mean reducing weight on the bar considerably.
2) Ensure proper flexibility. If you can't full squat with a neutral spine, you're inflexible. If your hands point inward when you stand relaxed, your internal rotators are tight. Most doctors are incapable of assessing this, so take what any of them say with a grain of salt.
3) Speaking of full squats, do them once you're flexible enough. Also use a foam or pvc roller on your IT band, do VM specific work like Peterson step-ups, and ensure your ankle dorsiflexors are strong.
4) You may have a structural problem going on outside the knee that is manifesting in a problem at the knee; this is fairly common. Consider getting assessed for orthodics and make sure you're not lifting heavy things in shoes with a squishy sole. Any cross trainer, running shoe, or walking shoe falls in this category and should not be worn when lifting. The best orthodics available are e-Soles, but may not be available in your area.
5) Glucosamine and good fats are good advice. Make sure you're well hydrated too; pee should be nearly clear.
6) If you ever run, stop. It's as bad as competitive powerlifting and strongman for joints, with far fewer benefits. If you just enjoy it, limit to a mile or two per day.
7) Consider a support if the above doesn't clear it up after a month or two. Rehband is the way to go on these if you're fairly strong.
Most of the above is to make sure your patella is tracking properly, the rest is good practice regarding knee health, and may or may not apply to your situation. And, as with all musculoskeletal health advice, your doctor and/or chiropractor is probably not a good source of information. Consult a sports oriented PT if you can.