Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: rhapsody lib in visual studio
Topic Summary:
Created On: 20-Jul-2005 08:13
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 20-Jul-2005 08:13
User is offline View Users Profile Print this message


Anna Sjoberg

Posts: 2
Joined: 20-Jul-2005

Hello!
Does anyone know how to link a rhapsody lib with a Win32 project in vc++.NET?
I include the following rhapsody libraries (apart from my own LibComponent.lib) in visual studio:

MSoxfinst.lib
MSomComAppl.lib
MSaomanim.lib

These libraries seem to work with MFC projects but not with any other kind of projects.
I am receiving many link errors, an example:

msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >erator<<(int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@Q AEAAV01@H@Z) already defined in LibComponent.lib(Default.obj)


Appreciate an answer

Anna
Report this to a Moderator Report this to a Moderator
 22-Jul-2005 15:58
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Anna

Perhaps this is something to do with the VC++ "Runtime Library" options. I have a Win32 VC++ .NET app which had the following similar link error:

(MSVCP71D.dll) : error LNK2005: "public: virtual __thiscall std::basic_ostream<char,struct std::char_traits<char> >::~basic_ostream<char,struct std::char_traits<char> >(void)" (??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in libcpmtd.lib(cerr.obj)

The problem here was that my application was compiled with the "Multi-threaded Debug" runtime library option, but the Rhapsody libraries are built with the "Multi-threaded Debug DLL" runtime library option. So my code expected to statically link with the static VC++ standard libraries (libcmtd.lib and libcpmtd.lib), while the Rhapsody library code expects to statically link with the Visual C++ standard library DLL stubs (msvcrt.lib and msvcprt.lib.) When both sets of standard libraries were linked in, they clashed, causing the error.

If you haven't already done so, you should make sure your VC++ .NET project is built with the same option (/MDd) as the Rhapsody libraries. You can set this in the Project Property dialogue, under Configuration Properties\C/C++\Code Generation. (See the enclosed screenshot.)

MFC applications use /MDd by default, which is probably why you didn't see the error with MFC.


I'm not sure if this alone would explain your problem: I'm still confused by the "already defined in LibComponent.lib(Default.obj)" part of your link error. (Do you have any idea why std::basic_ostream might be defined in Default.obj?)

Let me know how you get on.

regards,
Simon

Win32_MDd.gif
Win32_MDd.gif  (14 KB)



-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 25-Jul-2005 12:46
User is offline View Users Profile Print this message


Anna Sjoberg

Posts: 2
Joined: 20-Jul-2005

Hi Simon!
That worked very well! I had changed the runtime libraries before , but only in rhapsody to match with the one in visual studio, but that did not work. When changing, as u suggested, in visual studio to match the library in rhapsody, rather than in the opposite direction, it worked.
So thankyou very much!
Much appreciated
Anna
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.