Class Library has 'No constructors defined error'

Answered Class Library has 'No constructors defined error'

  • Friday, September 21, 2012 11:52 PM
     
      Has Code

    This is my first time writing a class library for a proof of concept Spelling Test Program. It takes a list of words, says it, and waits for user response. Then, it returns the grade.

    That is the class library's job. I just finished the library, and compiled it. 

    Error 1 The type 'Spelling_Test_Core.Quiz' has no constructors defined

    I know there is a constructor defined right here: 

    public class Quiz
        {
            private string[] Words;
            int PTS = 0;
            Quiz(string[] words, int pts) //Constructor
            {
                Grade gr = new Grade();
                gr.Cleanup();
                Words = words;
                PTS = pts;
            }

    This is the declaration of a member: 

    string[] Programs = new string[2];
                Programs[0] = "Pears!";
                Programs[1] = "Carrots!";
               // Quiz qu = new Quiz(Programs , 10);
                Quiz qu = new Quiz();

    The commented out one is the correct constructor with arguments that returns a similar error.

All Replies