[quote] makefile如下: [code] t1:t1.o gcc -o $@ $^ ..c .o: gcc -g -c $< [/code] 我执行gdb t1 报错: (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 为什么-g选项没有起作用? [/quote] 原来是.c .o规则的问题,我改成这样就可以了. [code] t1:t1.o gcc -o t1 t1.o t1.o:t1.c gcc -g -c t1.c [/code] [ 本帖最后由 xxldc 于 2008-1-2 14...
by xxldc - C/C++ - 2007-12-27 14:48:23 阅读(3143) 回复(2)
目录文件结构:
-----------------------------------------
.
./src
./src/a.c
./src/m.c
./make
./make/makefile
./obj
./bin
-----------------------------------------
m.c内容:
-----------------------------------------
#include
我用的是Redhat 8.0,自己写的C程序,编译时写的makefile文件有下面的语句: ...... .PHONY: clean clean: $(RM) temp*.o 但是执行make之后,temp*.o仍然存在,执行make clean之后则可以删除,看来是.PHONY没有起作用,这是什么原因呢?
.SUFFIXES: .o .c .cpp .ec .a 1.请问.SUFFIXES 这个标记起什么作用,为什么要用这个标记,有什么用途? 2..ec 文件是什么文件,我还从来没见过,麻烦各位大哥帮小弟讲解下。
大家好,我是个高中生,高中1年纪。
最近在学习linux下的编程。
// 文件main.c
#include
test.h
#ifndef _TEST_H_
#define _TEST_H_
void print();
#endif
test.c
#include
这是我写的一个makefile VPATH=../lib:../include:../bin lib = ../lib/ bin = ../bin/ objects=bank.o adminlogin.o mainmenu.o execute.o deposit.o withdraw.o query.o \ write.o read.o listall.o cancelaccount.o establishaccount.o bank : $(objects) gcc $(objects) -o $(bin)bank bank.o : bank.c includeofbank.h includeofstruct.h gcc -c bank.c -o $(lib)bank.o mainmenu.o : mainmen...
本人明天就要交程序 但是突然发现要求要makefile 但我对这个根本不太了解 我有5个目录,as.tgs.client.kdc 和sever_v 每个目录下基本都有main.cpp和tea.hpp等文件 请问如何构造makefile? 应该是在主目录下构造一个makefile,然后在5个目录下分别构造5个makefile, 但是该怎么写了? 更大的问题是,我的程序是在LINUX下编译通过 但是放到SUN的UNIX下编译无法通过 如果是在Solaris上编译,因该把相应的头文件包含进去,如:“sys /...