
198 S.E.2d 73 (1973)
18 N.C. App.  726
W. M. SIMS and wife, Carol C. Sims, Plaintiff,
v.
OAKWOOD TRAILER SALES CORPORATION, Defendant and Third Party Plaintiff,
v.
VIRGINIA HOMES MANUFACTURING CORPORATION, Third Party Defendant. 
No.  7310SC497. 
Court of Appeals of North Carolina. 
July 25, 1973. 
Certiorari Denied August 31, 1973. 
*74 James M. Kimzey, Raleigh, for plaintiff appellants. 
Teague, Johnson, Patterson, Dilthey & Clay, by Robert W. Sumner, Raleigh, for defendant and third party plaintiff appellee. 
Bailey, Dixon, Wooten & McDonald, by Wright T. Dixon, Jr., and John N. Fountain, Raleigh, for third party defendant appellee. 
Certiorari Denied by Supreme Court August 31, 1973. 
MORRIS, Judge. 
G.S. § 1A-1, Rule 41(d) of the North Carolina Rules of Civil Procedure provides as follows:
"Costs.  A plaintiff who dismisses an action or claim under section (a) of this rule shall be taxed with the costs of the action unless the action was brought in forma pauperis.  If a plaintiff who has once dismissed an action in any court commences an action based upon or including the same claim against the same defendant before the payment of the costs of the action previously dismissed, unless such previous action was brought in forma pauperis, the court, upon motion of the defendant, shall dismiss the action." ( Emphasis added.) 
*75 The language of Rule 41(d) constitutes a mandatory directive to the trial court.  Cheshire v. Aircraft Corp., 17 N.C.App.  74, 193 S.E.2d 362 (1972). 
Plaintiffs contend, however, that a motion to dismiss under Rule 41(d) is waived by failure of defendant to make such a motion prior to or as part of its answer as required by G.S. § 1A-1, Rule 12(b).  The pertinent parts of Rule 12 are set out as follows:
"(b) How presented.  Every defense, in law or fact, to a claim for relief in any pleading, whether a claim, counterclaim, crossclaim, or third-party claim, shall be asserted in the responsive pleading thereto if one is required, except that the following defense may at the option of the pleader be made by motion:
(1) Lack of jurisdiction over the subject matter,
(2) Lack of jurisdiction over the person,
(3) Improper venue or division,
(4) Insufficiency of process,
(5) Insufficiency of service of process,
(6) Failure to state a claim upon which relief can be granted,
(7) Failure to join a necessary party. 
A motion making any of these defenses shall be made before pleading if a further pleading is permitted.  The consequences of failure to make such a motion shall be as provided in sections (g) and (h).  No defense or objection is waived by being joined with one or more other defenses or objections in a responsive pleading or motion.  If a pleading sets forth a claim for relief to which the adverse party is not required to serve a responsive pleading, he may assert at the trial any defense in law or fact to that claim for relief.  If, on a motion asserting the defense, numbered (6), to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56, and all parties shall be given reasonable opportunity to present all material made pertinent to such a motion by Rule 56. 
. . . . . . 
(g) Consolidation of defenses in motion.  A party who makes a motion under this rule may join with it any other motions herein provided for and then available to him.  If a party makes a motion under this rule but omits therefrom any defense or objection then available to him which this rule permits to be raised by motion, he shall not thereafter make a motion based on the defense or objection so omitted, except a motion as provided in section (h) (2) hereof on any of the grounds there stated. 
(h) Waiver or preservation of certain defenses.
(1) A defense of lack of jurisdiction over the person, improper venue, insufficiency of process, or insufficiency of service of process is waived (i) if omitted from a motion in the circumstances described in section (g), or (ii) if it is neither made by motion under this rule nor included in a responsive pleading or an amendment thereof permitted by Rule 15(a) to be made as a matter of course. 
(2) A defense of failure to state a claim upon which relief can be granted, a defense of failure to join a necessary party, and an objection of failure to state a legal defense to a claim may be made in any pleading permitted or ordered under Rule 7(a), or by motion for judgment on the pleadings, or at the trial on the merits. 
(3) Whenever it appears by suggestion of the parties or otherwise that the court lacks jurisdiction of the subject matter, the court shall dismiss the action." 
*76 Plaintiffs argue that Rules 12(b), (g) and (h) should be read in conjunction with one another with the result that all defenses and objections not included in the pleadings, made by pre-pleading motion under 12(b), or expected by 12(h) (1) are waived under 12(b) and 12(h)(1).  In support of their contention they argue that defendant's motion to dismiss under Rule 41(d) is analogous to a motion for insufficiency of process and such defense is waived under Rule 12(h)(1) if it is neither made by pre-pleading motion nor included in the pleadings or on amendment thereto.  We do not agree. 
It is clear from the language in Rule 12(g); i. e., "which this rule permits to be raised by motion", that the Rule 12 waiver provisions apply only to those motions enumerated under 12(b) and not excepted under 12(h).  Plaintiffs' analogy is ingenious but unconvincing. 
It is equally clear that payment of costs taxed in the first action is a mandatory condition precedent to the bringing of a second action on the same claim under Rule 41(d).  Plaintiffs are in no position to claim surprise or prejudice for failing to comply with a requirement that conditions their right to reinstate their previous action. 
The strong language of Rule 41(d) also compels us to reject plaintiffs' contention that the defense relied on by defendant constitutes "any other matter constituting an avoidance or affirmative defense", under Rule 8(c) and must be asserted in a responsive pleading under Rule 12(b).  Rule 41(d) succinctly provides that, "the court, upon motion of the defendant, shall dismiss the action" (emphasis added), and we hold that defendant did not waive its rights under 41(d) by failing to assert them in a responsive pleading. 
Lastly, we examine plaintiffs' contention that defendant's motion was not properly before the court for defendant's failure to comply with Rule 6(d) which provides that a written motion "shall be served not later than five days before the time specified for the hearing."  Defendant's motion to dismiss was served on the day the case appeared on the trial calendar, two days after the trial term and a day before the actual date of the trial. 
Rule 7(b)(1) provides in pertinent part:
"An application to the court for an order shall be by motion which, unless made during a hearing or trial or at a session at which a cause is on the calendar for that session, shall be made in writing." ( Emphasis added.) 
Under Rule 7(b)(1) a motion does not have to be made in writing if made during the session at which the cause is calendared for trial.  The fact that defendant did file a written motion in this instance does not trigger the notice provision of Rule 6(d) into play.  Defendant's oral announcement and presentation of the motion during the session at which the cause was calendared for trial was sufficient properly to bring the matter before the court.  Furthermore, we note no objection in the record by plaintiffs' counsel that the motion was not properly before the court. 
As held under our old practice and equally applicable to our present Rule 7(b)(1):
"The law manifests its practicality in determining `When notice of a motion is necessary.'  When a civil action or special proceeding is regularly docketed for hearing at a term of court, notice of a motion need not be given to an adversary party, unless actual notice is required in the particular cause by some statute.  This rule is bottomed on the proposition that all parties to a civil action or special proceeding are bound to take notice of all motions made and proceedings had in the action or special proceeding in open court during the term. ( Citations omitted.)"  Collins v. Highway Commission, 237 N.C. 277, 282, 74 S.E.2d 709 (1953). 
*77 Therefore, we conclude that defendant's motion was properly before the court and the trial judge committed no error in dismissing plaintiffs' action for failure to comply with Rule 41(d). 
Affirmed. 
BRITT and PARKER, JJ.,  concur.