www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/03/14:17:09

From: "Rafal Maj" <maj_rafal AT poczta DOT onet DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: inline operator bug ?
Date: Thu, 3 May 2001 17:41:49 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 26
Message-ID: <9cs1p9$a0d$2@info.cyf-kr.edu.pl>
NNTP-Posting-Host: d-94-53-28.cyfronet.krakow.pl
X-Trace: info.cyf-kr.edu.pl 988908137 10253 149.156.1.188 (3 May 2001 16:42:17 GMT)
X-Complaints-To: news AT cyf-kr DOT edu DOT pl
NNTP-Posting-Date: Thu, 3 May 2001 16:42:17 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have found some problems with using inline operators and I think that it
might be a bug.
This bug can only be seen in projects, so my example program has 3 files :
****** file bug1lib.h ******
  class cA { public : inline void operator +(int); } ;
****** file bug1lib.cc *******
  #include "bug1lib.h"
  inline void cA::operator +(int) { };
****** bug1m.cc ******
  #include "bug1lib.h"
  int main() { cA a;  a+2; }

After building this project I get output like this :
  Compiling: bug1lib.cc   no errors
  Compiling: bug1m.cc   no errors
  Creating: bug1.exe
   Error: bug1m.o: In function `main':
  Error: bug1m.cc(.text+0x10): undefined reference to `cA::operator+(int)'
  Error: collect2: ld returned 1 exit status

After removing inline from bug1lib.cc & bug1lib.h everything is working
correct.




- Raw text -


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