> Does our compiler use the same calling convention as you are using with
> OW?
> The calling conventions have influence on function names. I see you're
> linking against clib3s, so I guess you're using __cdecl as calling
> convention. The object file of the module containing main() should show
> the
> 'decorated' name.
>
> Mat Nieuwenhoven
Calling conventions are not the issue. As I said earlier, I can call
functions
compiled with my compiler from a program where the "main" function is in
a C module compiled with OWC. I can also call C functions from a function
in a module I compile with my compiler. They call each other just fine. They
link and run just fine. I've written literally hundreds of assembly programs
and
I know how the calling convention works. Everything works fine as long as
the function "main" is in a C module compiled with wcc. But I want to put
the "main" function in a module that is compiled with my compiler. My
compiler
generates assembly code that is then assembled with wasm. If there was a
name incompatibility issue then the program wouldn't link. But it does. And
it runs correctly.
The problem is when I write the "main" program and compile it with the
compiler I am writing. It doesn't do anything special if a function happens
to be
called "main" so the linker complains that there is no entry point for the
program.
What do I put into the module that has a "main" function to tell the linker
that
"main" is the entry point into the executable that is produced with wlink?
The
reason it crashes is that the Windows loader doesn't know where to start
execution when my program is loaded. The linker says that it uses some
arbitrary value to assume that it is the entry point. Do you understand?
In other words, I need to know what assembly language I need to add to
an assembly language file that contains the "main" function so that the
linker
will know that "main" is the entry point to the program.