Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h (http://www.velocityreviews.com/forums/t453908-getting-msvc-to-compile-proper-unix-stuff-like-hash_map-fts-h-dirent-h.html)

collection60@hotmail.com 05-09-2006 07:33 PM

Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
I've been developing some Unix based shell tools.

They work fine on Linux and MacOSX.

I want to compile them on Win32. But I can't get hash_map to compile. I
tried downloading stl (and stlport) which is supposed to work in MSVC,
but it doesn't, it just generates tons of errors for stuff that used to
work just fine.

Where do I get fts.h to compile and dirent.h compile?

Is there some kind of Unix-like library or wrapper for Windows? Or must
I port all of that code to win32 code?

Or am I just asking a silly question? Is it too much to ask to get
stuff like dirent.h?

I guess I was just assuming, that seeing as stuff like fopen works just
the same on Windows as it does on Unix, that fts.h should work the
same. Was that a very bad assumption?


Ajay Kalra 05-09-2006 07:40 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
Whats wrong in using hash_map that comes with VC? In VS2003/VS2005 this
has moved from std to stdext namespace:

http://msdn.microsoft.com/library/de...tNamespace.asp

---
Ajay


collection60@hotmail.com 05-10-2006 09:44 AM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
Well, I didn't know they existed. I compiled the Unix code that shoudl
have compiled, but MSVC didn't recognise the hashmap include, so I
guessed it doesn't exist.


collection60@hotmail.com 05-10-2006 04:15 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
I'm using MSVC v6, and I don't see any std or stdext folder in my
includes folder.

What's the exact #include line I should use?


P.J. Plauger 05-10-2006 04:19 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
<collection60@hotmail.com> wrote in message
news:1147277748.802160.170210@v46g2000cwv.googlegr oups.com...

> I'm using MSVC v6, and I don't see any std or stdext folder in my
> includes folder.
>
> What's the exact #include line I should use?


That version doesn't have hash_map. You can license our upgrade
library, which works fine with V6 and include hash_map/set. Or
you can get STLport for free. I believe the "formal" release
version available at their web site installs easily enough with
V6. The newer version that you get from sourceforge may be a
bit trickier, but it is newer.

HTH,

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com



Ajay Kalra 05-10-2006 04:23 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
stdext is for VS2003 and VS2005(as I had mentioned). If you are using
VC6 w/hash_map, you will probaly either get Dinkumware's STL version
for that compiler or go with STLPORT as you were doing.

---
Ajay


collection60@hotmail.com 05-10-2006 06:40 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
stlport doesn't work though.

I tried installing it, and it just gives a million errors.

I put it into an stlport directory, added the stlport directory to
MSVC's include directories, and it just gave a million errors. It was
worse than without having stlport.

Also, the instructions for install aren't very good. Do you need to
compile it or not? I'd imagine that if it stlport were made properly,
then you wouldn't need to compile.


Ajay Kalra 05-10-2006 06:50 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
I have been using VS2005 and subsequently dont use STLPort. It worked
fine for us in VC6. It does not need any compilation as its nothing but
collection of template classes.

---
Ajay


P.J. Plauger 05-10-2006 06:51 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
<collection60@hotmail.com> wrote in message
news:1147286438.573266.259910@v46g2000cwv.googlegr oups.com...

> stlport doesn't work though.
>
> I tried installing it, and it just gives a million errors.
>
> I put it into an stlport directory, added the stlport directory to
> MSVC's include directories, and it just gave a million errors. It was
> worse than without having stlport.
>
> Also, the instructions for install aren't very good. Do you need to
> compile it or not? I'd imagine that if it stlport were made properly,
> then you wouldn't need to compile.


Some people have made it work, IME, which is why I felt obliged
to recommend it. But if you want something that works out of the
box, and comes with support...

Depends on what your time is worth.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com



P.J. Plauger 05-10-2006 06:59 PM

Re: Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h
 
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:1147287002.619921.306010@j73g2000cwa.googlegr oups.com...

>I have been using VS2005 and subsequently dont use STLPort.


Right. STLport is inferior to the library shipped with VC++ from
V7 (.NET) onward.

> It worked
> fine for us in VC6. It does not need any compilation as its nothing but
> collection of template classes.


That's one way to use it. But if you want its version of iostreams,
etc. you have to build a binary library.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com




All times are GMT. The time now is 03:33 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.