Author Topic: Building a DLL file in RadASM  (Read 2245 times)

Lightman

  • Regular Member
  • *
  • Posts: 35
Building a DLL file in RadASM
« on: December 05, 2015, 07:51:49 AM »
Hi Everybody,

I'm trying to build a DLL file in my RadASM. I started with a blank project and selected a build type of DLL Release.

I type up my code and it compiles correctly. But when I go to build it I get a problem. The linker says...

LINK : fatal error LNK1146: no argument specified with option "/DEF:"

I've tried going into option->Make Options and modifying the link command, but it still fails.

Can anyone tell me where I am going wrong/what I have broken....?

Regards,

Lightman.
Regards,

Lightman

fearless

  • Member
  • ***
  • Posts: 271
    • LetTheLightIn
Re: Building a DLL file in RadASM
« Reply #1 on: December 05, 2015, 08:29:33 AM »
I have the following settings for a APIInfo dll project i have:

Compile RC:
Code: [Select]
4,O,$B\RC.EXE /v,1Assemble:
Code: [Select]
3,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",2Link:
Code: [Select]
7,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:$6  /LIBPATH:"$L" /OUT:"$7",3,4Res To Obj:
Code: [Select]
rsrc.obj,O,$B\CVTRES.EXE,rsrc.res
The def file has to contain the library name and any functions that you are exporting (that will be visible and usable by other programs using the .dll once it is loaded) here is an example for the APIInfo.dll project, of which 3 functions are public and exported. APIInfo.def:

Code: [Select]
LIBRARY APIInfo
EXPORTS
        pluginit
        plugstop
        plugsetup


I have a version info (Project->Versioninfo) and a manifest resource (Project->Resource)

The version info and manifest is kinda required nowadays to help prevent false positives with anti-virus programs

Resource ID of 1 is a MANIFEST type, which links to a APIInfo.xml file:

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
    xmlns="urn:schemas-microsoft-com:asm.v1"
    manifestVersion="1.0">
    <assemblyIdentity
        version="1.0.0.0"
        processorArchitecture="X86"
        name="Company.Product.Application"
        type="Win32"
    />
    <description>APIInfo</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="X86"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
    </dependency>
</assembly>

Forgot to add, you will prob need to modify an option in the Project->Project Options dialog. Check (make sure its ticked) the box at the top left that says Compile RC.

Now running the Make->Compile RC command it will include the version and manifest stuff in your dll, then run Make->Assemble and finally Make->Link. Or all at once with Make->Build option.

Hope that helps you.
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI, Samsung 256GB + 1TB SSD, WD Black 2TB x2 + 4TB HDD, Asus 27" LCD

www.LetTheLight.in  My Github

Lightman

  • Regular Member
  • *
  • Posts: 35
Re: Building a DLL file in RadASM
« Reply #2 on: December 10, 2015, 01:54:14 AM »
Many thanks, I can now compile DLL files, but I'm still having problems getting it to include my RC files. Can you see where I am going wrong?

I'm on 3.0.0.9c. When I go to my Project->Project Options box I don't have a check box for Compile RC. I've looked all over the the equivalent elsewhere but can't find one.

Attached is the code file for Iczelion's tutorial 26 showing Splash Screens. As you can see, I'm trying to add a bmp file to a DLL, but as I can't persuade RadASM to include the resource file, I get an empty space instead of a picture.   
Regards,

Lightman

jj2007

  • Member
  • *****
  • Posts: 7460
  • Assembler is fun ;-)
    • MasmBasic
Re: Building a DLL file in RadASM
« Reply #3 on: December 10, 2015, 02:02:18 AM »
Like this? Built with RichMasm, with ; OPT_Tgt dll in line 1 (delete the OPT_Res 0 line).



fearless

  • Member
  • ***
  • Posts: 271
    • LetTheLightIn
Re: Building a DLL file in RadASM
« Reply #4 on: December 10, 2015, 04:37:38 AM »
Yeh unfortunately cant say much about RadASM v3.x, other than i couldnt find settings that i was used to setting in v2.x - and few other oddities, and as it was in the middle of development when it stopped i didnt go back to it, preferring v2.x which seemed more feature complete. Very easy to just create a new project in v2.x and copy/paste your existing code from v3.x info across to that v2.x files. Plus v2.x does have the option of modifying the projects options which will be a bit handier for you.


Edit: Attached the RadASM v2.x project with your files, including compiled dll with resource and manifest build in. Havnt tested code or dll but it all compiles and links fine.
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI, Samsung 256GB + 1TB SSD, WD Black 2TB x2 + 4TB HDD, Asus 27" LCD

www.LetTheLight.in  My Github

TWell

  • Member
  • ****
  • Posts: 748
Re: Building a DLL file in RadASM
« Reply #5 on: December 11, 2015, 05:52:02 AM »
Change this project line
Code: [Select]
F3=-5,0,4,75,75,839,305,0,SplashDLL.rcto this
Code: [Select]
F3=-5,2,4,75,75,839,305,0,SplashDLL.rcand try again ;)
Quote
F3=-5,2,4,75,75,839,305,0,SplashDLL.rc

Lightman

  • Regular Member
  • *
  • Posts: 35
Re: Building a DLL file in RadASM
« Reply #6 on: December 11, 2015, 07:14:04 PM »
Thanks Tim, that's it. Works a treat...
Regards,

Lightman