[squid-users] Editing Makefile.am to include static libraries

Amos Jeffries squid3 at treenet.co.nz
Wed Mar 25 23:42:34 UTC 2015

On 26/03/2015 4:47 a.m., Priya Agarwal wrote:
> I can't change the header files of library. Therefore when I included it in
> my code I did
> extern "C" {
> #include<c header file>
> ...
> }
> instead of just #include and it worked.

Yes, that is equivalent to the correct header contents.

> But the compiler is showing some errors in the header files I included, but
> of course there isn't anything wrong in them. I could include it this way
> as well right?

Well, if the compiler is complaining by definition there *is* something
wrong with them.

The lack of that extern construct in the headers shows the author has
paid no attention to C++ compatibility, and very little (if any)
attention to making the library portable.

You can build Squid with --disable-strict-error-checking to hide issues
which are non-critical. But be aware that the warnings may become
critical errors at any time with other compilers, and some may result in
undesirable run-time behaviour or bugs with the current one.

> Also I wrote a c file and a corresponding header file in /src folder and
> appended the 'squid_sources' as this:
> squid_sources = .
>                          ...
>                          ....
>                         usdpaa_if.h \
>                         usdpaa_if.c
> Is this okay? As again it is showing errors in the usdpaa_if.c file and
> there are no syntax errors like the compiler says.
> I saw other folder in /src like compat had also included c files like this
> so I thought this would be right.

Yes, provided you also placed a '\' character on the end of the line
above the new ones (making them part of the wrapped list). AND that the
.c code in that new file will compile with your C compiler.


More information about the squid-users mailing list