Jump to content
Tuts 4 You

fatal error LNK1104: cannot open file "aPlib.lib"


M2R

Recommended Posts

Posted

C:\Masm32\Bin\RC.EXE /v "aPlib.rc"

Microsoft ® Windows ® Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright © Microsoft Corp. 1985-1998. All rights reserved.

Using codepage 1252 as default

Creating aPlib.RES

RC: RCPP -CP 1252 -f C:\masm32\Belajar.Assembly\_plugin_masm\aPlib\RCa01884 -g C:\masm32\Belajar.Assembly\_plugin_masm\aPlib\RDa01884 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I .

aPlib.rc.

Writing ICON:1, lang:0x409, size 4264

Writing GROUP_ICON:1, lang:0x409, size 20.

Writing BITMAP:1, lang:0x409, size 42040

C:\Masm32\Bin\ML.EXE /c /coff /Cp /nologo /I"C:\Masm32\Include" "aPlib.asm"

Assembling: aPlib.asm

C:\Masm32\Bin\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:aPlib.def /LIBPATH:"C:\Masm32\Lib" /OUT:"aPlib.dll" "aPlib.obj"

Microsoft ® Incremental Linker Version 5.12.8078

Copyright © Microsoft Corp 1992-1998. All rights reserved.

Creating library aPlib.lib and object aPlib.exp

LINK : fatal error LNK1104: cannot open file "aPlib.lib"

LINK : fatal error LNK1141: failure during build of exports file

Make error(s) occured.

Total compile time 235 ms

aPlib.rar

=========================================================

Why I can't link this program?

Sorry for my english

Posted

You need to remove lines "includelib aPlib.lib" from aPlib.Asm and appack.inc

Posted (edited)

I think that the output file name needs to be different so that ML doesnt output a lib file of the same name. WinASM it is as simple as renaming the project or setting a different output file in the project properties. I dont know about RadASM as i've not used it much myself.

Removing the included lib will result in the following messages:


aPLib dll.exp : warning LNK4070: /OUT:aPlib.dll directive in .EXP differs from output filename 'C:\Documents and Settings\Ghandi\Desktop\aPLib\aPlib\aPLib.dll'; ignoring directive
aPlib.obj : error LNK2019: unresolved external symbol _aP_workmem_size referenced in function _PackFile@4
aPlib.obj : error LNK2019: unresolved external symbol _aP_max_packed_size referenced in function _PackFile@4
aPlib.obj : error LNK2019: unresolved external symbol _aPsafe_pack referenced in function _PackFile@4
aPlib.obj : error LNK2019: unresolved external symbol _aPsafe_get_orig_size referenced in function _UnpackFile@0
aPlib.obj : error LNK2019: unresolved external symbol _aPsafe_depack referenced in function _UnpackFile@0
C:\Documents and Settings\Ghandi\Desktop\aPLib\aPlib\aPLib dll.dll : fatal error LNK1120: 5 unresolved externals

When the dll is made, it will try to make a lib file for that dll, named the same as the dll. In this particular case, the lib file will be named "aPLib.lib" which conflicts with the static library name. If the project is renamed to something else though, leaving in those includelib lines will allow you to assemble and link the plugin.

I've renamed the project to "aPLib Dll" and assembled a dll, its attached to the post. Honestly though, instead of editing the example program that comes with aPLib, you would do better to start a new project with the name you will give it, such as "aPLib_Plugin" or some such name. Then there is no problems with naming convention and if you name your routines in a similar fashion, reusing code is simpler because you can copy whole routines out from one module and use them in another (if you dont want to compile a static lib with your functions).

HR,

Ghandi

aPLib dll.rar

Edited by ghandi
Posted

Ghandi,

Yes, I agree with your solution and Thanks for all of you who reply my question :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...