[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

compile error--my choice of options, or the program?



Hello all,

I'm trying to compile a large program wherein I had to choose a series of
options for my system (Linux/PC vs. SGI, etc).  The entire output of the
compile is the following lines:

g++  -DNDEBUG     -O3    -c -DWRITEPDBQSTATE main.cc
main.cc:60: declaration of C function `int gethostname(char *, int)'
conflicts with /usr/include/unistd.h:662: previous declaration `int
gethostname(char *, size_t)' here make: *** [main.o] Error 1

I am not a programmer, so this means nothing beyond the obvious "it screwed
up somewhere" to me.  Compiler options I chose in the makefile are:

# Edit this Makefile to reflect your machine architecture.
#
# Specifically, change these variables:
# LIB, CSTD, CFLAGS, OPT, OLIMIT, LINT, LINTFLAGS, LINK, WARN, & CC. #
# If you need to use debugging or profiling, these should also be  #
modified appropriately:
# DBUG & PROF
[...]
CC = g++
LIB = -lm -lg++
CSTD = $(DBUG) $(PROF) $(WARN)
CFLAGS = $(OPT)
OPTLEVEL = -O3
OPT = $(CSTD) $(OPTLEVEL)
OLIMIT = $(OPT)
LINKOPT = $(OPT)
LINK = $(LINKOPT)
LINT = lint
LINTFLAGS = $(LIB) -c 
DBUG = -DNDEBUG
PROF= 
WARN = 

with the dependencies line being:
main.o : main.cc hybrids.h ranlib.h gs.h ls.h rep.h support.h main.h
constants.h autocomm.h dpftoken.h structs.h autoglobal.h  autocomm.h
	$(CC) $(OLIMIT) -c -DWRITEPDBQSTATE main.cc

Can anyone tell whether the error is an issue with my system setup and/or
these options, or is it likely a programming glitch?  Is there more info I
need to show to determine this? 

Thanks,

Kenward Vaughan
-- 
-----------------------------------------------------------
kaynjay@igalaxy.net  (home)
kvaughan@bc.cc.ca.us  (work)
-----------------------------------------------------------

Reply to: