1

I'm just trying to compile a c++ program using the emulated g++ compiler in Cygwin on a Windows 7 machine that has the following includes:

iostream
string
windows.h
stdio.h
mmsystem.h
initguid.h
objbase.h
objerror.h
ole2ver.h
speech.h

It compiles them all fine with the exception of speech.h, which is sort of the bread and butter of what I'm working on, soo.. yeah.

Returns the following:

test.cpp:11:20: fatal error: speech.h: No such file or directory compilation terminated.

Any and all help will be much appreciated.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
saricden
  • 2,084
  • 4
  • 29
  • 40

1 Answers1

0

The files that do compile are on your system path, so the compiler can find them. speech.h isn't, so you have to tell it where to look:

g++ -c test.cpp -I<Path_to_speech.h>/speech.h ...

I.e. if it's in C:\Users\Kirk\test\include, then

g++ -c test.cpp -IC:/Users/Kirk/test/include/speech.h ...
Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
Matt Phillips
  • 9,465
  • 8
  • 44
  • 75
  • Great thanks, do you know how I would go about adding speech.h to my system path? – saricden Jan 21 '13 at 11:45
  • @KirkMorris Well, first of all, do you have it on your system? Assuming you do, then you'll need to either a) add it to your path with something like `$ echo PATH=$PATH:` in your .barhrc file, or b) include the full path in your .h file. Now, finding the .h file is one thing, linking against the corresponding library is another... but that's another question. – Matt Phillips Jan 21 '13 at 17:41
  • @KirkMorris Glad to help. Please mark the answer as accepted, this makes it easier for subsequent users to get help who might have the same/a similar question. – Matt Phillips Jan 24 '13 at 06:30
  • 1
    Cygwin refers to `C:` as `/cygdrive/C`, not as `C:/`. – Keith Thompson Jan 28 '13 at 22:57