| Date: | Sun, 11 Jul 2010 16:20:18 -0500 |
| Reply-To: | Kevin Myers <KevinMyers@AUSTIN.RR.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Kevin Myers <KevinMyers@AUSTIN.RR.COM> |
| Subject: | Re: SAS/Toolkit and Visual C++ 2008 Express |
| Content-Type: | text/plain; format=flowed; charset="iso-8859-1";
reply-type=original |
Further research and experimentation indicates that it is at least NOT
*easily* possible to compile SAS/Toolkit modules using any of Microsoft's
"Express" series compilers.
The reason for this appears to be because the Express series compilers do
not include (at least by default) the ability to compile projects that use
"Microsoft Foundation Class" (MFC) based code, and SAS/Toolkit appears to
require MFC. Various links on the web suggest that it may be possible (at
least in part) to force the Express series products to compile MFC based
applications, but doing so requires non-standard manual tinkering to link in
the MFC libraries, and there also appear to be some problems with debugging
such applications under the Express series products, and the possibility of
other issues.
Because I didn't want to fork over $300 to $500+ for any of the recent
Microsoft products that support MFC just to compile the little Toolkit
utility function that I was working on, I therefore searched some of my
older machines until I located an old (1998 vintage) installation of
Microsoft's Visual C++ 6.0, which *does* include full MFC support. Using
this compiler I *was* able to successfully compile my Tookit function, but
only after solving one additional issue...
The code that I wrote (which made use of Windows API functions) required use
of header files from <windows.h>. Attempting to compile anything under
Toolkit that used #INCLUDE <windows.h> produced errors resulting from
conflicting definitions of a "boolean" macro. After locating and commenting
out this definition at line 66 in !SASRoot\toolkit\c\maclib\uwhost.h (as
provided with SAS 8.2), everything compiled properly. I have no idea
whether commenting out this definition could produce any undesirable
side-effects, but my application seemed to work fine using the alternate
definition as provided in <windows.h>.
s/KAM
----- Original Message -----
From: "Kevin Myers" <KevinMyers@AUSTIN.RR.COM>
To: <SAS-L@LISTSERV.UGA.EDU>
Sent: Thursday, July 01, 2010 22:59
Subject: SAS/Toolkit and Visual C++ 2008 Express
Does anyone know if it is possible to build SAS/Toolkit functions for SAS
8.2 using Microsoft Visual C++ (.Net) 2008 Express? I have now checked and
double checked all of my steps versus the documentation and old builds that
I did years ago using a different compiler version, and can't find any other
potential problems in my setup. But when I run nmake to build my function,
I am getting an unresolved external symbol error for __pRawDllMain in the
final link step that attempts to create the DLL for my toolkit function. It
might help if I had much of an idea what __pRawDllMain was, or where it was
supposed to be located...
Below are the function source and the corresponding output from nmake. Any
help would sure be appreciated.
Thanks,
Kevin M.
ConStdIO.c
*************
#include "uwproc.h"
#include <stdio.h>
/* Prototype for CONWRTLN */
int RTN1 U_PARMS((short*,short*,ptr*,douple*));
ptr IFFMAI(request)
int *request;
{
if (*request == 1) {
/* required if SAS interface routines will be called */
UWPRCC(0);
/* set number of functions being defined */
FNCDFS(1L);
/* function number, name, min args, max args, return type */
FNCDFN(1L, "CONWRTLN", 1L, 1L, 1L); /* numeric, return code */
/* function number, arg number, arg type */
FNCDFA(1L, 1L, 2L); /* character, string to write */
return(FNCDFE()); /* set required return value */
}
else if (*request == 2) {
return(FNCDFE());
}
}
/* CONWRTLN function */
int RTN1(mIn, cIn, pIn, pOut)
short *mIn, *cIn;
double *pOut;
ptr *pIn;
{
*pOut = (double) puts(*pIn);
return(F_OK);
}
void IFFEXT() {}
ConStdIO.mak
*****************
#######################################################################
# NAME: ConStdIO.mak #
# PRODUCT: KBMUTILS #
# PURPOSE: make file for creating Console I/O functions #
#######################################################################
!include toolkit.mak
!include where.mak
# local macros
UWSRC = $(SRC)ConStdIO.c
UWOBJ = $(OBJ)ConStdIO.obj
MODNAME = uwustdio
PGMCON = mcbstdio
WHICH = FUNCTION
LANGUAGE = c
PRCINT = $(PRCINTCV)
IFFINT = $(IFFINTCV)
# local MAKE definitions
ALL : $(LOAD)$(MODNAME).dll
$(UWOBJ) : $(UWSRC) ; \
$(UWC) -Fo$(UWOBJ) $(UWCOPTS) $(UWSRC)
!include pgmcon.mak
!include uwlnkiff.mak
Output from nmake:
***********************
D:\petroleum\utility\c\cntl>nmake /f ConStdIO.mak
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
cl -Fo..\obj\ConStdIO.obj -c -IC:\Progra~1\Micros~1.0\VC\include -I..\ma
clib\ ..\src\ConStdIO.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.
ConStdIO.c
d:\petroleum\utility\c\src\constdio.c(38) : warning C4715: 'IFFMAI' : not
all co
ntrol paths return a value
c:\progra~1\SASIns~1\sas\v8\sas -path . -sysin
C:\Progra~1\SASIns~1\SAS\
V8\toolkt\global\test\pgmcon.sas -sysparm
!FUNCTION!uwustdio!mcbstdio!@!@!@C:\P
rogra~1\SASIns~1\SAS\V8\toolkt\global\grm\!@..\src\!@C:\Progra~1\SASIns~1\SAS\V8
\toolkt\global\grm\!@..\obj\!c!cl
C:\Progra~1\SASIns~1\SAS\V8\toolkt\sasexe\lnkdef c MICROSOFT WIN
FUNCTIO
N @ VENDORLIBS @C:\Progra~1\Mi2578~1\Windows\v6.0A\Lib\Kernel32.Lib+
C:\Progra~
1\Micros~1.0\VC\LIB\MSVCRT.LIB+ C:\Progra~1\Micros~1.0\VC\LIB\LIBCMT.LIB
VENDORL
IBS @ @C:\Progra~1\SASIns~1\SAS\V8\toolkt\global\obj\ @..\load\ uwustdio
..\ob
j\mcbstdio ..\obj\ConStdIO.obj
link/nodefaultlib /verbose @uwustdio.LNK
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
-out:..\LOAD\uwustdio.dll
-dll
-entry:DllMain@12
-export:mcn_main
-map:uwustdio.map
-debug
-pdb:none
..\OBJ\MCBSTDIO.OBJ
..\OBJ\CONSTDIO.OBJ
C:\PROGRA~1\SASINS~1\SAS\V8\TOOLKT\GLOBAL\OBJ\PRCINTCV.OBJ
C:\PROGRA~1\SASINS~1\SAS\V8\TOOLKT\GLOBAL\OBJ\IFFINT.OBJ
C:\PROGRA~1\MI2578~1\WINDOWS\V6.0A\LIB\KERNEL32.LIB
C:\PROGRA~1\MICROS~1.0\VC\LI
B\MSVCRT.LIB C:\PROGRA~1\MICROS~1.0\VC\LIB\LIBCMT.LIB
C:\PROGRA~1\SASINS~1\SAS\V8\TOOLKT\GLOBAL\OBJ\TOOLKIT.LIB
Starting pass 1
Searching libraries
Searching C:\PROGRA~1\MI2578~1\WINDOWS\V6.0A\LIB\KERNEL32.LIB:
Searching C:\PROGRA~1\MICROS~1.0\VC\LIB\MSVCRT.LIB:
Found _DllMain@12
Loaded MSVCRT.LIB(dllmain.obj)
Found _puts
Referenced in CONSTDIO.OBJ
Loaded MSVCRT.LIB(MSVCR90.dll)
Found __fltused
Referenced in CONSTDIO.OBJ
Loaded MSVCRT.LIB(dllsupp.obj)
Found __IMPORT_DESCRIPTOR_MSVCR90
Referenced in MSVCRT.LIB(MSVCR90.dll)
Loaded MSVCRT.LIB(MSVCR90.dll)
Found __NULL_IMPORT_DESCRIPTOR
Referenced in MSVCRT.LIB(MSVCR90.dll)
Loaded MSVCRT.LIB(MSVCR90.dll)
Found ?MSVCR90_NULL_THUNK_DATA
Referenced in MSVCRT.LIB(MSVCR90.dll)
Loaded MSVCRT.LIB(MSVCR90.dll)
Searching C:\PROGRA~1\MICROS~1.0\VC\LIB\LIBCMT.LIB:
Searching C:\PROGRA~1\SASINS~1\SAS\V8\TOOLKT\GLOBAL\OBJ\TOOLKIT.LIB:
Found _himodcn
Referenced in MCBSTDIO.OBJ
Loaded TOOLKIT.LIB(himodcn.obj)
Found _v_global_pidb_anchor
Referenced in MCBSTDIO.OBJ
Loaded TOOLKIT.LIB(tlkthcrt.obj)
Found _xoptcgt
Referenced in PRCINTCV.OBJ
Loaded TOOLKIT.LIB(xoptcgt.obj)
Found _wiloadv
Referenced in PRCINTCV.OBJ
Loaded TOOLKIT.LIB(wiloadv.obj)
Found _viidb2g
Referenced in PRCINTCV.OBJ
Loaded TOOLKIT.LIB(viidb2g.obj)
Found _xpslog
Referenced in PRCINTCV.OBJ
Loaded TOOLKIT.LIB(xpslog.obj)
Found _xexit
Referenced in PRCINTCV.OBJ
Loaded TOOLKIT.LIB(xexit.obj)
Found _RTN2
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn2.obj)
Found _RTN3
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn3.obj)
Found _RTN4
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn4.obj)
Found _RTN5
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn5.obj)
Found _RTN6
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn6.obj)
Found _RTN7
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn7.obj)
Found _RTN8
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn8.obj)
Found _RTN9
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn9.obj)
Found _RTN10
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn10.obj)
Found _RTN11
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn11.obj)
Found _RTN12
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn12.obj)
Found _RTN13
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn13.obj)
Found _RTN14
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn14.obj)
Found _RTN15
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn15.obj)
Found _RTN16
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn16.obj)
Found _RTN17
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn17.obj)
Found _RTN18
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn18.obj)
Found _RTN19
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn19.obj)
Found _RTN20
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn20.obj)
Found _RTN21
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn21.obj)
Found _RTN22
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn22.obj)
Found _RTN23
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn23.obj)
Found _RTN24
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn24.obj)
Found _RTN25
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn25.obj)
Found _RTN26
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn26.obj)
Found _RTN27
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn27.obj)
Found _RTN28
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn28.obj)
Found _RTN29
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn29.obj)
Found _RTN30
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn30.obj)
Found _RTN31
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn31.obj)
Found _RTN32
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn32.obj)
Found _RTN33
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn33.obj)
Found _RTN34
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn34.obj)
Found _RTN35
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn35.obj)
Found _RTN36
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn36.obj)
Found _RTN37
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn37.obj)
Found _RTN38
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn38.obj)
Found _RTN39
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn39.obj)
Found _RTN40
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn40.obj)
Found _RTN41
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn41.obj)
Found _RTN42
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn42.obj)
Found _RTN43
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn43.obj)
Found _RTN44
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn44.obj)
Found _RTN45
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn45.obj)
Found _RTN46
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn46.obj)
Found _RTN47
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn47.obj)
Found _RTN48
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn48.obj)
Found _RTN49
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn49.obj)
Found _RTN50
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn50.obj)
Found _RTN51
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn51.obj)
Found _RTN52
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn52.obj)
Found _RTN53
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn53.obj)
Found _RTN54
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn54.obj)
Found _RTN55
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn55.obj)
Found _RTN56
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn56.obj)
Found _RTN57
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn57.obj)
Found _RTN58
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn58.obj)
Found _RTN59
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn59.obj)
Found _RTN60
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn60.obj)
Found _RTN61
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn61.obj)
Found _RTN62
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn62.obj)
Found _RTN63
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn63.obj)
Found _RTN64
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(rtn64.obj)
Found _xytexit
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(xytexit.obj)
Found _xfmfent
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(xfmfent.obj)
Found _xfmuent
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(xfmuent.obj)
Found _hicallc
Referenced in IFFINT.OBJ
Loaded TOOLKIT.LIB(hicallc.obj)
Found _htstack
Referenced in TOOLKIT.LIB(tlkthcrt.obj)
Loaded TOOLKIT.LIB(htstack.obj)
Searching C:\PROGRA~1\MI2578~1\WINDOWS\V6.0A\LIB\KERNEL32.LIB:
Found __imp__DisableThreadLibraryCalls@4
Referenced in MSVCRT.LIB(dllmain.obj)
Loaded KERNEL32.LIB(KERNEL32.dll)
Found __IMPORT_DESCRIPTOR_KERNEL32
Referenced in KERNEL32.LIB(KERNEL32.dll)
Loaded KERNEL32.LIB(KERNEL32.dll)
Found ?KERNEL32_NULL_THUNK_DATA
Referenced in KERNEL32.LIB(KERNEL32.dll)
Loaded KERNEL32.LIB(KERNEL32.dll)
Searching C:\PROGRA~1\MICROS~1.0\VC\LIB\MSVCRT.LIB:
Searching C:\PROGRA~1\MICROS~1.0\VC\LIB\LIBCMT.LIB:
Searching C:\PROGRA~1\SASINS~1\SAS\V8\TOOLKT\GLOBAL\OBJ\TOOLKIT.LIB:
Finished searching libraries
Generating .exp file
Creating library ..\LOAD\uwustdio.lib and object ..\LOAD\uwustdio.exp
Finished generating .exp file
Searching libraries
Searching C:\PROGRA~1\MI2578~1\WINDOWS\V6.0A\LIB\KERNEL32.LIB:
Searching C:\PROGRA~1\MICROS~1.0\VC\LIB\MSVCRT.LIB:
Searching C:\PROGRA~1\MICROS~1.0\VC\LIB\LIBCMT.LIB:
Searching C:\PROGRA~1\SASINS~1\SAS\V8\TOOLKT\GLOBAL\OBJ\TOOLKIT.LIB:
Finished searching libraries
Finished pass 1
MSVCRT.LIB(dllmain.obj) : error LNK2001: unresolved external symbol
__pRawDllMain
..\LOAD\uwustdio.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
9.0\VC\BIN
\link.EXE"' : return code '0x460'
Stop.
|