This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13420] New: #pragma interface/implementation lead to link problems on Cygwin
- From: "arnaud dot desitter at ouce dot ox dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Dec 2003 15:23:02 -0000
- Subject: [Bug c++/13420] New: #pragma interface/implementation lead to link problems on Cygwin
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
On Cygwin (1.5.5) and using g++ 3.3.1 ("g++ (GCC) 3.3.1 (cygming special)")
Using the 3 files below,
$ cat AA1.h
#pragma interface
#include "AA2.h"
class AA1 {
public:
void g(){
std::ostringstream os;
}
};
$ cat AA2.h
#pragma interface
#include <sstream>
#include <iostream>
class AA2 {
public:
void f(std::ostringstream os) {
os.str();
}
};
$ cat BB.cpp
#include "AA1.h"
#pragma implementation "AA1.h"
#pragma implementation "AA2.h"
int myi;
A compilation results in two bogus undefined
symbols.
$ g++ -c BB.cpp ; nm BB.o | grep ' U'
U __GLOBAL__D_myi
U __GLOBAL__I_myi
It works flawlessly under Linux.
This snippet comes from compiling ddd under cygwin.
Similar problems have been reported. See:
http://www.cygwin.com/ml/cygwin/2003-11/msg01066.html
--
Summary: #pragma interface/implementation lead to link problems
on Cygwin
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: arnaud dot desitter at ouce dot ox dot ac dot uk
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-cygwin
GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13420