using vc6(CL.EXE) to compile some C file show error, mspdb60

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Post Reply
air0forceb914
Level 1
Level 1
Posts: 9
Joined: Thu Jun 13, 2019 1:52 pm

using vc6(CL.EXE) to compile some C file show error, mspdb60

Post by air0forceb914 » Thu Jun 13, 2019 2:14 pm

dear advanced user/programers:
when I using wine to run vc++6,(CL.EXE) to compile a C source code copied from book, physics for game developer 1st ed, cannon.c
I got the following 2 errors:
mspdb60.dll (which is needed by L"Z ..... CL.EXE)

and the other (dll related too)

I searched google, some article suggest me to using winetricks to
--------------------------------------------------------------------------(I use ubuntu 19.04 too)-------
Re: err:module:import_dll Library MSVBVM60.DLL???

This is how I THINK I did it-

Command line.....

Installed winetricks (somehow)

$ winetricks

Then "Select the default wine prefix"

OK

Then "Install a Windows DLL or component"

------
here , it showed a lot, then I choose : vb6run (MS Visual Basic 6 runtime sp6)
msvcirt (Visual C++ 6 SP4 msvcirt library; part of vcrun6)
vcrun6
vcrun6sp6

Note: command wine /home/eric/.cache/winetricks/rcrun6/vc6redistsetup_deu.exe /
T:C:windows Temp_msvcirt /
c returned status 199.
Aborting

I clieck OK, then try to do compile again, same errors

please help
thx a lot in advance, eric

User avatar
Bob Wya
Level 12
Level 12
Posts: 2777
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by Bob Wya » Fri Jun 14, 2019 4:19 pm

@ air0forceb914

Please use the forum Code tags to delimit blocks of code/terminal commands:
...

Please also don't post your "edited highlights" of what you're doing.
The less information you supply, the harder it is to help you. :roll:

Your post is quite garbled, but I think I can just about follow what you mean! :shock:

If the source code is short - you're attempting to compile - I would expect a full dump of this (or least a core sample - that replicates your build issue).
I'd also expect you post the full / unedited compilation command you're using (including what dll's you are linking against).

Thanks
Bob

air0forceb914
Level 1
Level 1
Posts: 9
Joined: Thu Jun 13, 2019 1:52 pm

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by air0forceb914 » Sun Jun 16, 2019 3:38 pm

thx your reply; although I can get simple hello world compile and run at wine (now I upgrade to 4.10; arch 32 bit); a little
complicated program, that still make many compile mistakes(that c source code of book, download site also come with its .exe executable code, which can run/work at wine (32 bits both 4.0 and 4.10)) of my ubuntu19.04(64). Here my new compile errors:
----------
wine CL.EXE /I "C:\\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE" cannon.c /link
Microsoft (R) 32-bit C/C++ Standard Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

cannon.c
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\libloaderapi.h(28) : error C2054: expected '(' to follow 'DECLSPEC_HIDDEN'
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\libloaderapi.h(28) : error C2085: 'AddDllDirectory' : not in formal parameter list
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\libloaderapi.h(29) : error C2061: syntax error : identifier 'DECLSPEC_HIDDEN'
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\libloaderapi.h(30) : error C2054: expected '(' to follow 'DECLSPEC_HIDDEN'
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\libloaderapi.h(30) : error C2085: 'SetDefaultDllDirectories' : not in formal parameter list
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\libloaderapi.h(31) : error C2061: syntax error : identifier 'DECLSPEC_HIDDEN'
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\winbase.h(64) : error C2061: syntax error : identifier 'SRWLOCK'
C:\users\eric\My Documents\cis201\Microsoft Visual C++ 6.0 Standard Edition\VC98\INCLUDE\winbase.h(64) : error C2059: syntax error : ';'
--------------------------------------------
----It still have a lot, I just cut short front parts of that compile errors
---------------
Hope to see your (or any experienced programers)'s advice again soon, thx a lot in advance

User avatar
DarkShadow44
Level 7
Level 7
Posts: 943
Joined: Tue Nov 22, 2016 5:39 pm

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by DarkShadow44 » Mon Jun 17, 2019 1:20 pm

Does the same thing work under windows? And is there a free (and legal) version to test with?

User avatar
Bob Wya
Level 12
Level 12
Posts: 2777
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by Bob Wya » Mon Jun 17, 2019 4:57 pm

@air0forceb914

I'm still not seeing any code... If you don't post any source code - we won't be able to help you! :roll:
I would recommend isolating a core of the source, that demonstrates your issue, and posting that.
If the source code is something crazy (that you haven't written)... Then I'd recommend starting with a simpler project!
Don't bite of more than you can chew. :lol:

Also, again, I'll request that you use the forum Code tags, when posting any terminal output / code:

Code: Select all

I AM CODE
I AM TERMINAL COMMANDS/OUTPUT
This is generally respectful thing to do any technical forum... Making your posts much easier to parse (and more likely to be taken seriously).

I've successfully used MS Visual Studio 2010, under Wine, to compile simple C++ source (mainly just to check Wine functionality).
I encountered some issues, that were not Wine related i.e. quirks of Microsoft implementation...
So it's worth checking online - if there are known issues with the Microsoft Visual C++ 6.0 version you are compiling with...

Also is the source code you're working with using a newer standard of C++ - than the compiler supports??
VC98 doesn't inspire great confidence!! :lol:

Bob

air0forceb914
Level 1
Level 1
Posts: 9
Joined: Thu Jun 13, 2019 1:52 pm

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by air0forceb914 » Mon Jun 17, 2019 8:35 pm

I tested a source code written at year 2000, here is website I download, I just test first one cannon.zip

https://resources.oreilly.com/examples/0636920012221

its executable work good(in debug, cannon.exe), on my wine4.0 and wine4.10 32 bit arch, under my ubuntu19.04(64); but I like to tried to compile from its source .c .h source code; I don't mind to use vc6++(vc98) or any other VC; so long it work(successfully compile); my last tested fail is just
winnt.h: fatal error; need to define CONTEXT of your CPU (and some warnings, hope they are trivial)

hope any of you help me on the last step(cpu is core 2 duo T5270; gcc/++8.3 on ubuntu19.04 currently on wine4.10 32bit Arch)

User avatar
Bob Wya
Level 12
Level 12
Posts: 2777
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by Bob Wya » Mon Jun 17, 2019 8:55 pm

air0forceb914 wrote:I tested a source code written at year 2000, here is website I download, I just test first one cannon.zip

https://resources.oreilly.com/examples/0636920012221
...
Rather like getting blood out of a stone... Finally! :roll:
I'll test compile that program tomorrow...
Using Wine and the MS Visual C++ 6.0 Standard Edition compiler...

Thanks
Bob

User avatar
Bob Wya
Level 12
Level 12
Posts: 2777
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by Bob Wya » Tue Aug 06, 2019 1:31 am

@air0forceb914

Sorry I shelved looking into your issue, as I wasn't able to get the application to run successfully.
It was relatively easy to get it to compile. But then it was unable to create the main dialog box.

So I've fiddled about with the Visual Studio 6 built in IDE...
This is generally what you want to use - if you building any Microsoft Windows GUI applications (as opposed to terminal applications).
The Windows Visual Studio command line is extremely painful to use. Using the IDE GUI is definitely the best (of the bad) available options!

You can launch the Visual Studio 6 IDE with:

Code: Select all

... Microsoft Visual C++ 6.0 Standard Edition\COMMON\MSDEV98\BIN\MSDEV.EXE
Then you can create a New->Project->Win32 Application and add the Cannon files to this.

Slightly alter the main cannon.c include files:

Code: Select all

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers

// Windows Header Files:
#define WIN32_DEFAULT_LIBS
#include <windows.h>
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"gdi32.lib")
#include <windef.h>
#include <commctrl.h>
#include <commdlg.h>
#include <wingdi.h>
The working Project Options I (finally) used to actually build a RELEASE version of the Cannon project, were:

Code: Select all

/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fo"Release/" /Fd"Release/" /FD /c 
Again I'll emphasis what I've stated before:
  • This is an awful way to learn how to program; when you are using a Linux System. There are plenty of native Linux development IDE's (I've personally used Qt Creator and KDevelop - these are pretty decent).
    Just Google guides on how to develop games with SDL. Resources for developing applications are often sold cheaply in Humble Bundle's , etc.
  • Don't keep starting new Forum threads - all discussing the same issue. You can see in your latest thread ( :roll: ) that DarkShadow44 has already forgotten that he has replied in your previous thread and therefore won't remember any of the thread context. This is just really dumb and seriously how not to get a sensible answer to any problem...
Bob
Attachments
MS Windows Visual Studio 6 IDE.jpg
MS Windows Visual Studio 6 IDE
Cannon Example Window.jpeg
Cannon Example Window

air0forceb914
Level 1
Level 1
Posts: 9
Joined: Thu Jun 13, 2019 1:52 pm

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by air0forceb914 » Tue Aug 06, 2019 11:15 am

your test is success , but is it run from source code compiled by vc++6; any service pack added/winecfg config?) under wine (with maybe linux or any wine compatiable unix); I follow your advice, choose empty project then open/load
cannon.c, cannon.h, resource.h (to IDE and save it in project cannon directory)
when I build all, it ask to include it as project
then when I excute/run that cannon.exe; can not execute the program
so
need help again

User avatar
Bob Wya
Level 12
Level 12
Posts: 2777
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by Bob Wya » Tue Aug 06, 2019 11:51 am

@air0forceb914

I tested in my existing 32-bit WINEPREFIX with Wine Staging 4.13 (but I doubt that matters much).
Make sure you building a RELEASE build of your project - it should be stored in something like:

Code: Select all

ls -hl 'Microsoft Visual C++ 6.0 Standard Edition/MyProjects/Cannon/Release/'

-rwxr-xr-x 1 robert users  48K Aug  6 06:52 Cannon.exe*
-rw-r--r-- 1 robert users  15K Aug  6 06:52 cannon.obj
-rw-r--r-- 1 robert users 1.1K Aug  6 06:52 resources.res
-rw-r--r-- 1 robert users  33K Aug  6 06:52 vc60.idb
air0forceb914 wrote:... when I build all, it ask to include it as project ...
Not sure what you mean by that??!! :?
That doesn't sound right though... :cry:

Just a create the new project as suggested (Win32 Application).

Then, in the LHS Project control pane...
Add every file, in the Cannon project, to the appropriate FileView tab section:
  • Source Files (*.c)
  • Header Files (*.h)
  • Resource Files (*.rc)
You should be able to examine, and edit, the layout of the Cannon Window GUI, by opening the resources.rc file.
This should take you to the ResourceView tab.

Make sure you set the project to build a RELEASE binary:
Set Active Project Configuration : Canon Win32 Release ( Project->Build->Set Active Configuration... )
You can enable the Build toolbar, so that you can toggle building the RELEASE and DEBUG builds.

Then Build the project with: F7 (Build)

Bob

air0forceb914
Level 1
Level 1
Posts: 9
Joined: Thu Jun 13, 2019 1:52 pm

Re: using vc6(CL.EXE) to compile some C file show error, msp

Post by air0forceb914 » Tue Aug 06, 2019 11:41 pm

my vc++6 probably not properly setup or I did not config it well;
when I tried to open (in vc6 ide) resources.rc
i got error
/~AP954.tmp can not open file access denied

I also test simple hello world.c, by choosing window console-> simple Hello World
when I execute it, it get similar error and
Cannot start tool.
Cannot start tool.
Error spawning 'vcspawn.exe'. The build could not be performed.

HW6.exe - 1 error(s), 0 warning(s)

so, please help again
/* My SETUP.EXE did not complete successful, since I don't know how to response: install latest window service patch; locate
CD1 of VC++6 standard edition */
/* How can I check / (and get)
I tested in my existing 32-bit WINEPREFIX with Wine Staging 4.13 (but I doubt that matters much).
*/
/* so, I don't have Release subdirectory of my cannon directory */

Post Reply