The mechanic who furnished labor and materials in repairing or erecting a building, for an entire sum, under a contract with one not the owner of the premises on which the work was done, had no lien under the Gen. Sts. e. 150, for either labor or materials, unless he gave notice to the owner of his intention to claim a lien for the materials, before furnishing them. Morrison v. Minot, 5 Allen, 403. Brewster v. Wyman, 5 Allen, 405, note. To relieve the mechanic from, any hardship which this state of the law might expose him to, it is provided by the St. of 1872, o. 318, that a lien shall attach to secure payment for labor performed or furnished under an entire contract for labor and materials, provided it can be distinctly shown what such labor is worth, with the further provision that such lien shall not be enforced for a sum greater than the price agreed on for the entire contract. Section 2 of this statute makes it a condition precedent to the enforcement of the lien thus given, that the statement of account, to be filed in the office of the clerk of the city or town, as required by the Gen. Sts. c. 150, § 5, shall set forth, in addition to what is there specified, “ the entire price for the entire contract, the number of days of labor performed or fur-. nished, and the value of the same.” This statement is required, by the St. of 1877, e. 93, to be filed in the registry of deeds for the county or district in which the building is situated.
The exceptions show that the notice requisite to the creation of a lien for the materials furnished was not given to the owner, and that the statement of account filed by the petitioner did not set forth the entire price for the entire contract under which the labor was performed. The failure to comply with the requirement of the statute in this respect destroyed the right of the petitioner to enforce a lien for the labor. His right depended wholly on the statute, and could be established only by a substantial compliance with its terms. The position taken by the *518petitioner at the argument, that, because he could maintain an action on a quantum meruit against Post, with whom he made the contract, in consequence of Post’s breach, he may maintain his lien as if the labor had not been performed under an entire contract for labor and materials, is not tenable. This question was fully discussed and decided in Clark v. Kingsley, 8 Allen, 543. When the work was done, no lien for it could attach, except in case the petitioner did a certain act which he has never done. There was no contract between the petitioner and the respondent. Any breach of contract by Post, with whom the petitioner was dealing, could not in any way affect the rights or obligations of the respondent as to work which had been done by the petitioner under the entire contract, before the breach occurred. The ruling of the learned judge who tried the case, that the statement filed by the petitioner was sufficient, was therefore erroneous. Exceptions sustained.