469,626 Members | 1,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

problem converting old code to visual studio .net

Hi,

I'm having trouble converting an old project to visual studio C++ .net
v7.1.3088

I've updated one of the header files to use #include <iostream>, and used
the std namspace.
After resolving the missing library by adding "-NODEFAULTLIB:msvcirt.lib" to
the linker command line, I get the following link errors:
libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "int __cdecl
mwMainCommon(int,char const * *,void (__cdecl*)(int,struct mxArray_tag * *
const,int,struct mxArray_tag * * const),int,struct _mexcpp_information *)"
(?mwMainCommon@@YAHHPAPBDP6AXHQAPAUmxArray_tag@@H1 @ZHPAU_mexcpp_information@
@@Z)

libmatpm.lib(handler.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "void __cdecl
DefaultError(char const *,unsigned char)" (?DefaultError@@YAXPBDE@Z)

libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class ostream & __thiscall
ostream::operator<<(int)" (__imp_??6ostream@@QAEAAV0@H@Z) referenced in
function "class ostream & __cdecl operator<<(class ostream &,class
mwException const &)" (??6@YAAAVostream@@AAV0@ABVmwException@@@Z)
The file "libmatpm.lib" is a static library that is also kind of dated. Is
there any way I can avoid these errors without recompiling my static
libraries, because I don't have access to them?

Thanks in advance,
Brett
Nov 17 '05 #1
4 1931
Sorry, but no. You cannot mix versions of the C and C++ standard libraries
inside one executable image. E.g. in the case of iostreams, the
implementation is completely different.

Ronald Laeremans
Visual C++

"Brett" <br***@hotmail.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi,

I'm having trouble converting an old project to visual studio C++ .net
v7.1.3088

I've updated one of the header files to use #include <iostream>, and used
the std namspace.
After resolving the missing library by adding "-NODEFAULTLIB:msvcirt.lib"
to
the linker command line, I get the following link errors:
libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "int __cdecl
mwMainCommon(int,char const * *,void (__cdecl*)(int,struct mxArray_tag * *
const,int,struct mxArray_tag * * const),int,struct _mexcpp_information *)"
(?mwMainCommon@@YAHHPAPBDP6AXHQAPAUmxArray_tag@@H1 @ZHPAU_mexcpp_information@
@@Z)

libmatpm.lib(handler.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "void
__cdecl
DefaultError(char const *,unsigned char)" (?DefaultError@@YAXPBDE@Z)

libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class ostream & __thiscall
ostream::operator<<(int)" (__imp_??6ostream@@QAEAAV0@H@Z) referenced in
function "class ostream & __cdecl operator<<(class ostream &,class
mwException const &)" (??6@YAAAVostream@@AAV0@ABVmwException@@@Z)
The file "libmatpm.lib" is a static library that is also kind of dated. Is
there any way I can avoid these errors without recompiling my static
libraries, because I don't have access to them?

Thanks in advance,
Brett

Nov 17 '05 #2
and there's no way I can use the previous versions of header files:
<iostream.h>?

Brett.

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Sorry, but no. You cannot mix versions of the C and C++ standard libraries
inside one executable image. E.g. in the case of iostreams, the
implementation is completely different.

Ronald Laeremans
Visual C++

"Brett" <br***@hotmail.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi,

I'm having trouble converting an old project to visual studio C++ .net
v7.1.3088

I've updated one of the header files to use #include <iostream>, and used
the std namspace.
After resolving the missing library by adding "-NODEFAULTLIB:msvcirt.lib"
to
the linker command line, I get the following link errors:
libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "int
__cdecl
mwMainCommon(int,char const * *,void (__cdecl*)(int,struct mxArray_tag *
*
const,int,struct mxArray_tag * * const),int,struct _mexcpp_information
*)"
(?mwMainCommon@@YAHHPAPBDP6AXHQAPAUmxArray_tag@@H1 @ZHPAU_mexcpp_information@
@@Z)

libmatpm.lib(handler.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "void
__cdecl
DefaultError(char const *,unsigned char)" (?DefaultError@@YAXPBDE@Z)

libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class ostream & __thiscall
ostream::operator<<(int)" (__imp_??6ostream@@QAEAAV0@H@Z) referenced in
function "class ostream & __cdecl operator<<(class ostream &,class
mwException const &)" (??6@YAAAVostream@@AAV0@ABVmwException@@@Z)
The file "libmatpm.lib" is a static library that is also kind of dated.
Is
there any way I can avoid these errors without recompiling my static
libraries, because I don't have access to them?

Thanks in advance,
Brett


Nov 17 '05 #3
Not any supported way at least. And not one that I would personally want to
use in an app that shipped.

Ronald

"Brett" <br***@hotmail.com> wrote in message
news:41*********************@news.optusnet.com.au. ..
and there's no way I can use the previous versions of header files:
<iostream.h>?

Brett.

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Sorry, but no. You cannot mix versions of the C and C++ standard
libraries inside one executable image. E.g. in the case of iostreams, the
implementation is completely different.

Ronald Laeremans
Visual C++

"Brett" <br***@hotmail.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi,

I'm having trouble converting an old project to visual studio C++ .net
v7.1.3088

I've updated one of the header files to use #include <iostream>, and
used
the std namspace.
After resolving the missing library by adding
"-NODEFAULTLIB:msvcirt.lib" to
the linker command line, I get the following link errors:
libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "int
__cdecl
mwMainCommon(int,char const * *,void (__cdecl*)(int,struct mxArray_tag *
*
const,int,struct mxArray_tag * * const),int,struct _mexcpp_information
*)"
(?mwMainCommon@@YAHHPAPBDP6AXHQAPAUmxArray_tag@@H1 @ZHPAU_mexcpp_information@
@@Z)

libmatpm.lib(handler.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "void
__cdecl
DefaultError(char const *,unsigned char)" (?DefaultError@@YAXPBDE@Z)

libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class ostream & __thiscall
ostream::operator<<(int)" (__imp_??6ostream@@QAEAAV0@H@Z) referenced in
function "class ostream & __cdecl operator<<(class ostream &,class
mwException const &)" (??6@YAAAVostream@@AAV0@ABVmwException@@@Z)
The file "libmatpm.lib" is a static library that is also kind of dated.
Is
there any way I can avoid these errors without recompiling my static
libraries, because I don't have access to them?

Thanks in advance,
Brett



Nov 17 '05 #4

I have the same problem, did you find the solution please?
Hi,

I'm having trouble converting an old project to visual studio C++ .net
v7.1.3088

I've updated one of the header files to use #include <iostream>, and used
the std namspace.
After resolving the missing library by adding "-NODEFAULTLIB:msvcirt.lib" to
the linker command line, I get the following link errors:
libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "int __cdecl
mwMainCommon(int,char const * *,void (__cdecl*)(int,struct mxArray_tag * *
const,int,struct mxArray_tag * * const),int,struct _mexcpp_information *)"
(?mwMainCommon@@YAHHPAPBDP6AXHQAPAUmxArray_tag@@H1 @ZHPAU_mexcpp_information@
@@Z)

libmatpm.lib(handler.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) class ostream_withassign cout"
(__imp_?cout@@3Vostream_withassign@@A) referenced in function "void __cdecl
DefaultError(char const *,unsigned char)" (?DefaultError@@YAXPBDE@Z)

libmatpm.lib(init.o) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class ostream & __thiscall
ostream::operator<<(int)" (__imp_??6ostream@@QAEAAV0@H@Z) referenced in
function "class ostream & __cdecl operator<<(class ostream &,class
mwException const &)" (??6@YAAAVostream@@AAV0@ABVmwException@@@Z)
The file "libmatpm.lib" is a static library that is also kind of dated. Is
there any way I can avoid these errors without recompiling my static
libraries, because I don't have access to them?

Thanks in advance,
Brett


User submitted from AEWNET (http://www.aewnet.com/)
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jack1728 | last post: by
5 posts views Thread by Rick Lemons | last post: by
8 posts views Thread by Rob Edwards | last post: by
9 posts views Thread by Michael Tissington | last post: by
1 post views Thread by Arsalan Ahmad | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.