Operating System - HP-UX
1828671 Members
2637 Online
109984 Solutions
New Discussion

Problems compiling clamav

 
SOLVED
Go to solution
Lars Ebeling
Frequent Advisor

Problems compiling clamav

Dear all,

I am trying to install latest version of clamav. While running make I get this:

gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I./nsis -I./lzma -I/usr/local/include -g -O2
-MT others.lo -MD -MP -MF .deps/others.Tpo -c others.c -fPIC -DPIC -o .libs/ot
hers.o
In file included from others.c:62:
/usr/local/include/pthread.h:285: error: conflicting types for 'pthread_t'
/usr/include/sys/signal.h:108: error: previous declaration of 'pthread_t' was he
re
/usr/local/include/pthread.h:286: error: conflicting types for 'pthread_attr_t'
/usr/include/sys/sigevent.h:65: error: previous declaration of 'pthread_attr_t'
was here
/usr/local/include/pthread.h:357: error: conflicting types for 'pthread_kill'
/usr/include/sys/signal.h:222: error: previous declaration of 'pthread_kill' was
here
/usr/local/include/pthread.h:357: error: conflicting types for 'pthread_kill'
/usr/include/sys/signal.h:222: error: previous declaration of 'pthread_kill' was
here
make[3]: *** [others.lo] Error 1
make[3]: Leaving directory `/extra/clamav-0.93.3/libclamav'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/extra/clamav-0.93.3/libclamav'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/extra/clamav-0.93.3'
make: *** [all] Error 2
#

I have some different sets of pthread libraries and includes

Regards

Lars Ebeling
17 REPLIES 17
Dennis Handly
Acclaimed Contributor

Re: Problems compiling clamav

What OS version? There may be a header file patch that fixes the inconsistencies between , and , or was it a gcc issue?

But you should also check to make sure that /usr/local/include/pthread.h matches the official for those types.
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

Sorry, of course i should have mentioned that I am running 11.11


Ihave pthread.h in /usr/include /usr/local/include and /usr/include/sys and all different

Lars
Steven Schweda
Honored Contributor

Re: Problems compiling clamav

A header file problem when using GCC often
points to a problem with the GCC
installation, which can be caused by an OS or
(HP) C compiler upgrade|patch which affects
the system header files, but does not get the
GCC header files updated accordingly.
Re-installing GCC will normally solve
problems of that type.

> I have some different sets of pthread
> libraries and includes

From where did they all come?
Dennis Handly
Acclaimed Contributor

Re: Problems compiling clamav

>I have pthread.h in /usr/include /usr/local/include and /usr/include/sys and all different

Of course. :-)
You need to compare the types of with the gnu one.
Look for the declarations of pthread_t, pthread_attr_t and pthread_kill.
Then compare with and .

There may be multiple definitions with #if, so look for more than one.
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

Sorry, I know nothing about C. The only things usually do is configure, make and make install. And i used to work.

But lately I have had problems with these pthread things.

I have tried to upgrade spamassassin and now clamav.

Lars
Dennis Handly
Acclaimed Contributor

Re: Problems compiling clamav

>I know nothing about C.

Just look at (paste) the lines in the error messages.
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

Yes, I understand that some things are declared more than once. But what to do about it i don't understand.

Lars
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

What does this mean? Extract from manpages about GNU pthread.h

ConflictswithVendorImplementation
There can be a conflict between the Pth "pthread.h" header and a possibly existing vendor "/usr/include/pthread.h" header which was implicitly included by some standard vendor headers(like "/usr/include/unistd.h"). When this occurs try to ``"#define"'' header-dependent values which prevent the inclusion of the vendor header.
Lars
Dennis Handly
Acclaimed Contributor

Re: Problems compiling clamav

>I understand that some things are declared more than once. But what to do about it i don't understand.

Well, until you show me, I can only guess.

Did you try reinstalling gcc as Steven suggested?

>What does this mean?
>`"#define"'' header-dependent values which prevent the inclusion of the vendor header.

This sound like the include guard.
What's the first #ifndef in the top of pthread.h in /usr/include/ /usr/local/include/ and /usr/include/sys/?
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

I haven't reinstalled gcc. This is done at home as hobby. I don't have any good backups. My tapedeck i bad. I have an old D380 where I among others run my mailserver.

# /usr/include/pthread.h
#ifndef _PTHREAD_INCLUDED /* allows multiple inclusion */

/usr/include/sys/pthread.h

#ifndef _SYS_PTHREAD_INCLUDED

/usr/local/include/pthread.h

#ifndef _PTH_PTHREAD_H_

Lars
Dennis Handly
Acclaimed Contributor

Re: Problems compiling clamav

So to skip the include of the official pthread header you should compile with -D_PTHREAD_INCLUDED.
I'm not sure if this will work since there is no message pointing to .

So as I asked before, what's on:
/usr/local/include/pthread.h:285: error: conflicting types for 'pthread_t'
/usr/include/sys/signal.h:108: error: previous declaration of 'pthread_t'
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

Sorry I didn't understand your question.

/usr/local/include/pthread.h:285
typedef struct pthread_st *pthread_t;

/usr/include/sys/signal.h:108

typedef int pthread_t;

Lars
Dennis Handly
Acclaimed Contributor
Solution

Re: Problems compiling clamav

Your gnu header is garbage. A pthread_t is not a pointer.

You could try renaming it to pthread.h.save and try recompiling.
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

I'll try that. How about the libraries?

Lars
Dennis Handly
Acclaimed Contributor

Re: Problems compiling clamav

>How about the libraries?

There is only one set of libs, the official HP-UX ones and they agree with the official headers.
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

I downloaded GNU pthread and had a look. There is a file pthread.h.in which has the same definition as my /usr/local/include/pthread.h


I am now recompiling

Lars
Lars Ebeling
Frequent Advisor

Re: Problems compiling clamav

I am now recompiling. I think it works. I have remove the /usr/local pthread libs and include

Lars