|
|
compliling error in porting linux program
|
|
|
|
Dedicated MacNNer
Join Date: Oct 2001
Location: California
Status:
Offline
|
|
Can anyone please help me decipher this error?
I installed gnugetopt using fink and then copied getopt.h to /usr/include/getopt.h. This is what I see when I type make:
g++3 --ansi -Wall -Wnon-virtual-dtor -Wno-long-long -Wundef -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -Wcast-align -g -pedantic -o flic dispersion_set.o layer_system.o transfer_matrix.o setupfile.o fl_layer_system.o spectrum.o data_set.o interference_terms.o fl_layer_system_tools.o flic.o -lncurses -lstdc++
ld: Undefined symbols:
_getopt_long
make: *** [flic] Error 1
A previous poster said that using gnugetopt solved this problem, but it didn't seem to work for me.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by surfacto:
Can anyone please help me decipher this error?
I installed gnugetopt using fink and then copied getopt.h to /usr/include/getopt.h. This is what I see when I type make:
g++3 --ansi -Wall -Wnon-virtual-dtor -Wno-long-long -Wundef -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -Wcast-align -g -pedantic -o flic dispersion_set.o layer_system.o transfer_matrix.o setupfile.o fl_layer_system.o spectrum.o data_set.o interference_terms.o fl_layer_system_tools.o flic.o -lncurses -lstdc++
ld: Undefined symbols:
_getopt_long
make: *** [flic] Error 1
A previous poster said that using gnugetopt solved this problem, but it didn't seem to work for me.
The error means that the symbol _getopt_long is not in the library as it should be. It could be caused by the fact that your version of getopt is different from the one that the compiled code expects. Somewhere up your link line, one of your .o files linked against the getopt library. That's your culprit.
As to how to fix it, you need to figure out why the source thinks that symbol should be in your library but isn't.
You can use the CLI tool "nm" to list out the symbol table for a library.
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|