On running make command, I get the following output,
g++ -DUNIX -Wall -g -I../include -I. main.o hfpage.o hfp_driver.o test_driver.o db.o new_error.o page.o system_defs.o buf.o -o hfpage
/usr/bin/ld: Warning: size of symbol `error_string_table::error_string_table(Status, char const**)' changed from 18 in db.o to 34 in buf.o
/usr/bin/ld: i386:x86-64 architecture of input file `buf.o' is incompatible with i386 output
collect2: ld returned 1 exit status
make: *** [hfpage] Error 1
This file generates hfpage.o which when I try to run using ./hfpage.o I get and error message bash: ./hfpage.o: cannot execute binary file.
Is there something wrong with my system?
Okay, first, the error messages says
buf.owas compiled for another architecture, probably 32 bit on a 64 bit machine.The reason you can’t run
./hprof.ois thathprof.ois a binary object, not an executable. If this compile had completed, since you have no-oflag, the executable would be nameda.outwhich for historical reasons is the default name of a UNIX executable.Your problem probably comes in an earlier step in the make file. Basically, you should have several lines like
and then a final line like
The architecture message suggests you compiled
buf.owith a different compiler or compiler flags.