Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2007

Tip: Looking for answers? Try searching our database.

library and pure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dragonslayer008@hotmail.com - 18 Sep 2007 04:14 GMT
I am building a control library in C++/CLI.  My project links with a
native library and am getting an error that the library cannot work
with pure:

dxerr.lib(dxerr.obj) : fatal error LNK1313: ijw/native module
detected; cannot link with pure modules

I am fine switching to CLR mode, but I have a question.  If I build
the control library DLL in CLR mode, will it still integrate
seamlessly into C#/VB projects?  Or will I have to change compiler
switches in the C#/VB projects as well?
Ben Voigt [C++ MVP] - 21 Sep 2007 00:09 GMT
>I am building a control library in C++/CLI.  My project links with a
> native library and am getting an error that the library cannot work
[quoted text clipped - 7 lines]
> seamlessly into C#/VB projects?  Or will I have to change compiler
> switches in the C#/VB projects as well?

It will work just fine.  However, if you want to debug through the C++/CLI
code, you'll have to set "Enable native debugging" in the main application
(probably C#/VB).
Carl Daniel [VC++ MVP] - 21 Sep 2007 00:45 GMT
> I am building a control library in C++/CLI.  My project links with a
> native library and am getting an error that the library cannot work
[quoted text clipped - 7 lines]
> seamlessly into C#/VB projects?  Or will I have to change compiler
> switches in the C#/VB projects as well?

As Ben already replied, it'll work fine with C#/VB - the language of the
host application is not an issue.

The important difference between /clr, /clr:safe and /clr:pure is the amount
of trust required to run the resulting program.  /clr:safe requires the
least trust, as the resulting assembly is pure and verifiable.  /clr:pure
requires more trust because the assembly is not verifiable, and /clr
requires still more because the assembly contains mixed managed/native code.

-cd
Ben Voigt [C++ MVP] - 24 Sep 2007 23:19 GMT
>> I am building a control library in C++/CLI.  My project links with a
>> native library and am getting an error that the library cannot work
[quoted text clipped - 17 lines]
> /clr requires still more because the assembly contains mixed
> managed/native code.

I think /clr and /clr:pure are equivalent trust-wise: both require
FullTrust.  But /clr:pure is processor-independent, that is to say that it
can be JITted to 32-bit or 64-bit as needed, while mixed-mode /clr
assemblies have bitness determined by the native code.

Also /clr:pure executables can be loaded as libraries, while mixed-mode
executables have the relocation segments stripped and can only be the main
process.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.