Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1246
  • Last Modified:

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

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
Winsearch
Asked:
Winsearch
  • 3
  • 3
1 Solution
 
ZoppoCommented:
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
 
itsmeandnobodyelseCommented:
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
 
WinsearchAuthor Commented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
itsmeandnobodyelseCommented:
>>>> 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
 
WinsearchAuthor Commented:
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
 
itsmeandnobodyelseCommented:
>>>> 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
 
WinsearchAuthor Commented:
I found the wrong DLL (it was 32 bit) and it worked! Thanks for your help!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now