Judge Duncan C. Gibb, 64, a Democrat who was a former member of the Virginia House of Delegates and a retired Virginia circuit court judge, died of cancer Friday in Winchester Memorial Hospital.

In a controversial action that received widespread attention, Judge Gibb ruled in March 1978 that a woman living out of wedlock with a man was unfit to practice law in Virginia.

He would not certify the good character of Bonnie C. Cord, a U.S. government attorney and member of the D.C. Bar Association, due to her living arrangement. The certification was a prerequisite for taking the state's bar examination. The certification was withheld despite a 2-to-1 recommendation by a panel of lawyers that it could be granted.

Judge Gibb said that Cord's living arrangement "would lower the public's opinion of the bar as a whole." Cord had moved to Linden, Va., and was livng with a man to whom she was not married.

In April 1979, the Virginia Supreme Court ruled 7 to 0 in Cord's favor. "While Cord's living arrangment may be unorthodox and unacceptable to some segments of society," the court said, " this conduct bears no rational connection to her fitness to practice law. It cannot therefore, serve to deny her the certificate" of good character needed to take the exam.

Judge Gibb was born in Washington and attended the University of Virginia, where he earned both under-graduate and law degrees. He had lived in Front Royal since 1921.

A Democrat, he had served in the Virginia House of Delegates from 1970 to 1974. He was judge of the 26th Circuit Court, which includes the counties of Warren, Shenandoah and Frederick and the city of Winchester, from 1974 until retiring for reasons of health in April of this year.

Judge Gibb's survivors include his wife, the former Mary Parke Maddux, of Front Royal; two daughters, Courtnew Dardis of Washington, and Cynthia Stewart of Delray Beach, Fla.; a son, Duncan C. Jr., of Markham, Va., and one grandchild.