From: Geoffroy Rivet-Sabourin Newsgroups: comp.os.msdos.djgpp Subject: problem to compile with DJGPP Date: Tue, 23 Dec 1997 20:14:56 -0500 Organization: VTL Lines: 102 Message-ID: <34A06210.193B@gel.ulaval.ca> Reply-To: rivets00 AT gel DOT ulaval DOT ca NNTP-Posting-Host: ppp210.83.mque.videotron.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I try to make little class in C++ to test makefile and compilation with DJGPP. This little class don't link and I don't what is the reason of this problem. I put in the message C++ code and errors gernerate by compilation. Thank you GRS main.cpp: #include #include "test.h" int main() { int x,y; cout << "entrez une valeur de x: "; cin >> x; cout << endl; cout << "entrez une valeur de y: "; cin >> y; cout << endl; cout << somme(x,y) << endl; cout << soust(x,y) << endl; return 0; } classe test test.h: #ifndef test_flag #define test_flag class test { public: int somme(int,int); int soust(int,int); test(); }; #endif test_flag test.cpp #include #include "test.h" test::somme(int val1,int val2) { return val1+val2; } test::soust(int val1,int val2) { return val1-val2; } test::test() { } #fichier makefile pour test test : main.o test.o gxx -o test main.o test.o main.o : main.cpp test.h gxx -c main.cpp test.o : test.cpp test.h gxx -c test.cpp errors: cd c:/prog/ make -k gxx -c test.cpp gcc.exe: -lgpp: linker input file unused since linking not done gcc.exe: -lstdcx: linker input file unused since linking not done gcc.exe: -lm: linker input file unused since linking not done gxx -o test main.o test.o \ main.o(.text+0xc5):main.cc: undefined reference to `somme' main.o(.text+0xf7):main.cc: undefined reference to `soust' make.exe: *** [test] Error 1 -- Geoffroy Rivet-Sabourin Etudiant en Genie informatique Universite Laval Quebec, Canada