Where a contractor for the construction of any part of a railroad becomes indebted to a laborer for his . services on the work which the former has agreed to perform, the latter may, if he comply with the requirements of the statute (The Code, §1942), subject the railroad com-*241panv to liability for labor for thirty or “ a loss number of days,” provided, 1st, that such employee give notice to such company within twenty days after the performance of the labor for which the claim is preferred ; 2d, that the notice shall be in writing and shall be served on an engineer, agent or superintendent in charge of the section of the road on which such labor was performed, personally or by leaving the same at his usual place of business; 3d, that said notice shall set forth the time when the labor was performed, the number of (lavs and the amount of the claim. This right to look beyond the contract of employment to an artificial responsibility that may be thrust upon the company, is a creature of the statute, and one who claims the benefit of it must, like a mechanic seeking to enforce a lien under the provisions of The Code, and upon the same principle, show a substantial compliance with the requirements of law. Wray v. Harris, 77 N. C., 77 ; Cook v. Cobb, 101 N. C., 68. The Legislature would not, if it liad authority to do so, arbitrarily subject corporations or individuals to liability for the debts of others, unless where the company or person, by reason of the relation sustained to the primary ' debtor, has the power to guard against incurring loss by withholding a payment due to such debtor. If the claimant complies with the requirement that notice shall bo served within twenty days after the performance of the work and embodies in it the specific information mentioned above, the company can ordinarily ascertain the precise amount of its liability for as well as to contractors, or approximate it so closely as to be able to retain a sufficient sum on settlement for its own protection. It should appear affirmatively from the complaint and exhibits, not simply that each of the laborers who assigned to the plaintiff claimed a specified sum from the company, but that every such assignor had complied substantially with the statute in *242giving the prescribed notice previous to the assignment of his account. Cook v. Cobb, supra. After subjecting the contracting corporation to liability by such compliance, each laborer can assign his claim as a debt, either against his employer or the company dealing with him under a direct agreement or as subcontractor, and the assignee could unquestionably sue upon the aggregate amount so transferred to him by various claimants and recover the sum total of all such claims due for such labor, and as to which the requisite notice should be shown to have been given.
The description of the claims assigned is contained in section 2 of the amended complaint, and is as follows: “That there is now due and owing for said labor and materials furnished as aforesaid from defendants the following amounts: To Ii. W. Moore, $130; to J. G. Thomas, $275; to W. Wills, $2.67, aggregating (including all the amounts set out as due to the various parties) $2,403.07. The privilege of subjecting the contracting company to liability is conferred by the statute only upon laborers and on account of work for thirty days or less in constructing a road. The plaintiff sues as assignee, of more than one hundred and forty persons, whose accounts, in section 1 of the amended complaint, are declared upon as for work and labor done in grading and building the railroad, while in the very next paragraph the specific amounts, without distinguishing one from another, are alleged to be due for “ labor and materials furnished.” If the plaintiff had alleged that the notice, prescribed by the statute had been served, as required, by each claimant for work done, it would have been sufficient. It seems probable, at least, that the larger accounts, amounting to from $100 to $200, were not due for labor for thirty days or less, but for materials, and, if so, the company could in no event be held responsible for their payment.
*243AVe concur with the Court below in the view that the facts set forth in the complaint show no cause of action against any person or corporation other than the firm of McDuffie & Gillis.
If it be conceded that the plaintiff could not in any event recover against any interme.diate contractors, but only against the railroad company, and-upon proof of compliance by his assignors with the statute, the addition of the Improvement Company as a defendant would not be a fatal misjoinder.
For the reasons given the judgment is
Affirmed.