Solved

How to force multiple symbol definitions and create output(a static lib) in VS2008 (64-bit release build)

Posted on 2008-10-01
7
1,214 Views
Last Modified: 2013-12-14
I am trying to build a static lib and getting the following warning :
__NULL_IMPORT_DESCRIPTOR already defined.
This is because I need to use the other dependency libs while building this static lib. I want to ignore this warning and create the static lib. I am using VS2008. The debug build succeedes. But my release build is failing even if I give /igonre:4006. (This symbol definition is coming from some system libs which I can not modify and I need them)
0
Comment
Question by:Winsearch
  • 3
  • 3
7 Comments
 
LVL 30

Expert Comment

by:Zoppo
ID: 22651386
Hi Winsearch,

take a look at the accepted solution of http://www.experts-exchange.com/Programming/Languages/C/Q_21669920.html - maybe this helps you to solve the problem ...

Hope that helps,

ZOPPO
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 22652550
Can you post all libs you were using?

I assume you have some 32bit libs involved where you definitively should use the 64bit version only.

Note, a static library must not necessarily link system libraries. It should be sufficient to link these libraries with the executable (dll or exe) that uses the static lib.
0
 

Author Comment

by:Winsearch
ID: 22657052
Thanks for the comments.
Only one lib is explicitely added, which is vssapi.lib(64-bit). None other is added as "dependency". Others are default ones that get linked. If I remove vssapi.lib, the lib gets created but the final DLL (which is linked with this static lib and vssapi.lib) does not get loaded.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 22657872
>>>> but the final DLL (which is linked with this static lib and vssapi.lib) does not get loaded.

Can you show the errors? I assume it is (one of) the default libraries where there is a 32/64 bit conflict.
0
 

Author Comment

by:Winsearch
ID: 22662225
RegSvr32 Error is: "LoadLibrary Failed(<path>): The specified procedure could not be found"
The same DLL compiled as debug version (where vssapi.lib is directly linked with static lib) gets loaded properly.
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 125 total points
ID: 22664724
>>>> RegSvr32 Error

That isn't a linker error but a registration error. It means that *at runtime* one of the dlls which was dynamically loaded by means of LoadLibrary could not be found.

>>>> The same DLL compiled as debug version gets loaded properly.

Actually that proves nothing. The error either means that one of the dlls loaded dynamically was not available at all, e. g. you have only the debug version built *or* the release version could not be found (e. g. it was built in a different folder which was not part of the PATH environment variable) *or* the name of the release dll differs from that used with LoadLibrary.

Does your code contain any dynamically loaded dlls? Or is it a problem of the vssapi.dll where the release dll has a different name or was not stored in a folder whcih was part of PATH?
0
 

Author Comment

by:Winsearch
ID: 22707469
I found the wrong DLL (it was 32 bit) and it worked! Thanks for your help!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now