Menu

[noob] Problems compiling Hello World example

Help
2010-02-24
2012-09-22
  • Kasper Kuijpers

    Kasper Kuijpers - 2010-02-24

    I am pretty new to all this, so I just went ahead installing pocketsphinx and
    tried compiling the the Hello World
    example
    to see
    if it works.

    I basically copy pasted the code from the end of the page, and added the

    #define MODELDIR "c:/sphinx/model"
    

    part since I am on Windows.

    After trying to compile I get a bunch of errors.

    $ gcc -o hello_ps hello_ps.c
    hello_ps.c:1:2: invalid preprocessing directive #!
    hello_ps.c:4:26: pocketsphinx.h: No such file or directory
    hello_ps.c: In function `main':
    hello_ps.c:9: error: `ps_decoder_t' undeclared (first use in this function) 
    ...... (loads more here)
    

    I feel like I need to add some arguments to the command, but if i try to
    recreate the example it won't let me finish because of all the " and ' s.

    Could someone demonstrate how to write a compiler command that could work for
    me?

    Pocketsphinx and sphinxbase are located the following
    c:/pocketsphinx, /cygdrive/c/pocketsphinx
    c:/sphinxbase, /cygdrive/c/sphinxbase

    Thanks!

     
  • Nickolay V. Shmyrev

    I suggest you to read an introduction to GCC development

    http://www.network-theory.co.uk/docs/gccintro/

    where you can find a lot of information about using GCC compiler. In
    particular here you need to learn how to use -L and -I compiler options to
    point to the folder where libraries and headers are located.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.