Visual C++ 9.0 and static lib in release

A

arivero

Hello,

I am building with Visual C++ 9.0 an static library (not dll) that
uses only STL (basically vectors, maps and strings).

My purpose is to distribute this library as an evaluation. In short, I
have to compile my static lib in release mode because I don't want to
open the library code (not for this evaluation version).

However, I would like to allow that other C++ developers can create
their own programs in debug mode linking with my library in release.

My problem comes when I do some test and act in the role of the
developers. For that I create a program in debug (it uses debug CRT)
and I link with the static library (that uses release CRT). All
compilation is ok, but when I run the program in debug it fails with a
memory crack caused for the STLs. Problems are for example when I use:

std::string str = "hello"

I know the problem is in mix debug and release versions with STL, if I
don´t mix both modes all works fine, but I cannot distribute my static
library in debug. So I have a problem when users wat to build programs
in debug.

So, this is my question... how can I distribute only one copy of my
static library without any debug information and without cracks :) for
the users can link with it in debug or release?

Thanks in advance
 
A

Andrea

arivero said:
Hello,

I am building with Visual C++ 9.0 an static library (not dll) that
uses only STL (basically vectors, maps and strings).

My purpose is to distribute this library as an evaluation. In short, I
have to compile my static lib in release mode because I don't want to
open the library code (not for this evaluation version).

However, I would like to allow that other C++ developers can create
their own programs in debug mode linking with my library in release.

My problem comes when I do some test and act in the role of the
developers. For that I create a program in debug (it uses debug CRT)
and I link with the static library (that uses release CRT). All
compilation is ok, but when I run the program in debug it fails with a
memory crack caused for the STLs. Problems are for example when I use:

std::string str = "hello"

I know the problem is in mix debug and release versions with STL, if I
don´t mix both modes all works fine, but I cannot distribute my static
library in debug. So I have a problem when users wat to build programs
in debug.

So, this is my question... how can I distribute only one copy of my
static library without any debug information and without cracks :) for
the users can link with it in debug or release?

Thanks in advance

little use to ship a lib for linking in debug mode if you don't
include debug symbols... anyway, try asking in a vc-related group, no
big chance to get a reply here (you should look for language-specific
help here, not for compiler- or platform- specific stuff)
 
B

Bo Persson

arivero said:
Hello,

I am building with Visual C++ 9.0 an static library (not dll) that
uses only STL (basically vectors, maps and strings).

My purpose is to distribute this library as an evaluation. In
short, I have to compile my static lib in release mode because I
don't want to open the library code (not for this evaluation
version).

However, I would like to allow that other C++ developers can create
their own programs in debug mode linking with my library in release.

My problem comes when I do some test and act in the role of the
developers. For that I create a program in debug (it uses debug CRT)
and I link with the static library (that uses release CRT). All
compilation is ok, but when I run the program in debug it fails
with a memory crack caused for the STLs. Problems are for example
when I use:

std::string str = "hello"

I know the problem is in mix debug and release versions with STL,
if I don´t mix both modes all works fine, but I cannot distribute
my static library in debug. So I have a problem when users wat to
build programs in debug.

So, this is my question... how can I distribute only one copy of my
static library without any debug information and without cracks :)
for the users can link with it in debug or release?

You have to distribute a debug version if you want it to be usable in
debug mode. For the VC series of compilers, the debug symbols are NOT
in the lib file, but in a separate debug info database. Just don't
ship that file!


Bo Persson
 
A

Andrea

Bo said:
You have to distribute a debug version if you want it to be usable in
debug mode. For the VC series of compilers, the debug symbols are NOT
in the lib file, but in a separate debug info database. Just don't
ship that file!

lucky the OP that got the answer here, and lucky me that I ignore the
details of vc stuff :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top