473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Using STL containers in Managed C++

Colleagues,

Perhaps someone could advise me that this is just not possible? I'd like to
have a __nogc * std::vector<int> within a __gc class; this doesn't seem to
be possible. Do I need to manually include libc.lib in the build settings?
I've tried to put all the STL functionality in a private implementation
class that in turn aggregates the vectors (or maps, or whatever) that I
want, and call it, but then the __gc class has to call new and delete for
the implementation class. For example:

__nogc class CImpl; // I have no idea if the __nogc modifier is necessary
or desirable here!

namespace Dummy
{
public __gc class Experiment
{
public:
Experiment();
~Experiment();
private:
CImpl __nogc* m_pIml;
};

Then, of course, the .cpp file for the above class has to look like this:

#include "Impl.h"

Dummy::Experiment::Experiment()
: m_pImpl(new CImpl())
{
}

Dummy::Experiment::~Experiment()
{
delete m_pImpl;
}

I can't imagine anything simpler than this. Nonetheless I get some
mysterious link errors:

error LNK2020: unresolved token (0A000013) exception.__ctor
error LNK2020: unresolved token (0A000014) ??_7type_info@@6B@
error LNK2020: unresolved token (0A000024) exception.__dtor

What on earth does that mean? I'm sure this topic has been much discussed;
someone must know the answer.


Nov 17 '05 #1
0 1528

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

Similar topics

2
by: wtnt | last post by:
Hello, I've been using the STL libraries for some time, but still don't know the ins and outs of its implementation. Could this be because there's more than 1 implementation? Does anyone know of...
0
by: Happosai | last post by:
I am attempting to convert some content layout on a site that I manage from using a table to using CSS, but I cannot figure out how to do it. The following HTML is a simplification of what I am...
6
by: alexhong2001 | last post by:
Does "std::sort" work only with sequence containers, not associative containers at all? Among sequential containers, can it be used with "list", "queue" and other sequence containers besides...
6
by: Mark | last post by:
If you have STL containers (like list, vector,...) in functions as automatic variables, do the nodes that are put on the containers get buffered so they can be reused by later container...
18
by: Matthias Kaeppler | last post by:
Hi, in my program, I have to sort containers of objects which can be 2000 items big in some cases. Since STL containers are based around copying and since I need to sort these containers quite...
4
by: Erik Hendrix | last post by:
Hi, I have a quick question, when one sets the prefetch size = extent size, then when doing a backup we will have 1 agent (db2bm) doing the reads. If we have prefetch size a multiple of extent...
2
by: Bob Beauchaine | last post by:
I found out the hard way that I can't include an STL container in a form object, and spent a half day trying to locate authoritative documentation on exactly why. So far I've concluded from...
11
by: Grischa Brockhaus | last post by:
Hi, I'm trying to produce a div layout containing a header on the top with fixed height, a footer on the bottom using fixed height and a content layer using what's left of the browsers window. ...
4
by: John | last post by:
I'm having a major problem trying to use value types like System::Drawing::Rectangle with std::vector. Is it possible to use STL containers with these type of objects, or am I just doing something...
15
by: Konstantin Andreev | last post by:
I'm almost sure I've found bad bug, but for a while I can't neither confirm nor reject this. If anybody could make an independent test on it's own system, I'd appreciate it very much. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.