ÔÚvc.netÖеÄC/C++´úÂëÉú³ÉDLL²½Öè
1 Ñ¡Ôñnew->project->win32 console project£»
ÔÚÕâÒ»²½µÄÑ¡¿òÉÏÓÐÒ»¸öÑ¡ÏîÊÇ create dictionary for solution, ÎÒ²»ÖªµÀÕâ¸ö¾ßÌåÊÇʲô×÷Óã¬Ñ¡ÁËÖ®ºó»áÏîÄ¿³öÏÖÁ½²ãÎļþ¼Ð£¬±ÈÈçÄã´´½¨Ò»¸öÃüÃûΪtestµÄÏîÄ¿£¬»áÉú³ÉtestÎļþ¼Ð£¬testÖаüº¬ÁíÒ»¸ötestÎļþ¼Ð£¬ÄãµÄÏîĿʵ¼ÊÉÏ·ÅÔÚÁËÄÚ²ãtestÎļþ¼ÐÖС£Ñ¡Ó벻ѡ¶ÔÓÚºóÐøµÄ´´½¨Ã»ÓÐÓ°Ïì¡£Õâ¸öµÄ¾ßÌå×÷ÓõÈÎÒ²éÃ÷°×ÁËÔÙ²¹ÉÏ£¡
2 ÊäÈëÄãµÄÎļþÃû×Ö->°´ÏÂnext->Ñ¡ÔñDLL->Ñ¡ÔñOK£»
3 ÔÚ¹¤³ÌÖÐÌí¼ÓÒ»¸öÓ빤³ÌÃû×ÖͬÃûµÄtest.hÎļþ£¬ÔÚÎļþÖÐдÈë´úÂ룺 extern "C" __declspec(dllexport) void testexam(char *input); £¨ÎļþÃû×ÖÊÇÐèÒªµ¼³öµÄÎļþÃû£©£»
4 ÔÚcppÎļþµÄÍ·ÉÏÆäËûincludeÓï¾äºóÃæ£¬Ìí¼Ó#include "test.h"£¬ÔÚÆäÖÐдÈëÄãµÄº¯Êývoid testexam(char *input);
5 ÔÚbuild->batch build Öн«Á½¸öÑ¡ÏѡÖУ¬È»ºóÑ¡ÔñÕâ¸öÑ¡Ïî¿òÖеıàÒëÖ¸Áî
OK, now you can get your dll and lib file in the release and debug file folder! Congratulations !
Ïà¹ØÎĵµ£º
ÔÌû£º
http://hi.baidu.com/pepsi360/blog/item/cc74be4412cf6789b3b7dcd4.html
#include <stdio.h>
struct Node
{
int a;
char b[10];
Node *next;
};
main(void)
{
char *p=NUL ......
̸µ½EclipseÕâ¸ö¿ªÔ´IDE£¬´ó¼Ò¶¼»áDZÒâʶµØ°ÑËüºÍJAVA¿ª·¢ÁªÏµÆðÀ´¡£Ã»´í£¬EclipseÓÃÓÚJAVA applicationµÄ¿ª·¢ÊÇĿǰµÄÖ÷Á÷£¬¶øÇÒËü±¾ÉíÒ²ÊÇÐèÒªJRE²ÅÄÜÔËÐеģ¬Òò¶øÎÞÂÛÔõô¿´Eclipse¶¼ÓëJAVAÓÐÃܲ»¿É·ÖµÄÁªÏµ¡£ µ«Êµ¼ÊÉÏEclipseÖ»ÊÇÒ»¸ö¿ª·¢»·¾³£¬Ò»¸öΪ³ÌÐòÔ±ÌṩµÄ¿ò¼Ü£¬ÓëÓïÑÔ²¢ÎÞÖ±½ÓÁªÏµ¡£×Ô´Ó2001ÄêIBM½«Eclipse¾èÏ ......
http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/mexfunction.html
mexFunction (C and Fortran) -
Entry point to C/C++ or Fortran MEX-file
C Syntax
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs,
const mxArray *prhs[]);
Fortran
Syntax
subrouti ......