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++ / March 2005

Tip: Looking for answers? Try searching our database.

Linker error under VC++ .NET between an .exe and a .lib

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Igor Kravtchenko - 06 Mar 2005 01:23 GMT
Hi,

I'm having a pretty idiot problem under VC++ .NET but cannot solve it.
I have an .exe A and a dll B.

A uses some methods of B (so A depends of B).

B exports its methods using __declspec(dllexport) and A imports them using
__declspec(dllimport).

If I manually link A with B, everything works.
If I set a dependency using "Project Dependencies" as I was used under
Visual C++ 6.0 I have a bunch
of link errors.

It seems the "Projet Dependencies" of Visual .NET just sets the order of
build but doesn't explicitly
*links* project to others.

Any remark is welcome,

Igor.
Todd Aspeotis - 06 Mar 2005 02:01 GMT
I've never used __declspect(dll_import). And setting it through project
dependencies works for me. What I do is have a header file for my DLL project
and just include that. During compilation, the linker just looks through my
LIB file, finds the reference to the function I called, and it's all good.

Have you tried creating a simple 2x project solution and testing it using
only project dependencies and your dll_export/import method?

Best of Luck,
-- Todd Aspeotis

> Hi,
>
[quoted text clipped - 18 lines]
>
> Igor.
Igor Kravtchenko - 06 Mar 2005 13:51 GMT
Hi,

yes I've created a very simple 2x project to have a school's case.

Linking the .lib explicitly works.
Don't link explicitly but set a project dependencies fails although the
project build order is correct.

Crazy...

Igor.

> I've never used __declspect(dll_import). And setting it through project
> dependencies works for me. What I do is have a header file for my DLL
[quoted text clipped - 32 lines]
>>
>> Igor.
Igor Kravtchenko - 06 Mar 2005 14:44 GMT
The funny thing is when I add /VERBOSE:LIB to find out what libraries the
linker searchs I don't see my "b.lib".

Igor.

> Hi,
>
[quoted text clipped - 45 lines]
>>>
>>> Igor.
Igor Kravtchenko - 06 Mar 2005 16:23 GMT
Ok, I think I've found the problem.

The link dependencies seems to behave extremely weirdly on multi drives.
Indeed in my previous example the generated file was on c:\ whereas
the project was on d:\.

Putting all on the same drive solves the problem.

Igor.

> I've never used __declspect(dll_import). And setting it through project
> dependencies works for me. What I do is have a header file for my DLL
[quoted text clipped - 32 lines]
>>
>> Igor.
Ronald Laeremans [MSFT] - 07 Mar 2005 18:54 GMT
> Ok, I think I've found the problem.
>
[quoted text clipped - 5 lines]
>
> Igor.
If one of the dxrives is FAT with it's 2 second resolution in time
stamps and the other is NTFS, that is one reason why this might happen.
If both are NTFS, we would love to see a repro case (and that repros
after a clean build).

Ronald Laeremans
Visual C++ team
Igor Kravtchenko - 08 Mar 2005 22:23 GMT
Both are FAT32.
The funny thing is it doesn't work only my system.
At work, I have pretty the same PC but there, it works.

Crazy...

Igor.

>> Ok, I think I've found the problem.
>>
[quoted text clipped - 12 lines]
> Ronald Laeremans
> Visual C++ team

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.