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 / C++ Libraries / October 2005

Tip: Looking for answers? Try searching our database.

How to link a .lib file to a C++ project(managed C++, to build dll

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
VicVic - 06 Oct 2005 23:32 GMT
Hello,

I am trying to build an dll in .Net, using managed C++. But i need to use
another dll in my project. I have the xxx.dll file and xxx.lib file. But i do
not know how to set my project to link it to my project.

I know how to do that in Visual Studio 6.0 C++, in Project Settings--->Link,
add "/libpath:../../lib" under "Project Options" and add xxx.lib under
"Object/library modeules". But i do not know how to do this in .Net. I am a
newcomer in .Net

Thanks for your help!

VicVic
Marcus Heege - 07 Oct 2005 19:37 GMT
You can do the same as in VS6: #include the DLL's header and add the import
lib to the linker's input.Once you have done that, you can call the
functions as before.

The compiler and the linker are smart enough to generate interop metadata
for all native functions you call from managed code.

Marcus Heege

> Hello,
>
[quoted text clipped - 13 lines]
>
> VicVic
VicVic - 08 Oct 2005 19:27 GMT
Hello Marcus,

Thank you very much for your help.
I #include the xxx.h in my application's .h file, and i set the library
path, then i added the import lib in the input, but i still have link errors
each time i am tying to call the functions from xxx.dll. Please let me know
if there is any place i made mistakes.
Thanks again for your help and have a great weekend!

Vic
------------------------------

> You can do the same as in VS6: #include the DLL's header and add the import
> lib to the linker's input.Once you have done that, you can call the
[quoted text clipped - 22 lines]
> >
> > VicVic
Marcus Heege - 08 Oct 2005 22:53 GMT
I assume your problem is not related to IJW. Are you sure your header files
/ input libs would be sufficient in a native project?

If not, you first have to find the correct .lib or .obj files to add as
input sources or the corrent headers to include.

Marcus

> Hello Marcus,
>
[quoted text clipped - 40 lines]
>> >
>> > VicVic
VicVic - 11 Oct 2005 20:45 GMT
Hi Marcus,

Thanks for your time. I followed your suggestion and checked carefully of
the project i built. I found that the .lib file was changed because of the
mistake of my old settings which wrote to xxx.lib (exported, with exactly the
same file name xxx.lib).
This made me confusing because i did succeed once, and later always have the
link errors. I created the xxx.lib file and had been trying to use the
xxx.lib that i created, not the original one i should use!
When i was trying to use the wrong xxx.lib file, it could not find and link
the functions i need to call, which caused the problem.

Now i copied the original xxx.lib file again and i can compile my project
without any error.:)

I sincerely appreciate your time and patience.  Thanks a lot.

Best regards,

Vic

> I assume your problem is not related to IJW. Are you sure your header files
> / input libs would be sufficient in a native project?
[quoted text clipped - 48 lines]
> >> >
> >> > VicVic

Rate this thread:







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.