windows平台下,用cl命令实现
如:
cl -Id:\j2sdk1.4.1\include -Id:\j2sdk1.4.1\include\win32 -LD HelloNative.c -FeHelloNative.dll出处:
http://www.javaresearch.org/article/showarticle.jsp?column=1&thread=5012

解决方案 »

  1. http://www.yesky.com/SoftChannel/72342371961929728/20031128/1748749.shtml
    不过好像也还是要编译器的支持啊……
      

  2. 自己找个编译器,如VC71的,命令行编译,先写个CL.CMD,内容如下:
    --------------------------------------------------------
    SET MSVCDir=C:\VC71
    SET VC_TOOL_PATH=%MSVCDir%\bin
    SET PATH=%VC_TOOL_PATH%;%PATH%
    SET INCLUDE=%MSVCDir%\INCLUDE;%MSVCDir%\win32\Include;%MSVCDir%\INCLUDE\sys;%MSVCDIR%\SITE-INCLUDE;%MSVCDIR%\PLATFORMSDK\INCLUDE;C:\j2sdk\include;C:\j2sdk\include\win32;%INCLUDE%
    SET LIB=%MSVCDir%\LIB;%MSVCDir%\win32\lib;%MSVCDIR%\SITE-LIB;%MSVCDIR%\PLATFORMSDK\LIB;C:\j2sdk\lib;%LIB%cl.exe /EHsc %1 %2 %3 %4 %5 %6 %7 %8 %9
    --------------------------------------------------------
    然后
    Cl /LD ABC.C
    就可以生成ABC.DLL了
      

类似问题 »