PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Boring stuff...

I have decided to include STL into our new project, since it gets tiresome to reinvent the wheel, which we had to do on our last project. Own string classes, own containers and so on.

I have downloaded the latest version of stlport 4.5.3, uncommented the _STLP_NO_OWN_IOSTREAMS define, added the directory to the include files section.

My simple code uses the following:

Code:


#include <vector>
...
std::vector<int> v(10);


The compiling goes well, but the linking gives me:

teststlport.obj : error LNK2019: unresolved external symbol "private: static void * __cdecl _STL::__malloc_alloc<0>::_S_oom_malloc(unsigned int)" (?_S_oom_malloc@?$__malloc_alloc@$0A@@_STL@@CAPAXI@Z) referenced in function "public: static void * __c
decl _STL::__malloc_alloc<0>::allocate(unsigned int)" (?allocate@?$__malloc_alloc@$0A@@_STL@@SAPAXI@Z)
ARMDbg/teststlport.exe : fatal error LNK1120: 1 unresolved externals

Whheea!

Any one have any ideas?

I would really like to be able to setup a dev environment of stlport, evc and visual studio .net any one that have done that?

/Okku
are you sure your project is correctly set up to find STL? The errors look just like the ones I had with PocketFrog when I did not have the correct settings for directories.
No I am not sure that everything is correct setup.

What I am aware of is that you don’t have to build stlport separately, just add the path to the options-tools-directories-include files, which I have done.

(If I remove that path from the include files I get an error when I compile: cannot open include file 'vector' which seems to be correct).

But its complaining when I link... do I have to something more? Do I have to add some files to the project.
If you do a search on the PocketFrog forum looking for STL you will see several posts re: STL including some re: link errors. You may find a solution there
I have/had the same problem... even though I do have STL installed correclty (enough) to compile the pocketfrog library. I don't know what's the difference - and what compiler defines are killing the link process.

I finally gave up and installed a different STL package from here:
http://www.syncdata.it/stlce/index.html

I set up the include path to this one, and the project compiled and linked just as expected.
Thanks for the suggestion but, I need to get stlport to work, since i am doing my development mainly on PC, and just compiles sometimes to ppc, just to test.

It feels better if the code base is the same, even if STL should follow some standards.
I believe I ended up installing STLport in eVC3 for PPC development, but used the built-in STL in VS6 for PC development. I think I had problems getting STLport to work on PC (even though it should be easier than PPC!).

I can't quite recall, but I could spend a couple of minutes looking at my setup if that helps you. I think I just followed the installation instructions.
I have got stlport working in vc++ 7.1 now, I just installed the newest snapshot 4.5.1020.

But 1020 won’t link either in evc, I get the same error.

I have searched on google and found out that people compiling with stl on linux can run into the same problem if they use gcc instead of g++. Eh, I don’t know how to apply that knowledge in my environment.

I have also found out that the function _S_oom_malloc is defined in stlport\stl\_alloc.c. I really don’t understand how that file gets compiled since its not included in my project.

This drives me crazy!

Could someone who has STL (4.5.3) up and running in eVC (3.00.0099), share some knowledge?

The only define I have in stlport\stl_user_config.h is:

#define _STLP_NO_OWN_IOSTREAMS 1

I have no other references to STL than in the tools-options-directories-include files where I have added the following path last:

C:\DEV\STLPORT-4.5.3\STLPORT

Thanks in advance (again)…
I have one of those "dumb" questions to ask. In the file you are working with STL... is the file extension .C or .CPP ? Sometimes when you have link errors it is because the compiler is not (or is) mungling the naming.
Pejo Software - Per · 02 Nov 2003, 22:04 UTC
Replace:
#define _STLP_NO_OWN_IOSTREAMS 1

with:
#define __STL_NO_IOSTREAMS 1
#define _STLP_NO_NEW_IOSTREAMS 1
Weehhhaa!

IT WORKS!

Thank you Per :)

Another question:
Does anyone get IntelliSense to work with STL?