[erlang-questions] Problem compiling under CentOS 5

Brian Candler B.Candler@REDACTED
Fri Aug 8 18:29:01 CEST 2008


On Fri, Aug 08, 2008 at 10:43:04AM +0100, Brian Candler wrote:
> I had already built yaws, and I had symlinked /usr/lib/erlang/lib/yaws-1.77
> to /usr/local/lib/yaws where yaws installed itself (under there are ebin,
> examples, include, priv directories). However erlyweb was still unable to
> find yaws_api.hrl. Whether that should cause a core dump I don't know.

For the benefit of the archives, I found two solutions to this.

(1) Modify Emakefile, which contains paths to where the yaws headers are
expected.

Or:

(2) Change a couple of erlyweb files to use -include_lib instead of
-include, and then install or link yaws to the standard lib dir.

--- src/erlyweb/yaws_headers.erl.orig	2008-08-08 10:37:34.000000000 +0100
+++ src/erlyweb/yaws_headers.erl	2008-08-08 14:26:37.000000000 +0100
@@ -28,7 +28,7 @@
 	 authorization/2, other/1, other/2]).
 	 
 
--include("yaws_api.hrl").
+-include_lib("yaws/include/yaws_api.hrl").
 
 %% @doc Create a new 'headers' record.
 new() ->
--- src/erlyweb/yaws_arg.erl.orig	2008-08-08 10:37:35.000000000 +0100
+++ src/erlyweb/yaws_arg.erl	2008-08-08 14:26:54.000000000 +0100
@@ -29,7 +29,7 @@
 	 docroot/2, fullpath/1, fullpath/2, cont/1, cont/2, state/1,
 	 state/2, pid/1, pid/2, opaque/1, opaque/2, appmod_prepath/1,
 	 appmod_prepath/2, pathinfo/1, pathinfo/2]).
--include("yaws_api.hrl").
+-include_lib("yaws/include/yaws_api.hrl").
 
 %% @doc Create a new 'arg' record.
 new() ->

Regards,

Brian.



More information about the erlang-questions mailing list