Can I fix 'Undefined symbols for architecture x86_64'? (10.13)
I have g++ source code that successfully compiles and links with -m32 option. When I take that option away, I get several errors linking one of the source's object. The error is as follows:
=====================================================
g++ -o em3elf em.o emain.o emsvc.o emelf.o emtrap.o emdevs.o emproc.o emacts.o empars.o emsort.o emsrch.o emfuns.o emserv.o emfmtp.o emcps.o emgetl.o emwyl.o flock.o xlong.o -L/Users/dickguertin/newspi/elf -lelf -v
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
"/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o em3elf -L/Users/dickguertin/newspi/elf em.o emain.o emsvc.o emelf.o emtrap.o emdevs.o emproc.o emacts.o empars.o emsort.o emsrch.o emfuns.o emserv.o emfmtp.o emcps.o emgetl.o emwyl.o flock.o xlong.o -lelf -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/9.1.0/lib/darwin/libclang_rt. osx.a
ld: warning: ignoring file /Users/dickguertin/newspi/elf/libelf.a, file was built for archive which is not the architecture being linked (x86_64): /Users/dickguertin/newspi/elf/libelf.a
Undefined symbols for architecture x86_64:
"display_mode_set(model_terminal_public*)", referenced from:
strtScreen() in emelf.o
"display_mode_read(model_terminal_public*, int, unsigned char*, int, long, int*)", referenced from:
CRTread(unsigned char*, int*) in emelf.o
"display_mode_clear(model_terminal_public*)", referenced from:
CRToff() in emelf.o
"display_mode_write(model_terminal_public*, int, unsigned char*, int)", referenced from:
CRTwrite(unsigned char*, int) in emelf.o
"_modeltrmclass", referenced from:
CRToff() in emelf.o
CRTstart(unsigned char*, unsigned char*) in emelf.o
strtScreen() in emelf.o
"_unixportclass", referenced from:
strtScreen() in emelf.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [em3elf] Error 1
=============================================
As you can see, I used the -v option to get as much info as possible. I suspect this is related to "termios" because this is the module that handles 'full-screen'. I can't use 'ncurses' either. Neither seem to be 64-bit compliant. I'm on Hight-Sierra. Any suggestions?