
230 S.E.2d 609 (1976)
31 N.C. App. 626
HICKORY FURNITURE MART, INC.
v.
Henry BURNS, d/b/a Henry Burns Construction Co.
No. 7625SC564.
Court of Appeals of North Carolina.
December 15, 1976.
*612 Thomas W. Warlick and Corne & Pitts, by Larry W. Pitts, Newton, for plaintiff appellee.
Tate & Young, by E. Murray Tate, Jr., Hickory, for defendant appellant.
ARNOLD, Judge.
Summary judgment was entered for plaintiff based on the conclusion that defendant was a general contractor, as defined by G.S. 87-1, and that defendant was not entitled to recover on the construction contract since he held a limited contractor's license. G.S. 87-10 provides that the holder of a limited contractor's license is not entitled to engage in the practice of general contracting "with respect to any single project of a value in excess of one hundred twenty-five thousand dollars. . .." (Before July 1974 the limitation was seventy-five thousand dollars.)
Error is assigned to the granting of the summary judgment. Defendant contends that there is a genuine issue of material fact as to whether he was a general contractor. A general contractor is defined in G.S. 87-1 as
". . . one who for a fixed price, commission, fee or wage, undertakes. . . to construct any building . . or any improvement or structure where the cost of the undertaking is thirty thousand dollars ($30,000) or more . . .."
A general contractor is one who undertakes to build an entire building. The fact that a subcontractor erects the walls and roof, puts in the subfloor, installs doors, windows, siding and shelves, and paints the building, does not make him a general contractor. Vogel v. Supply Co., 277 N.C. 119, 177 S.E.2d 273 (1970). Where one contracts with a landowner to undertake the construction of a house for the landowner at an agreed price of [thirty thousand dollars or more] he is a "general contractor" and subject to the provisions of the licensing statute. Holland v. Walden, 11 N.C.App. 281, 181 S.E.2d 197 (1971).
In Fulton v. Rice, 12 N.C.App. 669, 184 S.E.2d 421 (1971), this Court held that the contractor is a general contractor within the scope of the statute only where the cost of that contractor's undertaking exceeds [$30,000 or more]. It is the cost of the undertaking by the purported contractor that controls. The contract price, or cost of the contractor's undertaking, is not always the same as the total cost of the building. The owner's total cost of the building is not determinative of the contractor's status. If the situation is such that the contractor has no control over the purchase of materials or other expenses which the owner might incur, he cannot insure that the statutory cost limitation is not exceeded, and he does not fall within the definition of a general contractor. Fulton v. Rice, supra at 672, 184 S.E.2d 421.
Upon plaintiff's motion for summary judgment, the trial court considered the defendant's claim of lien and defendant's Answer and Counterclaim, and found that defendant "undertook to construct a building" which cost at least $325,000. The court found the further fact, disclosed by both parties' affidavits, that defendant had a limited license as a general contractor. (This limit was $75,000 prior to 1 July 1974 and $125,000 after July 1974.) It concluded that, since the value of the building exceeded the limit of defendant's license, his claim was barred by G.S. 87-1 and cases thereunder.
Summary judgment was improper. There is a material issue of fact as to the size and scope of defendant's undertaking and whether defendant was a general contractor. Defendant alleges numerous facts which show he lacked the control of a general contractor over the undertaking. Among these are his assertions that it was plaintiff who selected and purchased building material, and directly employed subcontractors. In addition, defendant's affidavit stated that he never acted as a general contractor, but that he was a "construction supervisor". Defendant further avowed *613 that Mr. Leroy Lail acted as overall manager of the project, and that defendant never knew from day to day whether he was employed for the next day. While there are inconsistent allegations in defendant's pleadings and claim of lien, there is a triable issue as to defendant's status.
Moreover, plaintiff's complaint and reply allege "an employment arrangement" with defendant, and that defendant had duties as a supervisor. The complaint alleges that plaintiff contracted directly with many subcontractors, and plaintiff's second cause of action specifically alleges that there was never any "discussion or agreement, written or oral, with regard to defendant acting as a general contractor" for the project. In fact, paragraph VII alleges "that the plaintiff had no contract with the defendant. . .."
All of the pleadings and affidavits present a general issue of material fact as to whether defendant was a general contractor.
Defendant's counterclaim may not be entirely barred even if he is found to be a general contractor who exceeded the limits of his license. Section 87-10 of the North Carolina General Statutes says, "the holder of a limited [general contractor's] license . . . shall not be entitled to engage [in general contracting] with respect to any single project of a value in excess" of $125,000. The statute is criminal. Its purpose is to protect the public from incompetent builders by forbidding them to maintain an action on their contracts, thereby discouraging them from undertaking projects beyond their capabilities. Builders Supply v. Midyette, 274 N.C. 264, 162 S.E.2d 507 (1968). An unlicensed contractor cannot affirmatively enforce his contract; neither can he recover in quantum meruit, because this would achieve the result forbidden at law. Holland v. Walden, supra. However, a general contractor can enforce his contract defensively, as a set-off, to the claims asserted against him, though the set-off cannot exceed his adversary's claims. See, Builders Supply v. Midyette, supra at 273, 162 S.E.2d 507 (dicta); Culbertson v. Cizek, 225 Cal.App.2d 451, 37 Cal.Rptr. 548 (1964). This exception limits the penalty paid by the unlicensed builder to the amount he actually expended on the contract and no more.
Finally, defendant correctly contends that the $4,000 advanced the plaintiff as a loan, of which $3,500 was repaid, had nothing to do with his status as a contractor. Inasmuch as plaintiff's reply admits that the balance of $500 has not been paid, the defendant is entitled to recover the $500 which plaintiff admittedly owes.
The summary judgment dismissing defendant's counterclaim and claim of lien is reversed and the cause is remanded.
Reversed and remanded.
MORRIS and CLARK, JJ., concur.
