1

I am migrating to Windows 7, moving into Slickedit 17 64 bit and have an old Slickedit extension DLL that is 32 bit that I need to recreate as 64 bit. This DLL is basically a bunch of wrappers for WinAPI calls.

Slickedit comes with an example 32 bit 'simple.dll' project (ahem) that is only a makefile. I need to know how to set up a Visual Studio project to build a 64 bit DLL using Slickedits libs.

The provided makefile is as follows:

# This makefile supports the following Visual C++ versions: 
# 7.10 (Visual Studio 2003), 8.00 (Visual Studio 2005),
# and 9.00 (Visual Studio 2008)
#
# Nmake macros for building Windows 32-Bit apps
!include <Win32.mak>

# Set linkdebug to nothing to link DLL without debug
#linkdebug=

DLLNAME=simple
cflags=$(cflags) -D_WINDOWS -I..\..\h

all: $(DLLNAME).lib $(DLLNAME).dll

# Update the object files if necessary

$(DLLNAME).obj: $(DLLNAME).cpp
    $(cc) $(cflags) $(cvarsmt) $(cdebug) -Tp $*.cpp

# Update the import library

$(DLLNAME).lib: $(DLLNAME).obj $(DLLNAME).def
    $(implib) -machine:$(CPU) \
    -def:$(DLLNAME).def $*.obj -out:$*.lib

# Update the dynamic link library

LIBDIR=lib
$(DLLNAME).dll: $(DLLNAME).obj $(DLLNAME).def makefile
    $(link) $(linkdebug) \
    -NODEFAULTLIB:libc -base:0x1C000000  \
    -dll -entry:_DllMainCRTStartup$(DLLENTRY) \
    -out:$*.dll  \
    $*.exp $*.obj ..\..\$(LIBDIR)\dllmain.obj ..\..\$(LIBDIR)\vsapi.lib ..\..\$(LIBDIR)\secommon.lib $(conlibsmt)

clean :
    del $(DLLNAME).dll $(DLLNAME).obj $(DLLNAME).pdb $(DLLNAME).ilk

Makefiles aren't my thing, and this one is set for 32 bit anyhow. So how do I setup a Studio Project to handle this type of C++ build. I've got:

  • C:\se17\lib\dllmain.obj
  • C:\se17\lib\secommon.lib
  • C:\se17\lib\tagsdb.lib
  • C:\se17\lib\vsapi.lib

And a supplied header directory in C:\se17\h

I am asking on SO because I am pretty skeptical about getting a decent response on community.slickedit.com, god love them anyway

Mark Robbins
  • 2,427
  • 3
  • 24
  • 33

1 Answers1

1

You need to tell the linker that your DLL target is 64-bit. That's done by /MACHINE:X64 on the linker line. I'd just add it afer "$(linkdebug)".

You will also need to set the compiler to point to the amd64 version, which is explained in this question: How do you compile 32-bit and 64-bit applications at the same time in Visual Studio for C/C++ in a makefile?

Community
  • 1
  • 1
Mats Petersson
  • 126,704
  • 14
  • 140
  • 227