Чтобы сделать пользовательскую версию функции igraph_get_shortest_paths_dijkstra
Я сделал ее копию из файла: structural_properties.c
. Я выдернул его и положил его в локальный файл .c и одна из модификаций моей Makefile состоит в следующем, но я получаю сообщение об ошибке:пользовательский igraph igraph_get_shortest_paths_dijkstra функция в Mac OS X
gcc -I/usr/local/include/igraph -I/Users/saguinag/ToolSet/igraph-0.7.1/src -I/Users/saguinag/ToolSet/igraph-0.7.1 -o mycc comp_catpath.o -L/usr/local/lib -ligraph
Undefined symbols for architecture x86_64:
"_saguinag_get_shortest_path", referenced from:
_main in comp_catpath.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: *** [mycc] Error 1
Где моя Makefile начинается как:
## Author: Sal Aguinaga (c) 2015
CC=gcc
INCLUDES=-I/usr/local/include/igraph \
-I/Users/saguinag/ToolSet/igraph-0.7.1/src \
-I/Users/saguinag/ToolSet/igraph-0.7.1
LFLAGS=-L/usr/local/lib
LIBS=-ligraph
OUT=comp_catpath
OBJS=comp_catpath.o
# define the C source files
SRCS = comp_catpath.c
OBJS = $(SRCS:.c=.o)
# define the executable file
MAIN = mycc
.PHONY: depend clean
all: $(MAIN)
@echo Simple compiler named mycc has been compiled
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)
# this is a suffix replacement rule for building .o's from .c's
# # it uses automatic variables $<: the name of the prerequisite of
# # the rule(a .c file) and [email protected]: the name of the target of the rule (a .o file)
# # (see the gnu make manual section about automatic variables)
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o [email protected]
#
clean:
$(RM) *.o *~ $(MAIN)
#
depend: $(SRCS)
makedepend $(INCLUDES) $^
#
# DO NOT DELETE THIS LINE -- make depend needs it
Мне нужно указать архитектуру? Моя машина MacBook Pro. Когда я набираю make -v
, я понимаю, что это GNU Make 3.81 с последней строкой, говорящей «Эта программа, созданная для i386-apple-darwin11.3.0». Есть ли лучший способ сделать это?
Он действительно не печатает какие-либо неопределенные символы, кроме '..'? –
... означает: '' _saguinag_get_shortest_path ', ссылка от: _main in comp_catpath.o' – sAguinaga