Both parties have appealed from the-judgment entered in the court below.
On September 26, 1950, the appellant and appellee entered into a contract whereby-the appellee agreed to build a house for the former on a lot she owned in an addition to the then City of Hot Springs, New Mexico, for the sum of $7,500, the work to begin within seven days from the approval of a loan by the Federal Housing Administration, and to be completed within about 90 days thereafter.
The appellee did not have a contractor’s license as required by our Contractors License Act, the material sections of which are Sections 51-1901, 51-1903, 51-1914 and 51-1916, 1941 Comp.
“It shall be unlawful for any person, * * * to engage in the business or act or offer to act in the capacity or purport to have the capacity of contractor within this state without having a license therefor as herein provided, unless such person, firm, copartnership, corporation, association or other organization is particularly exempt as provided in this act. * * * ” Section 51-1901.
“A contractor within the meaning of this act is a person, * * * who for either a fixed sum, price, fee, percentage, or other compensation other than wages, undertakes or offers to undertake, or purports to have the capacity to undertake to construct, alter, repair, add to or improve any building, excavation, or other structure, project, development or- improvement, other than to personalty, or any part thereof; provided, that the term contractor, as used in this act, shall include subcontractor, but shall not include anyone who merely furnishes materials or supplies without fabricating the same into, or consuming ■ the same in the performance of the work of the contractor as herein defined.” Section 51-1903.
*693“Any person who acts in the capacity of a contractor within the meaning of this act without a license as herein provided, and any person who conspires with another person to violate any of the provisions of this act is guilty of a misdemeanor, and shall, upon conviction thereof, be punished by a fine of not less than one hundred ($100.00) ■dollars, nor to exceed five hundred ($500.00) dollars, or by imprisonment in the county jail for a term not to exceed six (6) months, or by both such fine and imprisonment in the discretion of the court.
“No contractor as defined by section 3 (§ 51-1903) of this act shall act as agent or bring or maintain any action in any court •of the state for the collection of compensation for the performance of any act for which a license is required by this act without alleging and proving that such contractor was a duly licensed contractor at the time the alleged cause of action arose. * * * ” Section 51-1914.
“Any contractor operating without a license as herein provided shall have no-right to file or claim any mechanics lien as now provided by law, but otherwise. Neither this entire act, nor any section thereof is enacted for the purpose of aiding, conflicting with or amending or repealing the present Mechanic’s Lien Law * * * of the state of New Mexico, or any part thereof.” Section 51-1916.
The appellee did not secure a license until February 17, 1951, and by its terms it expired on June 30 following, unless renewed. Between the date of the contract and the procuring of the license he did but little construction work on the house beyond putting in a concrete foundation. On the date the contractor’s license was issued, a supplemental agreement was entered into between the parties referring to the original contract-and granting additional time to the appellee, with a penalty clause of $10 per day for failing to complete the house within the extended time, acts of God alone excepted. Shortly thereafter they entered into another supplemental agreement whereby an additional room was to be added at the stated price of $750. The house was finally completed in August, 1951, but possession was withheld from the owner pending payment of the claimed charges. t
On November 9, 1951, the appellant filed suit against the appellee for $10 per day damages for claimed delay in completing the building. To this complaint the ap-pellee filed a denial and a cross-complaint seeking to foreclose a mechanic’s lien. Between the filing of the pleadings and the first trial it is said the attorneys in the case discovered the appellee was not a licensed contractor when the agreement was entered into, and it was agreed by the trial judge at the start of the first hearing the pleadings could be amended, to plead the *694appellee was a licensed contractor at the time the cause of action arose.
At the conclusion of the first hearing, which began January 17, 1952, the appellant dismissed her complaint and was given permission to amend her answer to the cross-compiaint to ask á set off against any judgment rendered against her of $10 per day for delay and as compensation for the time she had been kept out of possession of the property.
While the case was being held under advisement the appellee entered the house and detached practically all fixtures which could be removed, but he was required to reinstall them and enjoined from committing other depredations against the property pending a final determination of the cause.
It was the contention of the appellant the failure of the appellee to have a license at the time the contract was entered into prevented the foreclosure of the mechanic’s lien or any judgment based on the contract for work done; while the appellee' contended the making of the February 17, 1951 agreement at a time when he was licensed, and the subsequent agreement for an additional room incorporated the original agreement into these later agreements and removed it from the ban of the contractor’s licensing statute.
The trial judge came to the conclusion the appellee could not have foreclosure of his lien, but that he could have recovery on quantum meruit for the value of the materials furnished and labor expended on the house during the time he held a contractor’s license, and ordered the parties to appear before him at Socorro, New Mexico, for such a hearing on August 16, 1952. They appeared but only the appellee brought along his witnesses. The appellant objected to such a hearing because of lack of pleadings to make such proof admissible, but this obj ection was overruled, and the attorneys for each of the parties were told by the judge that they would participate in such hearing and cross-examine. After such hearing findings of fact and conclusions of law were filed by the trial judge denying foreclosure of the lien, and allowing recovery on quantum meruit for $5,255, after allowing a set off for delay, and the time the appellant was wrongfully kept out of possession of the property.
The appellee, in obedience to the order of-the court, put on his evidence supporting a recovery on quantum meruit, but did not amend or offer to amend his pleadings to seek recovery on quantum meruit if denied a lien, and in this court his brief and argument is all in support of his claimed right to foreclose his lien for the entire amount claimed, without argument or authority in support of the trial court’s action in giving him judgment on quantum meruit for labor and materials expended and furnished from February 17, 1951, to August 1, 1951, the date all work was completed, it having been *695found he was a licensed contractor during such period.
The appellant argues the proof shows the license of the appellee expired June 30, 1951, and, according to the certified copies of the records of the Contractor’s Licensing Board such was the fact, but as no objection or exception was made to the court’s finding on the point, and no contrary finding requested, we must accept the finding as made.
We agree with the conclusion of the trial court that the February 17, 1951 agreement was no more than an extension of time, and that'it could not clothe with legality the illegal contract first entered into in defiance of our statute making such action an offense, nor can we agree with the contention that because the appellee was a licensed contractor when he completed the work and his cause of action arose, he may have foreclosure of his lien.
It is true the statute, Section 51-1914, supra, says a contractor may not prosecute suit or have foreclosure unless he had a license when his cause of action .arose, but this does not purify his previous sins and he fails to give proper weight to our previous holdings in this respect. In Garvin v. Gordon, 1932, 36 N.M. 304, 307, 14 P.2d 264, 266, we said:
“ * * * If the particular statute declares that the calling of a broker ‘shall not be lawful,’ or ‘shall, not be pursued or done’ without a license, and perhaps by the weight of authority, if it imposes a penalty for the breach thereof, thus implying a prohibition, the broker cannot recover for his services rendered while he was unlicensed. The reason is obvious. Valid contracts may not arise out of transactions forbidden by law. The illegality inhering at the inception of such contracts taints them throughout and effectually bars enforcement.”
“It is a well settled rule of law that a person cannot maintain an action if, in order to establish his cause of action, he must rely, in whole or. in part, on an illegal or immoral act or transaction to which he is a party, or where he must base his cause of action, in whole .or in part, on a violation by himself of the criminal or penal laws. * * * ”
In Kaiser v. Thomson, 1951, 55 N.M. 270, 232 P.2d 142, a contractor who erected a house when he was not a licensed contractor was denied foreclosure of a claimed lien or recovery on a.quantum meruit, although the owner in that case knew the contractor was unlicensed when he entered into the contract and did the work, and had promised to help the latter secure a license.
A similar contention to that made by ap-pellee here was made in Bendell v. De *696Dominicis, 1929, 251 N.Y. 305, 167 N.E. 452, 453, where the license of a real estate broker had lapsed for a time, and when he was without a license he had secured an offer for some real estate theretofore listed with him, which he communicated to his principal who declined it. Some time thereafter the offer was accepted and before the contract of sale was drawn the broker renewed his license and brought suit for a commission. The court said:
“ * * * (the plaintiff) maintained * * * he was a licensed * * * broker when such cause of action arose, * * * and is entitled to recover. Plaintiff has, however, failed to show that he was a licensed real estate broker at the time he rendered the services alleged in the complaint and proved on the trial. If he, while unlicensed, engaged in a single act prohibited by the article, he was guilty of a misdemeanor. * * *
“ * * * tie seeks to avoid the effect of the illegal character of his services when rendered because, after his services ceased, the parties came together on terms first presented to the defendant by him. He comes not within the letter or the spirit of the statute. * * * Out of services illegally rendered comes a lawful contract of sale. * * * his claim for compensation is outlawed by the criminal nature of such services. * * * ”
The securing of a license in February, 1951, does not validate appellee’s illegal contract made the previous November.
We affirm the holding of the trial court that the appellee was not entitled to a foreclosure of his lien or to be compensated for the contract price of the house.
We pass to a consideration of the appellant’s claim the trial court erred in awarding compensation ,on quantum meruit for the materials furnished and labor performed after the appellee was licensed as of February 17, 1951.
As indicated above, many things were litigated in the first two hearings in this cause, but the value of the materials furnished and labor expended was not among them. This issue came into the case at the direction of the trial court, over the appropriate objection of the appellant, but the appellee evidently felt so secure in his contention he was entitled to recover on the contract and foreclose his lien, he did not, as heretofore stated, amend and ask for alternate relief on quantum meruit. This leaves the judgment on this feature of the case without a pleading to support it. We held in the construction case of Campbell v. Hollywood Race Ass’n, 1950, 54 N.M. 260, 263, 221 P.2d 558, that one cannot sue *697•on express contract and recover on quantum meruit, and we reaffirm that holding.
The trial judge rebelled at what he felt would be the unjust enrichment of the appellant unless he allowed recovery on quantum meruit for the period the appellee was .a licensed contractor, and had he been aided by a proper pleading we would have looked .upon his decision in that regard with a sympathetic eye, but absent the pleading the judgment in this regard must be reversed insofar as it grants relief to the appellee, .and the cause remanded to the District ■Court with instructions to enter a new judgment in accordance with the views herein ■expressed. The appellant will recover her .costs.
It is so ordered.
•SADLER, C. J., and COMPTON, LUJAN, and SEYMOUR, JJ., concur.