This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

main.c(11): error C129: missing ';' before 'void'

void init_LCM(void) { write_inst(0x30); /*set function*/ write_inst(0x30); /*set function*/ write_inst(0x30); /*set function*/ write_inst(0x38); /*set 2 line*/ write_inst(0x08); /*off lcd*/ write_inst(0x01); /*clear lcd*/ write_inst(0x06); /*set input mode*/ write_inst(0x0e); /*enable lcd*/ }
after compiler,i got main.c(11): error C129: missing ';' before 'void',i don't understand?

Parents
  • Here's a tidied up version of that mess you posted.

    void init_LCM(void)
    {
      write_inst(0x30); /*set function*/
      write_inst(0x30); /*set function*/
      write_inst(0x30); /*set function*/
      write_inst(0x38); /*set 2 line*/
      write_inst(0x08); /*off lcd*/
      write_inst(0x01); /*clear lcd*/
      write_inst(0x06); /*set input mode*/
      write_inst(0x0e); /*enable lcd*/
    }
    

    It means you've got an error.

    error C129: missing ';' before 'void
    

    What this means is that the compiler has found that you did not have a ';' in your code where you should have done.

    main.c(11)
    

    What this tells you is where in your code that the compiler realized there was something missing.

    If the compiler gave information about what the error is and an indication of where the error is, it would make the programmers life so much easier.

    Oh. What's that? It does!

Reply
  • Here's a tidied up version of that mess you posted.

    void init_LCM(void)
    {
      write_inst(0x30); /*set function*/
      write_inst(0x30); /*set function*/
      write_inst(0x30); /*set function*/
      write_inst(0x38); /*set 2 line*/
      write_inst(0x08); /*off lcd*/
      write_inst(0x01); /*clear lcd*/
      write_inst(0x06); /*set input mode*/
      write_inst(0x0e); /*enable lcd*/
    }
    

    It means you've got an error.

    error C129: missing ';' before 'void
    

    What this means is that the compiler has found that you did not have a ';' in your code where you should have done.

    main.c(11)
    

    What this tells you is where in your code that the compiler realized there was something missing.

    If the compiler gave information about what the error is and an indication of where the error is, it would make the programmers life so much easier.

    Oh. What's that? It does!

Children