my code doesn't work with portable visual c++6 !!!

Pages: 12
Hi everyone

i have a code written by my friend. i want to use it in visual c++ 6 portable but i can not. when i try to open code in program it doesn't open.

link below have the files.

thanks a lot

https://drive.google.com/drive/folders/112zmM2Xh2RgJ4cJBLNBVRatwzJaPlhoS?usp=sharing
The .cpp file is a valid C++ file. How are you trying to open it? Have you created a solution? What error messages are you getting? It's too long ago that I last used visual c++ 6 to provide the steps required. Can you not install the free MS VS2019 which is the current MS compiler? What OS are you using?

'visual c++ 6 portable'

The 'portable' part of your phrase has me confused. I don't recall such a thing. VC6 was a part of Visual Studio 98. Windows 95, Windows 98, and Windows 2000 were common operating systems in use at that time. Windows CE was also commonly used at that time for smaller devices.
Wow! Whoever wrote that code hates white space more than me! :)

I have an old Windows 2000 laptop that still works. It has VC6 on it. I could test the code with it later if you like?
@seeplus

no it was a pack that visual c ++ 6 is one of them. i can open it but i can not run the code and open it in this program.
Last edited on
@freddie

it was a code for boat design. i have a pack of visual studio 6 about 200 mg but this part visual c++6 is about 20 kb and i am wonder!
I take a photo from all program in visual studio portable 6 in the link below:

https://drive.google.com/file/d/1yctCeoU_Osl0pW5StbDmKpTo71P7VPn4/view?usp=sharing
Give me a minute and I'll see if my old laptop with VC 6 will start and I'll see if the code will build.
I didn't have any trouble getting my old laptop started or VC6 going. Your program built with quite a few warnings but no errors. Here are the warnings....

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Compiling...
Main.cpp
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(21) : warning C4305: 'initializing' : truncation from 'const double' to 'const float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(22) : warning C4305: 'initializing' : truncation from 'const double' to 'const float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(23) : warning C4305: 'initializing' : truncation from 'const double' to 'const float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(24) : warning C4305: 'initializing' : truncation from 'const double' to 'const float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(27) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(3468) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(3468) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(3478) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(3918) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(3918) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(3928) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4799) : warning C4305: '=' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4825) : warning C4305: '=' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4851) : warning C4305: '=' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4912) : warning C4101: 's1' : unreferenced local variable
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4912) : warning C4101: 's2' : unreferenced local variable
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4911) : warning C4101: 'i' : unreferenced local variable
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4911) : warning C4101: 'j' : unreferenced local variable
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
C:\Code\VStudio\VC++6\Projects\Boat\Main.cpp(4999) : warning C4305: 'initializing' : truncation from 'const double' to 'float'

Main.obj - 0 error(s), 35 warning(s)


So I tried to run it and it seemed to lock up. At least the Task Manager showed 100% CPU usage. I let it run for five or ten minutes before I ended it through Task Manager. Maybe it simply wasn't done yet - I don't know. Got tired of waiting on it. There was a small amount of console output however. This is what showed up on my screen.....

Program is running...

Step 1: hull modeling

step 2: stern modeling

step 3: defining elements of hull and stern
------------------------------------------------------------------------------
step 4: determining underwater elements of hull and stern

step 5: determining waterline

If you need help with the code someone else will have to help you further as I've never made much use of the C++ specific part of the C++ Standard Library, not to even mention boat engineering!. I basically use my own custom library code. I will comment on the warnings about truncations from doubles to floats. I don't believe C++ folks use four byte floats much anymore. I'm pretty sure the compiler uses 8 byte doubles for calculations.
@freddie1

thanks thanks thanks man for your help. that's it. but I want to run c++6 in windows 10 (64 bit). can you help me with this ?
i think that your old system is 32 bit. isn't it?

do you have a link for c++6 for win 10?
If you are using Windows 10, just download/install MS VS2019 community. It's free. This will give the latest C++ compiler, a much better IDE etc etc

If you really, really want to use the unsupported/discontinued C++6 then it's available for download from the internet. Do a search for 'visual C++6 download' and look for archive.org. There are plenty of instructions available on the Internet as to how to install VS 6 with Windows 10 (Tip - you can't just just install with all the options).

But again, forget about C++6 and use VS2019 with Windows 10.
https://visualstudio.microsoft.com/downloads/

Last edited on
No problem with the help. I enjoyed starting up that old program. I used VC6 for many, many years. Same with Win 2000.

Yes, x64 didn't really get much use until Windows Vista or Windows 7 around 2008 or so. At the time of VC6 everything was 32 bit. I expect you would be able to get that code working in 64 bit without too much trouble. I did attempt a test build with an old version of the Mingw GCC build chain. I used CodeBlocks 8.02 circa 2008 or so (that's what was on that old laptop). There were a lot of warnings and errors. The errors were ones I had seen before. Mostly ambiguous overload errors.

Like seeplus said, Visual Studio 98 which includes VC6 is slightly problematic for installing on anything newer than Windows XP. You've got to search the internet for instructions. The last operating system I installed it on was Windows 7. If my memory serves me correctly there were steps that had to be taken to prevent an ancient version of Java being installed over newer versions and dependencies. But maybe that only had to do with Visual Basic 6, which I also used heavily.

It just occurred to me....I think I have VC6 installed on an XP Mode within my Windows 7 laptop, which I mostly use for coding yet. I forgot about that!

You'll just have to decide which route you want to follow in terms of getting VC6 to work, or downloading Microsoft's newer versions.
https://www.codeproject.com/Articles/1191047/Install-Visual-Studio-on-Windows

It is possible to install VS 6 on Win 10, it is a hack.

I tried the OP's code (which "mysteriously" has disappeared from the google repository) with VS 2019. There were a LOT of warnings and IIRC 6 actual reported errors.

void main? VS 2019 didn't report that as a error, but it hasn't been legal C++ (and C) for quite some time. Since C++98.

I didn't notice if it was one of the numerous warnings, there were so many. They were a wall of text.
Last edited on

It is possible to install VS 6 on Win 10, it is a hack.


Just read through that article quick FurryGuy and I've gotta agree with you. I'm not sure I'd want to bother with it. I've the Enterprise Edition of Visual Studio 98, which, if I recall, was like an $800 or $1000 purchase (my old employer bought it for me). And unlike so many here, I'm not at all adverse to using old versions of things. I still mostly build with the x64 VC15 build chain which came with Visual Studio 2008. But I also test with VC19 on Windows 10. It doesn't make too much difference. Just more bloated binaries with each version Microsoft churns out, but that doesn't bother me as I use my own custom runtime which eliminates the bloat.

I'd be inclined to recommend to the OP to just download Microsoft's latest compiler and use that rather than fooling around with VC6. I mean, somewhere you've gotta 'draw the line' and move on, no matter how much one clings to older things. I finally had to give up on DOS, much as I hated to.

Place to begin likely would be converting all the floats in that program to doubles. Like I said, the compilers nowadays do internal calculations using doubles - that's why all those truncation warnings casting from doubles to floats. And when I did a test build with Mingw - GCC, I recall seeing a lot of the actual errors were 'ambiguous overload' errors involving C Runtime pow(), which takes type double parameters. In my coding career I've oftentimes switched between Microsoft's compilers and GCC. If I recall GCC tends to be stricter than MS and usually requires casts where MS compilers will let some stuff pass. Maybe that's changed with the newer MS compilers.

But if that code still has value and utility (it most likely does), it might be a better use of your time to update the code itself to build x64 on the newer compilers, rather than fighting trying to get VC6 to work on 2020 operating systems.

The OP code has now gone from the link specified in post #1 - it's now just a .png file!
@freddie1, that article I linked was one of the simpler to understand and follow. There are others that are even more of a major hack.

As I said, before the OP "disappeared" his code I tried it in VS 2019 and it had about 6 compile errors.

I could be more definite about what needs to change if the OP hadn't removed his code. I tried just for giggles, and deleted it soon after. I didn't see much need at the time to keep it.
I found a copy of the OP's source and plugged it into a VS 2019 solution. 40 messages, 194 warnings, and 8 errors.

The 8 errors because the code uses POSIX (Linux) functions (rmdir, mkdir) instead of using C/C++ compliant functions.

A lot of uninitialized variables, a lot of arithmetic overflows, possible loss of value when assigning to different data types, a lot of ignoring return values, etc.

A whole lot of old and messy code. Nothing that can't be fixed with a bit of effort.

And yes, VS 2019 issues a warning that void main is the wrong return type.
I think the OP's legit FurryGuy. Just seems a tad desperate to get some old rusty code working.
Sometime back Microsoft replaced things like rmdir(), mkdir() with leading underscore versions (_rmdir()) saying that these changes made the functions C++ standard compliant as implementation defined functions.

@Furry Guy

thanks a lot man. your link was very useful and finally i install visual studio 6 on Win 10.
my code worked.

i want to thanks from other guys.

Pages: 12