Discussion:
Command line compilation of VB ??
(too old to reply)
Steven
2004-11-30 12:12:00 UTC
Permalink
Hi all,

I am trying to compile a VB application through command line using C2.exe
But when I use this, I get the error : Fatal error C1083:cannot open
compiler intermediate file XXXX : no such file or directory.

I can't make out what is the problem.
Am I missing something ? Will anyone tell me how to use C2 to compile a VB
app ?

Here I feel its looking for some intermediate files which are not present.
How do I proceed ?
Steve Barnett
2004-11-30 12:56:19 UTC
Permalink
Why are you using C2.exe?

When I make through the command line, I use:
vb6.exe /make "name of the project file"

(With all of the various paths included, of course).

Steve
Post by Steven
Hi all,
I am trying to compile a VB application through command line using C2.exe
But when I use this, I get the error : Fatal error C1083:cannot open
compiler intermediate file XXXX : no such file or directory.
I can't make out what is the problem.
Am I missing something ? Will anyone tell me how to use C2 to compile a VB
app ?
Here I feel its looking for some intermediate files which are not present.
How do I proceed ?
Steven
2004-12-02 12:11:11 UTC
Permalink
Hi Steve,
The command-line given below will create the EXE file.

vb6.exe /make "name of the project file"

But i want to create OBJ first and use linK.EXE to create EXE file. Is there

any preprocesser is available to create VB intermediate files.

Thanks.
Post by Steve Barnett
Why are you using C2.exe?
vb6.exe /make "name of the project file"
(With all of the various paths included, of course).
Steve
Post by Steven
Hi all,
I am trying to compile a VB application through command line using C2.exe
But when I use this, I get the error : Fatal error C1083:cannot open
compiler intermediate file XXXX : no such file or directory.
I can't make out what is the problem.
Am I missing something ? Will anyone tell me how to use C2 to compile a VB
app ?
Here I feel its looking for some intermediate files which are not present.
How do I proceed ?
Ralph
2004-12-02 13:05:14 UTC
Permalink
Post by Steven
Hi Steve,
The command-line given below will create the EXE file.
vb6.exe /make "name of the project file"
But i want to create OBJ first and use linK.EXE to create EXE file. Is there
any preprocesser is available to create VB intermediate files.
Thanks.
Yes, it is called vb6.

Use plan B mentioned before.
1) In the VB folder rename c2.exe to something else.
2) Create your own "C2.exe" as a minimal program that captures the command
line and then pauses. Note the intermediate files that have been created.
3) The command line will contain both compiler and linker instructions.
4) Using the information set from vb (modify as you wish) compile .obj files
using VB's C2 compiler or the VC++ C2 compiler.
5) Launch Link.exe, again using either the one supplied with VB or VC++
linker.
6) Realize that nothing in this area is well-documented or supported - back
up everything. <g>

-ralph
a***@NOW.AT.arargh.com
2004-12-02 23:00:39 UTC
Permalink
On Thu, 2 Dec 2004 07:05:14 -0600, "Ralph"
Post by Ralph
Post by Steven
Hi Steve,
The command-line given below will create the EXE file.
vb6.exe /make "name of the project file"
But i want to create OBJ first and use linK.EXE to create EXE file. Is
there
Post by Steven
any preprocesser is available to create VB intermediate files.
Thanks.
Yes, it is called vb6.
Use plan B mentioned before.
1) In the VB folder rename c2.exe to something else.
2) Create your own "C2.exe" as a minimal program that captures the command
line and then pauses. Note the intermediate files that have been created.
3) The command line will contain both compiler and linker instructions.
4) Using the information set from vb (modify as you wish) compile .obj files
using VB's C2 compiler or the VC++ C2 compiler.
5) Launch Link.exe, again using either the one supplied with VB or VC++
linker.
6) Realize that nothing in this area is well-documented or supported - back
up everything. <g>
-ralph
Or just google for "Take Control of the Compile Process", and download
the code. I have used it on VB6, and it should work on VB5.
--
Arargh411 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the garbage from the reply address.
Ralph
2004-12-03 14:13:44 UTC
Permalink
Post by a***@NOW.AT.arargh.com
On Thu, 2 Dec 2004 07:05:14 -0600, "Ralph"
Post by Ralph
Post by Steven
Hi Steve,
The command-line given below will create the EXE file.
vb6.exe /make "name of the project file"
But i want to create OBJ first and use linK.EXE to create EXE file. Is
there
Post by Steven
any preprocesser is available to create VB intermediate files.
Thanks.
Yes, it is called vb6.
Use plan B mentioned before.
1) In the VB folder rename c2.exe to something else.
2) Create your own "C2.exe" as a minimal program that captures the command
line and then pauses. Note the intermediate files that have been created.
3) The command line will contain both compiler and linker instructions.
4) Using the information set from vb (modify as you wish) compile .obj files
using VB's C2 compiler or the VC++ C2 compiler.
5) Launch Link.exe, again using either the one supplied with VB or VC++
linker.
6) Realize that nothing in this area is well-documented or supported - back
up everything. <g>
-ralph
Or just google for "Take Control of the Compile Process", and download
the code. I have used it on VB6, and it should work on VB5.
--
Which uses the "Hook" from plan A. A pretty interesting tool.

-ralph

Peter Young
2004-12-02 15:21:24 UTC
Permalink
Post by Steven
Hi Steve,
The command-line given below will create the EXE file.
vb6.exe /make "name of the project file"
But i want to create OBJ first and use linK.EXE to create EXE file. Is there
any preprocesser is available to create VB intermediate files.
What is it you're attempting to do? There might be an easier way.

-Pete
Ralph
2004-11-30 14:08:47 UTC
Permalink
Post by Steven
Hi all,
I am trying to compile a VB application through command line using C2.exe
But when I use this, I get the error : Fatal error C1083:cannot open
compiler intermediate file XXXX : no such file or directory.
I can't make out what is the problem.
Am I missing something ? Will anyone tell me how to use C2 to compile a VB
app ?
Here I feel its looking for some intermediate files which are not present.
How do I proceed ?
What you are basically missing is the 'preprocessor'. VB uses a version of
the phase 2 C/C++ compiler, but VB6.dll is used to create input for the
compiler which is placed in intermediate files. It is these files you are
missing.

The compiler (and linker) is called using CreateProcess. If you must tinker
with the settings, you can create a hook and modify these calls, but you
can't compile a project directly (without VB6 exe/dll) unless you write your
own preprocessor.

hth
-ralph
Ralph
2004-11-30 14:32:50 UTC
Permalink
OR (there is always 3 ways to do anything <g>)

Create your own "C2.exe" that merely captures the command line and halts the
compile process - leaving the intermediate files intact.

(Now, I wonder what the third way is... <g>)

-ralph
Continue reading on narkive:
Loading...