using JWasm with mingw headers and libs (?)

Started by SteveAsm, October 27, 2011, 02:40:09 PM

Previous topic - Next topic

SteveAsm

Hey guys,
I searched the archives and googled, but, couldn't find the answer.  :boohoo:
A few years ago I built a project based on Masm32, but, (due to license restrictions) I'm looking to convert the project over to JWasm.

What I would like to know is can JWasm successfully use mingw headers (converted to *.inc) and library (*.a) files ?

JWasm comes with h2incx.exe for converting the headers to ".inc" files, but, I'm not sure what to do with the libraries.
Does anyone know, are they usable as they are ?
Is there a better alternative ?

JWasm comes with some common ".inc" and ".lib" files, but, not most and certainly not as many as MSVC.

Funny thing, there is a conversion program out there called "lib2a.exe" (that does what its name implies) but, there appears to be no "a2lib.exe".  :'(



dedndave

i seem to recall that Andreas had a batch file to build the import libraries
http://www.japheth.de/WinInc.html#widownload

there are some additional (less commonly used) includes in WinIncEx

hutch--

Steve,

Download Pelles C as it has very good command line tools, lib, link etc ... You can use them to make your own set of libraries that are fully compatible with MASM and therefore probably JWASM.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

drizz

Hello,

Quote from: SteveAsm on October 27, 2011, 02:40:09 PM
Hey guys,
I searched the archives and googled, but, couldn't find the answer.  :boohoo:
A few years ago I built a project based on Masm32, but, (due to license restrictions) I'm looking to convert the project over to JWasm.
As Dave said, download and get yourself accustomed to WinInc.
In WinInc, C header == ASM header.

Quote from: SteveAsm on October 27, 2011, 02:40:09 PM
What I would like to know is can JWasm successfully use mingw headers (converted to *.inc) and library (*.a) files ?
Jwasm does not use ".a" files, those files are .obj collections for the linker.

Quote from: SteveAsm on October 27, 2011, 02:40:09 PM
I'm not sure what to do with the libraries.
Nothing. Jwasm does not use libraries.

Quote from: SteveAsm on October 27, 2011, 02:40:09 PM
Is there a better alternative ?
JWASM+MinGW+WinInc+(Radasm or Code::Blocks) = complete C/C++/ASM environment
NOT TO MENTION THAT GCC SUPPORTS THE DAMN C99 AND MSVC DOES NOT!


The truth cannot be learned ... it can only be recognized.

SteveAsm

Quote from: dedndave on October 27, 2011, 03:13:12 PM
i seem to recall that Andreas had a batch file to build the import libraries
http://www.japheth.de/WinInc.html#widownload

there are some additional (less commonly used) includes in WinIncEx

Hey Dave,
yeh, I used the *.DEF files, (found in ..\WinInc\Def\), with polib.exe to produce the Lib files, but, I don't know how to expand on that.
The number of *.lib's is very limited.
I was looking to add several more libs to the mix.

Steve

edit:
just downloaded the WinIncEx.


SteveAsm

Quote from: hutch-- on October 27, 2011, 03:20:33 PM
Download Pelles C as it has very good command line tools, lib, link etc ...

Hey Hutch,
Yes, I do have Pelles C.
I used polib.exe to create the original ".Lib" files for JWasm from the ".DEF" files.

Steve

drizz

The truth cannot be learned ... it can only be recognized.

SteveAsm

Quote from: drizz on October 27, 2011, 04:37:59 PM
jwasm does not use libraries.

Hey drizz,
then, I don't understand this JWasm Readme.txt:
Quoteif this directory is empty (or contains just UUID.LIB), view
..\Def\Readme.txt how to create the most important Win32 import libraries.

Are we talking about the same thing ?

steve

drizz

The files for generating .lib files are probably there for environments like "Visual C++ Toolkit 2003" that don't come with PSDK libraries ( kernel32 user32 ). Since kernel32 user32 etc. libs need only to contain function import definitions (No code), they can easily be built from .def files.

Decide what environment you want to use. PellesC comes with OS libraries, MinGW comes with OS libraries, VCToolkit2003 does not.
The truth cannot be learned ... it can only be recognized.

Vortex

Hi SteveAsm,

Attached is a zip file containing all the .def files from the GeneSys project. You can find the missing .def files to build your import libraries.

Concerning MinGW import libraries, I remember that Polink can use them but those import libraries have different kind of MS COFF relocation information if I am not wrong.

SteveAsm

Quote from: Vortex on October 27, 2011, 05:53:25 PM
Attached is a zip file containing all the .def files from the GeneSys project. You can find the missing .def files to build your import libraries.

Concerning MinGW import libraries, I remember that Polink can use them but those import libraries have different kind of MS COFF relocation information if I am not wrong.

Thanks for the link and the info Vortex.  :thumbu

steve

drizz

Quote from: SteveAsm on October 27, 2011, 04:35:01 PMYes, I do have Pelles C.
I used polib.exe to create the original ".Lib" files for JWasm from the ".DEF" files.
Why would you build .lib files when you have them in "c:\Program Files\PellesC\Lib\Win\"

Quote from: Vortex on October 27, 2011, 05:53:25 PMConcerning MinGW import libraries, I remember that Polink can use them but those import libraries have different kind of MS COFF relocation information if I am not wrong.
Why would you use POLINK with MINGW libs when you have LD.
The truth cannot be learned ... it can only be recognized.

Vortex

Quote from: drizz on October 27, 2011, 06:33:42 PM
Why would you use POLINK with MINGW libs when you have LD.

Polink is easier to use and compatible with other development tools.

jcfuller

I just assumed MinGW was elf format on Windows?

These are the two batch files I am using with jwasm and MinGW.

console:

@setlocal
@ECHO OFF
@SET MINGW=C:\MinGW
@SET LIB=%MINGW%\lib -Lc:\jwasm\bxbasm\lib
@SET INCLUDE=%MINGW%\include;%MINGW%\include\sys
@SET PATH=C:\jwasm;C:\jwasm\jwlink;%MINGW%\bin;%PATH%
@SET GCCCFL= --format elf32-i386 --subsystem console
jwasm -elf %1.asm
ld  %GCCCFL% -s -o %1.exe %1.obj -L%LIB% -lbxbasmlib -lmingw32 -lmsvcrt -lkernel32 -luser32 -lgdi32 -lcomctl32 -ladvapi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -lcomdlg32 -limagehlp -lversion
REM ECHO All Done
endlocal


gui


@setlocal
@SET MINGW=C:\MinGW
@SET LIB=%MINGW%\lib -Lc:\jwasm\bxbasm\lib
@SET INCLUDE=%MINGW%\include;%MINGW%\include\sys
@SET PATH=C:\jwasm;C:\jwasm\jwlink;%MINGW%\bin;%PATH%
@SET GCCCFL= --format elf32-i386 --subsystem windows
@jwasm -elf %1.asm
@ld  %GCCCFL% -s -o %1.exe %1.obj -L%LIB% -lmingw32 -lmsvcrt -lkernel32 -luser32 -lgdi32 -lcomctl32 -ladvapi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -lcomdlg32 -limagehlp -lversion
ECHO All Done


James

drizz

Quote from: Vortex on October 27, 2011, 06:40:48 PM
Quote from: drizz on October 27, 2011, 06:33:42 PM
Why would you use POLINK with MINGW libs when you have LD.

Polink is easier to use and compatible with other development tools.
Why mentioning the use of MINGW libs at all then? PellesC package has its own lib files.

The truth cannot be learned ... it can only be recognized.