News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Building a DLL file in RadASM

Started by Lightman, December 05, 2015, 07:51:49 AM

Previous topic - Next topic

Lightman

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

I have the following settings for a APIInfo dll project i have:

Compile RC: 4,O,$B\RC.EXE /v,1
Assemble: 3,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",2
Link: 7,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:$6  /LIBPATH:"$L" /OUT:"$7",3,4
Res To Obj: 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:

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:

<?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.

Lightman

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

Like this? Built with RichMasm, with ; OPT_Tgt dll in line 1 (delete the OPT_Res 0 line).



fearless

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.

TWell

Change this project lineF3=-5,0,4,75,75,839,305,0,SplashDLL.rcto thisF3=-5,2,4,75,75,839,305,0,SplashDLL.rcand try again ;)
QuoteF3=-5,2,4,75,75,839,305,0,SplashDLL.rc

Lightman

Thanks Tim, that's it. Works a treat...
Regards,

Lightman