X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



10104 Rate this article:
No rating

How to compile a 64-bit C DLL using MVS 2010 and run it in IDL

This Help article describes the steps to compile a 64-bit C DLL using Microsoft Visual Studio 2010 Express and how to call it in IDL afterwards.

Requirements:

- A 64-bit Windows machine

- A C compiler that supports 64-bit

- A 64-bit version of IDL

- The test will be run using a C code available in IDL distribution:

        C:\ProgramFiles\Exelis\IDLxx\external\dlm\testmodule.c

Before starting this tutorial please copy the testmodule.c file in addition to the testmodule.dlm_base file from the above directory into a test folder. For example

        C:\temp\test_dll_64bit\

Then rename testmodule.dlm_base to testmodule.dlm

Installation and configuration of the compiler

- Download a C compiler. In this example we will use the following  free C compiler: Microsoft Visual Studio 2010 Express

Note:  In order to have Microsoft Visual Studio 2010 Express compiling 64 bit application sit requires to install the following SDK library: Microsoft Windows SDK 7.1 & .NET Framework 3.5 SP1

- Install the C compiler (and the SDK  library mentioned above) on your 64-bit machine

 

Creation of the 64-bit C DLL

 

- Start the Microsoft SDK command line:

            Start > All Programs > Microsoft Windows SDK v7.1 > Windows SDK 7.1 Command Prompt

- Start the 64-bit IDL command line from the compiler prompt so the compiler path is automatically set.

        cd "C:\Program Files\Exelis\IDLxx\bin\bin.x86_64"

      idl.exe

 

- Build the 64-bit dll using the following IDL commands:

        c_dir='C:\temp\test_dll_64bit\'

        cd, c_dir

        make_dll, 'testmodule', 'IDL_Load', input_directory='c_dir', $

                OUTPUT_DIRECTORY=c_dir

 

Run the DLL from IDL

-  Paste the testmodule.dlm and the testmodule.dll created at the previous step from the test directory into the DLM default path. For example: 

               C:\Program Files\Exelis\IDLxx\bin\bin.x86_64

 

- Restart IDL using the IDL icon and run the commands:     

    DLM_REGISTER,'C:\Program Files\Exelis\IDLxx\bin\bin.x86_64\testmodule.dlm'

        print,testfun()

 

The output should be        

        % Loaded DLM: TESTMODULE

    % TESTFUN: This is from a loadable module function.

    TESTFUN

       

 _________________________________________

HA reviewed on 3/25/2014 by DS

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »