473,776 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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(dlle xport) and A imports them using
__declspec(dlli mport).

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.
Nov 17 '05 #1
6 1724
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

"Igor Kravtchenko" wrote:
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(dlle xport) and A imports them using
__declspec(dlli mport).

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.

Nov 17 '05 #2
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.


"Todd Aspeotis" <To**********@d iscussions.micr osoft.com> a écrit dans le
message de news: BB************* *************** **...icrosof t.com...
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

"Igor Kravtchenko" wrote:
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(dlle xport) and A imports them
using
__declspec(dlli mport).

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.

Nov 17 '05 #3
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.


"Igor Kravtchenko" <ig**@obraz.net > a écrit dans le message de news:
%2************* ***@TK2MSFTNGP1 2.phx.gbl...
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.


"Todd Aspeotis" <To**********@d iscussions.micr osoft.com> a écrit dans le
message de news: BB************* *************** **...icrosof t.com...
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

"Igor Kravtchenko" wrote:
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(dlle xport) and A imports them
using
__declspec(dlli mport).

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.


Nov 17 '05 #4
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.


"Todd Aspeotis" <To**********@d iscussions.micr osoft.com> a écrit dans le
message de news: BB************* *************** **...icrosof t.com...
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

"Igor Kravtchenko" wrote:
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(dlle xport) and A imports them
using
__declspec(dlli mport).

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.

Nov 17 '05 #5
Igor Kravtchenko wrote:
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.

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
Nov 17 '05 #6

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.


"Ronald Laeremans [MSFT]" <ro*****@online .microsoft.com> a écrit dans le
message de news: eK************* *@TK2MSFTNGP15. phx.gbl...
Igor Kravtchenko wrote:
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.

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

Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1382
by: R Tamilarasan | last post by:
Curiosity made me to install VC - 7 (.net) in my machine which had VC - 6 already installed. I tried to compile my workspace in VC - 7 but failed due to several compile time errors. ok no problems. So I tried to revert back and uninstalled VC - 7 and compiled my workspace in VC - 6. It gave a linker error that "mfc71d.lib" is not found.
2
11194
by: AMT2K5 | last post by:
Hello. When I compile my program I recieve lots and lots of the following message which I am trying to decipher. "xxx was declared deprecated". What exactly does that mean?
5
6053
by: Pradnyesh Rane | last post by:
Hi, I am encountering the following linker error on VC7. LINK : fatal error LNK1171: unable to load ole32.dll This error is only encountered for the "Debug" configuration. The project successfully compiles/links in "Release" configuration. Any help is welcome.
3
1937
by: Ryan | last post by:
My project uses the /ORDER specifier to order functions as specified in file containing the decorated names of packaged functions (COMDATs). I am in the process of upgrading from VC6 to VC.NET 2003. When linking a release build of my project VC.NET 2003, the following warning occurs for each function that is being ordered: SUTL_X86OrderComdats.dat : warning LNK4065: '?SUTL_SomeFunction@@YAXXZ' cannot be ordered; ignored The help for...
4
11338
by: Saran | last post by:
Hi All, I'm getting the following linker error when I try to build a library. nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype nafxcw.lib(filelist.obj) : error LNK2019: unresolved external symbol __mbctype referenced in function "void __stdcall...
9
2014
by: Peter Oliphant | last post by:
For some reson my code is generating a LNK1215 error, which 'suggests' I re-install VS C++. So I did. which did NOT solve the problem. The weid part is it seems to be caused by my one CPP file, but not sure how. It compiled just fine. Then I made a simple change and re-compiled, and got the 1215 error. After that I have to bring back in an old version of the code to make it work again (not fun)... This seems like a REAL LINKER error, not...
0
1755
by: VivekR | last post by:
I have a MFC application developed using VC++ 5. Recently I ported that to VC++ 7.1 and now I am trying to compile the MFC application with /CLR under VC++ 7.1. And I get linker errors referring to one of the libraries that the project uses. Without the /CLR, the project compiles and runs well. There is some library by name task.lib and the code refers to that lib, in the linker step i get the following linker errors:- Task.lib :...
1
2270
by: Felix | last post by:
After porting a project from VC6 to VC.NET 2003 I have a very strange problem generating link error 1104 for import libraries. I just ported the project and made some small adaptions so it fits the new IDE. The project itself links against some import libraries belonging to dll's I wrote (these dll's have been ported too, of course). To keep things simple I only use one import library here. To tell the linker it should link against
1
3293
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly, but throws a load of linker errors
2
2785
by: Oneironaut | last post by:
Hello friends, I have an issue with a linker warning. It is the warning LNK4089. I am working in MSVC6.0 I investigated and this warning tells that the import of the library to which it makes reference is redundant, thus the linker ignores that library in order to make the code smaller. As it is expected, it only appears for release versions.
0
9627
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9922
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8951
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6721
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5492
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4030
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2859
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.