delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/21/02:19:00

From: jpsabour AT videotron DOT ca
Newsgroups: comp.os.msdos.djgpp
Subject: Erreur with linker
Date: Sat, 20 Dec 1997 23:19:36 -0500
Organization: VTL
Lines: 57
Message-ID: <349C98D8.3FBE@videotron.ca>
NNTP-Posting-Host: ppp091.84.mque.videotron.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Why DJGPP give there errors whe I compile this simple class. I use a
makefile but the problem it same when I compile whitout makefile

			Thank you
			Geoffroy Rivet-Sbourin

main.cpp:

#include <iostream.h>

#include "test.h"

int main()
{
  int x,y;
  cout << "Give value for x: ";
  cin >> x;
  cout << endl;
  cout << "Give value for y: ";
  cin >> y;
  cout << endl;
  cout << somme(x,y) << endl; 
  cout << soust(x,y) << endl;
  return 0;
}

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 <iostream.h>
#include "test.h"


test::somme(int val1,int val2)
{
  return val1+val2;
}

test::soust(int val1,int val2)
{
  return val1-val2;
}

test::test()
{
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019