When I'm using VC++ 6.0 to link iPP 126.96.36.1998 static library with Generate debug info option, it report fatal error LNK1000. But disable the option to link again, it link well. Why? and How to solve the problem if I need use static library and debug my application simultaniusly?
LNK1000 - Unknown error; consult documentation for technical support options
VC++ 6.0 is a legacy C/C++ compiler and some problems could be expected because IPP 7.x static
libraries could be created with some modern C/C++ compiler.
- Service Packs 5 or 6 for Visual Studio 98
- to compile, link and debugthe code with some modern C/C++ compiler, for example, Visual Studio 2005
( just for verification! )
Would you be able to attach a simple Test-Case witha static library you're using? I have a Visual Studio 98 SP5 and I could do some tests.
But yes, I'm using the Visual Studio 6.0 Service Pack 5. And I do some research about this static library, I found that there is .debug$S section in the library but no .debug$F followed. So I think it's the problem to produce LNK1000 error.
IA-32 for Microsoft* Windows* Compiler Compatibility
- Microsoft Visual Studio* 2010
- Microsoft Visual Studio* 2008
- Microsoft Visual Studio* 2005
Unfortunately, they describe problems with Visual Studio 2008.
1. Could you try to change '/INCREMENTAL' to '/INCREMENTAL:NO'?
2. Could you try to install SP6 for Visual Studio 98? ( There is a little hope that it will fix the problem ).
By the way,a Linker version installed with VS98on my test laptop is 6.00.8447.
Thank you for your help, and I solve the problem finally. Just like I said that there are .debug$S section but not seen .debug$F section after, and I write a small program to modify .debug$S section to .data section, and everything is allright. It build well, and I can turn on Generate debug info option and also /INCREMENTAL. And no need to use higher modern compiler or linker just VC++ 6.0 SP5. Thanks again.
PS. Because of this research, I wrote a program can Compact my static library atfer link iPP static library, because just link iPP static library is too large.
Before Compact is 108MB
After Compact is 1.61MB
I don't use a static linking but I think developers who use the static linking ofIPP libraries could be
interested to learn more about the problem. You stated that:
...I write a small program to modify .debug$S section to .data section...
Do you mean that your 'small program'opened a static library file in a 'binary' mode and chaged all
'.debug$S' expressions to '.debug$F'? Is that correct?
I'm sorry for answering your question so lately, and opened a static library file in a 'binary' mode is corret, and changed all '.debug$S' expressions to '.data' of IMAGE_SCN_CNT_INITIALIZED_DATA|IMAGE_SCN_ALIGN_16BYTES|IMAGE_SCN_MEM_READ|IMAGE_SCN_MEM_WRITE(0xC0500040) characteristics. I think that correct method is insert a '.debug$F' section after '.text' section, but it'll correct all sections which relate with these section's number.
I understood that your modifications are related toa 'Characteristics' member of IMAGE_SECTION_HEADER structure (declared inWinNT.h header ).
typedef struct _IMAGE_SECTION_HEADER
and some functions fromImageHlp or DbgHlp APIhave beenused.
Yes, you're right butI just need a static library including iPP to link with my old program in Visual C++ 6.0. TheiPP static library does have security cookies, but can write a empty code to link with.Just replace the section talked before and LNK1000 Error is disappear(Generate debug info option is on). Attach a ijl20l.lib below which you can try to link with Visual C++6.0.
the approach you use is the hackers' one - it will not work correctly for all intended cases of library use - the official way is to use a patch from Microsoft - just install http://support.microsoft.com/kb/949009 and you'll be able to use old linker version with the latest IPP libraries
I take a lookat the link http://support.microsoft.com/kb/949009and it just fix VS2005 SP1 not Visual C++ 6.0, and download the files in the page then installedbut it appeared installation error. Beacuse I didn't install VS2005, the installer cannot find VS2005 to patch. I know that my approach is not very correct, but I cannot let Intel to release the iPP static librarycompatible with Visual C++ 6.0. So It's the shortcut to solve the problem, isn't it?
I also couldn't find an update or a fix for VS98. Regarding a link provided by Igor. This is what it says:
You must have Visual Studio 2005 SP1 installed to apply this hotfix.
If Andy's fix works for him this is a great thing even if itlooks like a hack ( and really is! ).