mingw DLL problem

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
I still can't figure out how to make it work.

Consider the file  "foo.cc"
=========
extern int bar();
int foo(int q)
{
  return q*bar();
}
=========


On Linux, to make a native .so I can do:
        g++ -fPIC --shared foo.cc
and it builds an appropriate file, such that "bar" will be 
resolved later.


The problem is if I do:
        i586-mingw32msvc-g++  --shared foo.cc
It responds with:
========
/tmp/cch3JG6k.o:foo.cc:(.text+0x7): undefined reference to 
`bar()'
collect2: ld returned 1 exit status
========

With a real file, I get a flood of these messages.

What am I doing wrong?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.