• def to lib

    From mutazilah@gmail.com@21:1/5 to All on Thu Aug 12 04:11:48 2021
    Anyone know what is going wrong?

    C:\devel\pdos\src>type aaa.def
    EXPORTS
    fred=mary

    C:\devel\pdos\src>lib /def:aaa.def /out:aaa.lib
    Microsoft (R) Library Manager Version 9.00.21022.08
    Copyright (C) Microsoft Corporation. All rights reserved.

    LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
    Creating library aaa.lib and object aaa.exp

    C:\devel\pdos\src>strings aaa.lib | grep -i fred
    __imp__fred
    _fred
    __imp__fred
    _fred
    _fred

    C:\devel\pdos\src>strings aaa.lib | grep -i mary

    C:\devel\pdos\src>


    I'm expecting to see "mary" somewhere.


    C:\devel\pdos\src>lib
    Microsoft (R) Library Manager Version 9.00.21022.08

    C:\devel\pdos\src>where lib
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\lib.exe


    I've checked the documentation and as far as I can
    tell, I'm doing everything by the book.

    https://docs.microsoft.com/en-us/cpp/build/reference/building-an-import-library-and-export-file?view=msvc-160

    Thanks. Paul.



    000000 213C6172 63683E0A 2F202020 20202020 !<arch>./
    000010 20202020 20202020 31363238 37363630 16287660
    000020 34372020 20202020 20202020 20202020 47
    000030 30202020 20202020 31313220 20202020 0 112
    000040 2020600A 00000005 0000016A 00000384 `........j....
    000050 000004B6 00000600 00000600 5F5F494D ............__IM
    000060 504F5254 5F444553 43524950 544F525F PORT_DESCRIPTOR_
    000070 61616100 5F5F4E55 4C4C5F49 4D504F52 aaa.__NULL_IMPOR
    000080 545F4445 53435249 50544F52 007F6161 T_DESCRIPTOR..aa
    000090 615F4E55 4C4C5F54 48554E4B 5F444154 a_NULL_THUNK_DAT
    0000A0 41005F5F 696D705F 5F667265 64005F66 A.__imp__fred._f
    0000B0 72656400 2F202020 20202020 20202020 red./
    0000C0 20202020 31363238 37363630 34372020 1628766047
    0000D0 20202020 20202020 20202020 30202020 0
    0000E0 20202020 31323220 20202020 2020600A 122 `.
    0000F0 04000000 6A010000 84030000 B6040000 ....j...........
    000100 00060000 05000000 01000200 04000400 ................
    000110 03005F5F 494D504F 52545F44 45534352 ..__IMPORT_DESCR
    000120 4950544F 525F6161 61005F5F 4E554C4C IPTOR_aaa.__NULL
    000130 5F494D50 4F52545F 44455343 52495054 _IMPORT_DESCRIPT
    000140 4F52005F 5F696D70 5F5F6672 6564005F OR.__imp__fred._
    000150 66726564 007F6161 615F4E55 4C4C5F54 fred..aaa_NULL_T
    000160 48554E4B 5F444154 41006161 612E646C HUNK_DATA.aaa.dl
    000170 6C2F2020 20202020 20203136 32383736 l/ 162876
    000180 36303437 20202020 20202020 20202020 6047
    000190 20203020 20202020 20203437 37202020 0 477
    0001A0 20202020 600A4C01 03005FFF 14610301 `.L..._..a..
    0001B0 00000800 00000000 00012E64 65627567 ...........debug
    0001C0 24530000 00000000 00003D00 00008C00 $S........=.....
    0001D0 00000000 00000000 00000000 00004000 ..............@.
    0001E0 10422E69 64617461 24320000 00000000 .B.idata$2......
    0001F0 00001400 0000C900 0000DD00 00000000 ................
    000200 00000300 00004000 30C02E69 64617461 ......@.0..idata
    000210 24360000 00000000 00000800 0000FB00 $6..............
    000220 0000DD00 00000000 00000000 00004000 ..............@.
    000230 20C00200 00000E00 09000000 00000761 ..............a
    000240 61612E64 6C6C2700 13100700 00000300 aa.dll'.........
    000250 00000000 00000900 00001E52 124D6963 ...........R.Mic
    000260 726F736F 66742028 5229204C 494E4B00 rosoft (R) LINK.
    000270 00000000 00000000 00000000 00000000 ................
    000280 0000000C 00000003 00000007 00000000 ................
    000290 00040000 00070010 00000005 00000007 ................
    0002A0 00616161 2E646C6C 0040636F 6D702E69 .aaa.dll.@comp.i
    0002B0 641E5293 00FFFF00 00030000 00000004 d.R.............
    0002C0 00000000 00000002 00000002 002E6964 ..............id
    0002D0 61746124 32400000 C0020000 0068002E ata$2@.......h..
    0002E0 69646174 61243600 00000003 00000003 idata$6.........
    0002F0 002E6964 61746124 34400000 C0000000 ..idata$4@......
    000300 0068002E 69646174 61243540 0000C000 .h..idata$5@....
    000310 00000068 00000000 001C0000 00000000 ...h............
    000320 00000000 00020000 00000035 00000000 ...........5....
    000330 00000000 00000002 004A0000 005F5F49 .........J...__I
    000340 4D504F52 545F4445 53435249 50544F52 MPORT_DESCRIPTOR
    000350 5F616161 005F5F4E 554C4C5F 494D504F _aaa.__NULL_IMPO
    000360 52545F44 45534352 4950544F 52007F61 RT_DESCRIPTOR..a
    000370 61615F4E 554C4C5F 5448554E 4B5F4441 aa_NULL_THUNK_DA
    000380 5441000A 6161612E 646C6C2F 20202020 TA..aaa.dll/
    000390 20202020 31363238 37363630 34372020 1628766047
    0003A0 20202020 20202020 20202020 30202020 0
    0003B0 20202020 32343620 20202020 2020600A 246 `.
    0003C0 4C010200 5FFF1461 B5000000 02000000 L..._..a........
    0003D0 00000001 2E646562 75672453 00000000 .....debug$S....
    0003E0 00000000 3D000000 64000000 00000000 ....=...d.......
    0003F0 00000000 00000000 40001042 2E696461 ........@..B.ida
    000400 74612433 00000000 00000000 14000000 ta$3............
    000410 A1000000 00000000 00000000 00000000 ................
    000420 400030C0 02000000 0E000900 00000000 @.0.............
    000430 07616161 2E646C6C 27001310 07000000 .aaa.dll'.......
    000440 03000000 00000000 09000000 1E52124D .............R.M
    000450 6963726F 736F6674 20285229 204C494E icrosoft (R) LIN
    000460 4B000000 00000000 00000000 00000000 K...............
    000470 00000000 0040636F 6D702E69 641E5293 .....@comp.id.R.
    000480 00FFFF00 00030000 00000004 00000000 ................
    000490 00000002 00000002 001D0000 005F5F4E .............__N
    0004A0 554C4C5F 494D504F 52545F44 45534352 ULL_IMPORT_DESCR
    0004B0 4950544F 52006161 612E646C 6C2F2020 IPTOR.aaa.dll/
    0004C0 20202020 20203136 32383736 36303437 1628766047
    0004D0 20202020 20202020 20202020 20203020 0
    0004E0 20202020 20203237 30202020 20202020 270
    0004F0 600A4C01 03005FFF 1461D100 00000200 `.L..._..a......
    000500 00000000 00012E64 65627567 24530000 .......debug$S..
    000510 00000000 00003D00 00008C00 00000000 ......=.........
    000520 00000000 00000000 00004000 10422E69 ..........@..B.i
    000530 64617461 24350000 00000000 00000400 data$5..........
    000540 0000C900 00000000 00000000 00000000 ................
    000550 00004000 30C02E69 64617461 24340000 ..@.0..idata$4..
    000560 00000000 00000400 0000CD00 00000000 ................
    000570 00000000 00000000 00004000 30C00200 ..........@.0...
    000580 00000E00 09000000 00000761 61612E64 ...........aaa.d
    000590 6C6C2700 13100700 00000300 00000000 ll'.............
    0005A0 00000900 00001E52 124D6963 726F736F .......R.Microso
    0005B0 66742028 5229204C 494E4B00 00000000 ft (R) LINK.....
    0005C0 00000040 636F6D70 2E69641E 529300FF ...@comp.id.R...
    0005D0 FF000003 00000000 00040000 00000000 ................
    0005E0 00020000 00020019 0000007F 6161615F ............aaa_
    0005F0 4E554C4C 5F544855 4E4B5F44 41544100 NULL_THUNK_DATA.
    000600 6161612E 646C6C2F 20202020 20202020 aaa.dll/
    000610 31363238 37363630 34372020 20202020 1628766047
    000620 20202020 20202020 30202020 20202020 0
    000630 33342020 20202020 2020600A 0000FFFF 34 `.....
    000640 00004C01 5FFF1461 0E000000 00000800 ..L._..a........
    000650 5F667265 64006161 612E646C 6C00 _fred.aaa.dll.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mutazilah@gmail.com@21:1/5 to All on Thu Aug 12 23:38:20 2021
    I have bypassed this problem for now, by simply using
    the kernel32.lib that comes with Visual Studio.

    I'm not sure how useful it is, but you can now write a
    C90 application using Microsoft's Visual Studio as the
    compiler, but PDPCLIB as the C runtime library, so that
    the resulting executable (only about 17k for a hello
    world) is only dependent on the documented kernel32.dll:

    https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/makefile.msw

    One source file is necessarily in assembler, so you need
    masm for that, and instructions for obtaining that can
    be found here:

    https://sourceforge.net/p/pdos/gitcode/ci/master/tree/readme.txt

    The resulting executable should work on every version of
    Windows since Win 95, but I only tested on Win 10.

    The executable has also been tested on Freedos+HX and
    PDOS/386 and works fine.

    BFN. Paul.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)