| | |
Compile errors under different Linux OS's
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2004
Posts: 1
Reputation:
Solved Threads: 0
Hi,
I am not a C programmer, but have been given some code to get compiled and use.
We host our server with 1&1 and I can access the machine via SSH/Telnet, but when I come to run the make file, I get the following error:
> make
g++ -DGNU_CONSTRUCTOR_BUG -I/usr/include/ -I/usr/include/g++-2/ -I. -DPDEBUG_ENABLED -O -L/usr/X11R6/lib -L../lib -g main.o displ.o nprcs.o nmatrix.o procs.o nvect.o nfiles.o -lm -lX11 -lainn -o ainn
main.o: In function `main':
main.o(.text+0xf9): undefined reference to `dconv(void)'
main.o(.text+0x17a): undefined reference to `calc_(int, char **, char *, char *)'
collect2: ld returned 1 exit status
make: *** [ainn] Error 1
The OS Type is linux-gnu
But I tried the same files and makefile on my Red Hat 9 OS Box and it all compiled instantly!
Is there any reason for C code to compile on one machine but not the other? Any help would or pointers would great!
Thanks
Daniel
The makefile is below:
CC = g++ -DGNU_CONSTRUCTOR_BUG
OLDC = gcc
INCLUDE = -I/usr/include/ -I/usr/include/g++-3/
LFLAGS = -L/usr/X11R6/lib -L../lib
SYS_LIBS =
BINPATH = ../bin
MOVE = mv
COPY = cp
LIBS = $(SYS_LIBS) -lm -lX11 -lainn
DB = -O
CFLAGS = $(INCLUDE) $(DEFS) $(DB) $(PROF) $(SYS_CFLAGS) $(LFLAGS)
DEFS = -I. -DPDEBUG_ENABLED
DFLAGS = -wt
PROGS = ainn
SRCS = main.cc displ.cc nprcs.cc nmatrix.cc procs.cc nvect.cc nfiles.cc
DEPEND_SRC = $(SRCS)
HEADERS = ff.h trn.h ut.h uttypes.h ui.h global.h xwin.h defines.h
OBJS = main.o displ.o nprcs.o nmatrix.o procs.o nvect.o nfiles.o
DEPEND_OBJ = $(OBJS)
$(PROGS): $(OBJS)
$(CC) $(CFLAGS) -g $(OBJS) $(LIBS) -o $(PROGS)
$(MOVE) $(PROGS) $(BINPATH)
$(COPY) ../lib/llib2rdmcsh $(BINPATH)
$(COPY) ../lib/llib2dset1 $(BINPATH)
$(COPY) ../lib/llib2rdmxlzhx $(BINPATH)
$(COPY) ../lib/llibjianmo0 $(BINPATH)
$(COPY) ../lib/llibdconv $(BINPATH)
$(COPY) ../lib/llib2virtreg $(BINPATH)
depend:
-DEPEND_SRC=`echo $(DEPEND_OBJ:.o=.cc) $(DEPEND_OBJ:.o=.cpp) `; \
touch ./dependencies.tmp; \
makedepend -f ./dependencies.tmp $(DEPEND_SRC) 2>&-
sort < ./dependencies.tmp > ./dependencies
-rm ./dependencies.tmp*
dependencies:
clean:
-rm -f $(PROGS) *.o *~ *.bak dependencies
include dependencies
# DO NOT DELETE
I am not a C programmer, but have been given some code to get compiled and use.
We host our server with 1&1 and I can access the machine via SSH/Telnet, but when I come to run the make file, I get the following error:
> make
g++ -DGNU_CONSTRUCTOR_BUG -I/usr/include/ -I/usr/include/g++-2/ -I. -DPDEBUG_ENABLED -O -L/usr/X11R6/lib -L../lib -g main.o displ.o nprcs.o nmatrix.o procs.o nvect.o nfiles.o -lm -lX11 -lainn -o ainn
main.o: In function `main':
main.o(.text+0xf9): undefined reference to `dconv(void)'
main.o(.text+0x17a): undefined reference to `calc_(int, char **, char *, char *)'
collect2: ld returned 1 exit status
make: *** [ainn] Error 1
The OS Type is linux-gnu
But I tried the same files and makefile on my Red Hat 9 OS Box and it all compiled instantly!
Is there any reason for C code to compile on one machine but not the other? Any help would or pointers would great!
Thanks
Daniel
The makefile is below:
CC = g++ -DGNU_CONSTRUCTOR_BUG
OLDC = gcc
INCLUDE = -I/usr/include/ -I/usr/include/g++-3/
LFLAGS = -L/usr/X11R6/lib -L../lib
SYS_LIBS =
BINPATH = ../bin
MOVE = mv
COPY = cp
LIBS = $(SYS_LIBS) -lm -lX11 -lainn
DB = -O
CFLAGS = $(INCLUDE) $(DEFS) $(DB) $(PROF) $(SYS_CFLAGS) $(LFLAGS)
DEFS = -I. -DPDEBUG_ENABLED
DFLAGS = -wt
PROGS = ainn
SRCS = main.cc displ.cc nprcs.cc nmatrix.cc procs.cc nvect.cc nfiles.cc
DEPEND_SRC = $(SRCS)
HEADERS = ff.h trn.h ut.h uttypes.h ui.h global.h xwin.h defines.h
OBJS = main.o displ.o nprcs.o nmatrix.o procs.o nvect.o nfiles.o
DEPEND_OBJ = $(OBJS)
$(PROGS): $(OBJS)
$(CC) $(CFLAGS) -g $(OBJS) $(LIBS) -o $(PROGS)
$(MOVE) $(PROGS) $(BINPATH)
$(COPY) ../lib/llib2rdmcsh $(BINPATH)
$(COPY) ../lib/llib2dset1 $(BINPATH)
$(COPY) ../lib/llib2rdmxlzhx $(BINPATH)
$(COPY) ../lib/llibjianmo0 $(BINPATH)
$(COPY) ../lib/llibdconv $(BINPATH)
$(COPY) ../lib/llib2virtreg $(BINPATH)
depend:
-DEPEND_SRC=`echo $(DEPEND_OBJ:.o=.cc) $(DEPEND_OBJ:.o=.cpp) `; \
touch ./dependencies.tmp; \
makedepend -f ./dependencies.tmp $(DEPEND_SRC) 2>&-
sort < ./dependencies.tmp > ./dependencies
-rm ./dependencies.tmp*
dependencies:
clean:
-rm -f $(PROGS) *.o *~ *.bak dependencies
include dependencies
# DO NOT DELETE
•
•
Join Date: Mar 2004
Posts: 1,620
Reputation:
Solved Threads: 51
Hello,
I am not a big-gun programmer, but I think that you may be lacking some C++ libraries or have to make tweaks to the makefile before you can have a successful compile. It is possible that the libraries exist, but the directory paths are wrong. Or different C compilers entirely.
This is why a lot of C++ programs on the net come with a ./configure script that goes through and makes a Makefile on-the-fly so that the various includes are properly accounted for.
Christian
I am not a big-gun programmer, but I think that you may be lacking some C++ libraries or have to make tweaks to the makefile before you can have a successful compile. It is possible that the libraries exist, but the directory paths are wrong. Or different C compilers entirely.
This is why a lot of C++ programs on the net come with a ./configure script that goes through and makes a Makefile on-the-fly so that the various includes are properly accounted for.
Christian
![]() |
Similar Threads
- How to compile C in Linux (C)
- Please help w/ compile errors (C++)
- Server Side JavaScript compile errors (JavaScript / DHTML / AJAX)
- Compile errors [help] [ log ] (C++)
- 2 Compile errors in my array program (C)
Other Threads in the C++ Forum
- Previous Thread: I want C&C++ FQAs emergency
- Next Thread: NULL not doing its job!
| Thread Tools | Search this Thread |
api array arrays based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion convert count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






