please help w/ linker 
Author Message
 please help w/ linker

Hi,
my app uses stlport (static-linked) with msvc6sp5, for a COM dll project.
It works fine until I try to use anything from iostreams; then I get the link error

stlport_vc6_static.lib(fstream.obj) : error LNK2001: unresolved external symbol ___pioinfo

It turns out the __pioinfo struct-array is defined in <MSVC>/CRT/SRC/ ioinit.c,
it's also mentioned in the _SAMPLE[D]_.DEF file:
    ; The following symbols are exported for use by MSVCIRT[D].DLL
        __badioinfo     DATA
        __pioinfo       DATA
        _CrtSetDbgBlockType

A text search in libcmt and msvcrt suggest it's imported into msvcrt.lib,
but defined in libc.lib (all variants).
I've set linker to ignore libcmt; if I don't do this I get a bunch
of "already defined" errors (of course), though not for the pioinfo object.

Can I do something to have only this imported from libcmt?
or is it something else?

thanks,

        S?ren



Sat, 17 Dec 2005 11:11:40 GMT  
 please help w/ linker


Fri, 19 Jun 1992 00:00:00 GMT  
 please help w/ linker
ok, a bit more reading in docs and it seems fixed.
(using dumpbin, lib and some other commands we're usually
shielded from)

I guess it's more interesting to fix it micelf,
but been a bit tense last days... hope it keeps working...

Quote:

> It works fine until I try to use anything from iostreams; then I get the
> link error

> stlport_vc6_static.lib(fstream.obj) : error LNK2001: unresolved external
> symbol ___pioinfo

> It turns out the __pioinfo struct-array is defined in <MSVC>/CRT/SRC/
> ioinit.c,



Sun, 18 Dec 2005 01:22:29 GMT  
 please help w/ linker


Fri, 19 Jun 1992 00:00:00 GMT  
 please help w/ linker

Quote:

> my app uses stlport (static-linked) with msvc6sp5, for a COM dll project.
> It works fine until I try to use anything from iostreams; then I get the link error

> stlport_vc6_static.lib(fstream.obj) : error LNK2001: unresolved external symbol ___pioinfo

> It turns out the __pioinfo struct-array is defined in <MSVC>/CRT/SRC/ ioinit.c,
> it's also mentioned in the _SAMPLE[D]_.DEF file:
>     ; The following symbols are exported for use by MSVCIRT[D].DLL
>         __badioinfo     DATA
>         __pioinfo       DATA
>         _CrtSetDbgBlockType

> A text search in libcmt and msvcrt suggest it's imported into msvcrt.lib,
> but defined in libc.lib (all variants).
> I've set linker to ignore libcmt; if I don't do this I get a bunch
> of "already defined" errors (of course), though not for the pioinfo object.

If you're getting "already defined" errors with libcmt, what other
libraries are you building against?  It looks like you might be trying
to build against multiple CRTs, which I don't think would be a good
idea.  For instance, you shouldn't be getting both libc.lib and
libcmt.lib pulled in at the same time.

--
Craig Powers
MVP - Visual C++



Sun, 18 Dec 2005 02:56:24 GMT  
 please help w/ linker
Thanks for your comments,

 > If you're getting "already defined" errors with libcmt, what other
 > libraries are you building against?  It looks like you might be trying
 > to build against multiple CRTs, which I don't think would be a good

I'm building a dll, so must (it seems) link with msvcrt[d].
Stlport with _WINDLL defined defaults to using the stlport dll build.
But I don't want that, so I set a flag to use the static build (this is
provided for in stlport config).
But stlport_static links against libcmt AND libcmtd, so I'm having to do
a lot of ignoring there. But then the pioinfo disappears, so I extracted
the ioinit.obj and link to this as a separate obj.

Are you perhaps hinting that these conflicts must be resolved
some other way? The initialization of iostreams is labeled "hack"
all around in stlport source etc. There is also a flag to skip
stlport iostreams lib and wrap the msvc version.

If I have to choose between this and using stlport dll, I'll probably
go for msvc iostreams, in order to avoid distributing extra dlls.
Is there some way of doing static-linking to a dll and so avoid
the dll?

I've asked on the stlport forum but no response yet.
Very happy to hear some suggestion how I can get this working
(btw my stlport + boost builds work just fine in another plain-exe project)

thanks,

        S?ren

Quote:


>>my app uses stlport (static-linked) with msvc6sp5, for a COM dll project.
>>It works fine until I try to use anything from iostreams; then I get the link error

>>stlport_vc6_static.lib(fstream.obj) : error LNK2001: unresolved external symbol ___pioinfo

>>It turns out the __pioinfo struct-array is defined in <MSVC>/CRT/SRC/ ioinit.c,
>>it's also mentioned in the _SAMPLE[D]_.DEF file:
>>    ; The following symbols are exported for use by MSVCIRT[D].DLL
>>        __badioinfo     DATA
>>        __pioinfo       DATA
>>        _CrtSetDbgBlockType

>>A text search in libcmt and msvcrt suggest it's imported into msvcrt.lib,
>>but defined in libc.lib (all variants).
>>I've set linker to ignore libcmt; if I don't do this I get a bunch
>>of "already defined" errors (of course), though not for the pioinfo object.

> If you're getting "already defined" errors with libcmt, what other
> libraries are you building against?  It looks like you might be trying
> to build against multiple CRTs, which I don't think would be a good
> idea.  For instance, you shouldn't be getting both libc.lib and
> libcmt.lib pulled in at the same time.



Sun, 18 Dec 2005 09:44:40 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Please help with linker errors

2. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

3. Help PLEASE with BC 3.5 Linker

4. Please help me - I am getting linker error !!!

5. C++ kernel linker problems - help please!

6. Help please. Borland 3.1 linker error

7. please help: linker error LNK 1104

8. LINKER ERROR, please HELP!!!

9. please help: linker error LNK 1104

10. lib and dll linker problem (please help!)

11. Please help!!!!Please help!!!!Please help!!!!

12. Turbo C++ Linker Error *** Please help ***

 

 
Powered by phpBB® Forum Software