当前位置: 技术问答>linux和unix
Makefile 加了-g没有生成Debug可执行文件
来源: 互联网 发布时间:2016-12-30
本文导语: # # System specific settings # # GNU/Linux and *BSD systems CC = gcc CFLAGS = -g -Wall LFLAGS = -lssl -lcrypto -s # If your compiler cannot find the OpenSSL header and library files, add # -I/path/to/openssl/include to CFLAGS and -L/path/to/openssl...
#
# System specific settings
#
# GNU/Linux and *BSD systems
CC = gcc
CFLAGS = -g -Wall
LFLAGS = -lssl -lcrypto -s
# If your compiler cannot find the OpenSSL header and library files, add
# -I/path/to/openssl/include to CFLAGS and -L/path/to/openssl/lib to LFLAGS.
##############################################################################
OBJS = msmtp.o esmtp.o net.o tls.o base64.o cram_md5.o merror.o list.o xmalloc.o
PROG = msmtp
all:
make $(PROG)
$(PROG): $(OBJS)
$(CC) -o $(PROG) $(OBJS) $(LFLAGS)
clean:
rm -f *.o *~ core $(PROG)
clear:
rm -f *.o *~ core
以上是Makefile文件,已经加了-g可是为什么没有生成可调试的文件呢?
file msmtp:
msmtp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
请高手指点!
# System specific settings
#
# GNU/Linux and *BSD systems
CC = gcc
CFLAGS = -g -Wall
LFLAGS = -lssl -lcrypto -s
# If your compiler cannot find the OpenSSL header and library files, add
# -I/path/to/openssl/include to CFLAGS and -L/path/to/openssl/lib to LFLAGS.
##############################################################################
OBJS = msmtp.o esmtp.o net.o tls.o base64.o cram_md5.o merror.o list.o xmalloc.o
PROG = msmtp
all:
make $(PROG)
$(PROG): $(OBJS)
$(CC) -o $(PROG) $(OBJS) $(LFLAGS)
clean:
rm -f *.o *~ core $(PROG)
clear:
rm -f *.o *~ core
以上是Makefile文件,已经加了-g可是为什么没有生成可调试的文件呢?
file msmtp:
msmtp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
请高手指点!
|
1 上面说的,编译是CFLAGS没加进去。
2 看看LFLAGS = -lssl -lcrypto -s ,这个-s 什么意思,就是它让你的程序被stripped 了。
2 看看LFLAGS = -lssl -lcrypto -s ,这个-s 什么意思,就是它让你的程序被stripped 了。
|
哪里出问题了?warning都是你程序引起的。
|
clean:
rm -f *.o *~ core $(PROG)
有用tab键么?
rm -f *.o *~ core $(PROG)
有用tab键么?
|
没有TAB会不认识的哈。
|
有道理!