473,655 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug/release libs

Dear all,

I have following problem. I created a static libruary (mylib.lib).

I compiled it with Multithreaded DLL runtime in release mode. Now I want to
give out this library. But users who use it should be able to debug their
programs (i.e. compile their programs in debug mode Multithreaded DLL DEBUG
runtime ).

But at link time following warning is shown and prog crashes. Do I have to
give out both debug and release?

Thanks a lot,

Boni

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:li brary
Feb 27 '06 #1
6 2274
> I have following problem. I created a static libruary (mylib.lib).

I compiled it with Multithreaded DLL runtime in release mode. Now I want
to give out this library. But users who use it should be able to debug
their programs (i.e. compile their programs in debug mode Multithreaded
DLL DEBUG runtime ).

But at link time following warning is shown and prog crashes. Do I have to
give out both debug and release?

Thanks a lot,

Boni

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:li brary


If your program allocates memory that is deleted by the user application,
then yes.
This memory allocation can also happen through use of stl parameters and
things like that.

In that case you need to supply 2 libraries to save your users form having
to jump through hoops.
still, in that case you still have the problem that your users need to use
the same compiler version that you used for building the library.

--

Kind regards,
Bruno.
br************* *********@hotma il.com
Remove only "_nos_pam"
Feb 27 '06 #2
Boni wrote:
Dear all,

I have following problem. I created a static libruary (mylib.lib).

I compiled it with Multithreaded DLL runtime in release mode. Now I
want to give out this library. But users who use it should be able to
debug their programs (i.e. compile their programs in debug mode
Multithreaded DLL DEBUG runtime ).

But at link time following warning is shown and prog crashes. Do I
have to give out both debug and release?


You should, yes.

Alternatively, you can compile your code with /Zl to omit the default
library specification from the resulting .obj files (and hence, from the
..lib file). If you've compiled a release build with /Zl, your users should
be able to link against it in both debug and release builds.

-cd

PS: http://msdn2.microsoft.com/en-us/library/f1tbxcxh.aspx
Feb 27 '06 #3
Dear Carl,
if I compile with /ZI user gets following error.

Alternatively, you can compile your code with /Zl to omit the default
library specification from the resulting .obj files (and hence, from the
.lib file). If you've compiled a release build with /Zl, your users
should be able to link against it in both debug and release builds.

Linking...
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/CLRIMAGETYPE'
specification
mylib.lib(eng.o bj) : error LNK2028: unresolved token (0A000006) "extern "C"
void __clrcall ___CxxCallUnwin dDtor(void (__clrcall*)(vo id *),void *)"
(?___CxxCallUnw indDtor@@$$J0YM XP6MXPAX@Z0@Z) referenced in function "void
__cdecl `anonymous namespace'::Rep ortErr(class std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char> >,class
std::basic_stri ng<char,struct std::char_trait s<char>,class
std::allocator< char> >)"
(?ReportErr@?A0 x7e8edfa5@@$$FY AXV?$basic_stri ng@DU?$char_tra its@D@std@@V?$a llocator@D@2@@s td@@0@Z)
mylib.lib(param s.obj) : error LNK2001: unresolved external symbol
"?.cctor@@$$FYM XXZ" (?.cctor@@$$FYM XXZ)
mylib.lib(eng.o bj) : error LNK2001: unresolved external symbol
"?.cctor@@$$FYM XXZ" (?.cctor@@$$FYM XXZ)
....
Debug/fft_flpt.exe : fatal error LNK1120: 5 unresolved externals
Feb 27 '06 #4
Boni wrote:
Dear Carl,
if I compile with /ZI user gets following error.


It looks like you've compiled your test library with /clr and your test
program without /clr, or something like that. I haven't tried using /Zl for
a long time - it's possible that it's no longer usable to build a
debug/release agnostic library as well.

-cd
Feb 27 '06 #5
Dear Carl ,
if I deploy debug build without pdb it is not easier to crack than release
build, isn't it. Im I right that all debug symbols are in pdb.

"Carl Daniel [VC++ MVP]" <cp************ *************** **@mvps.org.nos pam>
schrieb im Newsbeitrag news:%2******** *******@TK2MSFT NGP11.phx.gbl.. .
Boni wrote:
Dear Carl,
if I compile with /ZI user gets following error.


It looks like you've compiled your test library with /clr and your test
program without /clr, or something like that. I haven't tried using /Zl
for a long time - it's possible that it's no longer usable to build a
debug/release agnostic library as well.

-cd

Feb 27 '06 #6
"Boni" <no****@parampa m.pam> wrote in message
news:eI******** ********@tk2msf tngp13.phx.gbl. ..
Dear Carl ,
if I deploy debug build without pdb it is not easier to crack than release
build, isn't it. Im I right that all debug symbols are in pdb.


All debug symbols are in the PDB, yes. That said, debug builds are
considerably easier to reverse engineer than release builds due to the lack
of optimization.

-cd
Feb 27 '06 #7

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

Similar topics

3
1872
by: DE | last post by:
Hello, I have a problem with python builds since some time. On windows, it is not a good idea to link your debug build to release builds of libs and dlls. But python installer gives you only release builds. So I need to build python myself, no problem, but ....
8
2687
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug partially? Something like: fileA.c fileB.c And I can compile fileA.c with debug info and compile fileB.c without debug info?
7
2901
by: Srinivasa Rao | last post by:
I have read in one article that when we compile the application in release mode, all the debug classes and properties will be automatically removed from the code. I tried to implement this thing by using the following code in Page_Load event handler. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim intcount As Integer intcount = 0 For intcount = 0 To 4
9
1992
by: dee | last post by:
Hi I'm about to upload my site and I have switched to release version. Is that enough or do I still need to disable <compilation defaultLanguage="vb" debug="true" /> the debug="true" in the .pdb file? Is the .pdb necessary for the release version? Thanks a bunch. Dara
3
2189
by: | last post by:
Since I need to dotfuscate my exe file anyway, does it make any difference if I use Debug or Release versions. Would a Debug version be easier to decompile/study/reverse engineer than a Release version, both having been dotfuscated by the standard dotfuscator of visual studio 2003 ? Tia
5
4686
by: Bruce | last post by:
I am getting a lot of link errors when compiling in the debug build but not release. I am compiling a CLR managed code class library. I believe the link errors are actually being caused by a static library of unmanagaed code. I think the problem comes from the fact that the unmanaged static lib uses the STL. Any idea how to fix this?
6
9134
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++ project. I then add a class library, and add a reference to this project in the first project. When I do a release build, I see the following in the output from the DLL compile: /OUT:"C:\Documents and Settings\Andrew\My Documents\Visual Studio
4
20332
by: mickey22 | last post by:
Hi all, I am getting linking errors when I run my program in debug mode and the same thing I run in release mode it doesnt show errors..Am I linking wrong libraries in the debug mode?Can they be different from the release mode? LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj) 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)...
3
1981
by: TBass | last post by:
Hello, Is there a way to get Visual Studio 2003 look to one directory for debug version dlls when set to DEBUG and then to another directory where I store the release version of a dll when set to RELEASE? My current project uses about 8 dlls I've written in the past, but I don't want to keep re-compiling them for debug/release depending on whether I'm compiling the current project for debug/release.
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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
8598
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
5627
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
4150
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...
1
2721
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
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
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.