From: Ruediger W. <rue...@la...> - 2001-06-02 16:30:36
|
Hello Andrew! it is not an Bug in gcc its an feature ;-) . gcc always emitts an out of line copy of on inline function even when all functions had been inlined. To turn this off use following commandswitch when compiling. -fno-keep-inline-functions > I compiled this into its .o, ar'd it into a .a, and then used Paul's > a2dll utility (extremely handy, thanks!) to turn it into a DLL. > > Then, I create another file (george.cc) that #include's this class, > along with the inline function definition. I compile and link that, but > when I used a2dll to try to turn that into a DLL, I get a multiple > definition error: hello() is defined twice, once in the import library > for the DLL that a2dll created, and once in the george.cc file. > > Looking in the import library for my first DLL, I see three definitions > re: hello: > > I __imp___hello__C3Foo... > I __nm__hello__C3Foo... > T _hello__C3Foo... > > This last definition is the problem I think. Should this really be in > the import library? I think that this definition causes the a2dll'ing of > george.cc to fail, since I'm sure that its .o contains the inline'd > definition of hello() as well. > > Is this a GCC bug (i'm using gcc 2.95.2-3 from the mingw.org web page) > where inline functions that are inlined after the class definition are > marked to be included in the import library, when they really shouldn't? > |