GHC 6.2.1 compilation fails when compiling FFI code with -pro f or -O2

Bayley, Alistair Alistair_Bayley at
Wed Apr 21 14:48:59 EDT 2004

Sorry for the stupidity... just found the -I<dir> option...

Although it is a bit frustrating when an FFI program that used to compile
stops when you add supposedly "harmless" options such as -O or -prof. Might
be worth adding a section to the FFI section of the manual about using the
-I<dir> flag when compiling via C, as -I<dir> is not needed when you compile
with native code generation. And a mention in the FFI section that -prof and
-O will change the compilation strategy from native to via-C (thus possibly
requiring the addition of the -I<dir> flag) would be nice, although I
realise that's duplicating information available elsewhere.

(Actually, compiling via C has been valuable for me because the C compiler
moaned about a foreign function being called with too few args, which was
the result of an incorrect "foreign import" declaration i.e. the C compiler
found a bug in my Haskell code, which the GHC native code-generator wouldn't
have picked up. Plus it gives warnings on other dodgy things I'm doing.
Better fix 'em...)


> -----Original Message-----
> From: Bayley, Alistair [mailto:Alistair_Bayley at]
> The "oci.h" file in question is located in 
> c:\orant817\oci\include, and
> oci.dll is located in c:\orant817\bin. When I compiled with 
> -prof I tried
> adding -#include c:\orant817\oci\include\oci.h, but this 
> produces the output
> below, where files included by oci.h can't be found. The 
> oci.h file is at
> the root of quite a large .h include tree; do I have to 
> specify every .h
> file in this tree with -#include?

Confidentiality Note: The information contained in this 
message, and any attachments, may contain confidential 
and/or privileged material. It is intended solely for the 
person(s) or entity to which it is addressed. Any review, 
retransmission, dissemination, or taking of any action in 
reliance upon this information by persons or entities other 
than the intended recipient(s) is prohibited. If you received
this in error, please contact the sender and delete the 
material from any computer.

More information about the Glasgow-haskell-users mailing list