ubuntuÏ£¬C/C++ͨ¹ýJNIµ÷Óà JAVAÀà
֮ǰд¹ýÒ»¸öʵÏÖÁËijÖÖ¹¦ÄܵÄjava³ÌÐò£¬µ«ÓÉÓÚ½üÈÕ“¹¤×÷”ÐèÒª£¬ÓÖÐèÒªÔÚc/c++ÖÐÖØÐÂʹÓøù¦ÄÜ¡£ÎªÁ˽Úʡʱ¼ä£¬ÎÒ²ÉÈ¡ÁËÔÚc/c++Öе÷ÓÃjava³ÌÐòµÄ·½·¨£¬µ«Ö®Ç°Ã»ÓнӴ¥¹ýÀàËƵĶ«Î÷£¬µ½ÍøÉÏÒ»²é£¬¹ûÈ»ÓÐÀàËƵĶ«Î÷£¬ÐÄÖаµÏ²ing...¡£²éµ½µÄ×ÊÁÏÖÐÓм¸¸ö²»´íµÄÍøÒ³£º
http://blog.sina.com.cn/s/blog_48eef8410100fjxr.html
http://www.diybl.com/course/6_system/linux/Linuxjs/20100331/201638.html
http://hi.baidu.com/pjdashu/blog/item/5e54df9961040d006e068c1b.html
µÚÒ»¸öÍøÖ·£¬Ö÷Òª½éÉÜÁË°²×°java»·¾³ºÍ±àÒë¹ý³Ì£»
µÚ¶þ¸öÍøÖ·£¬Ö÷Òª½éÉÜÁËjniµÄʹÓ÷½·¨¡£
µÚÈý¸öÍøÖ·£¬×îºóµÄ´úÂë±È½ÏÃ÷È·µÄ˵Ã÷ÁËÈçºÎʹÓÃÀïÃæµÄ×Ö·û´®£¬¿ÉÒÔÖ±½Ó¿´×îºóÒ»¶ÎµÄ´úÂë¡£
ÎÒ°´ÕÕµÚÒ»¸öÍøÖ·µÄ·½·¨½øÐÐʵÑ飬·¢ÏÖÁ˺öàµÄÎÊÌâ¡£ÏÈ°ÑÖ÷ÒªÓ¦¸Ã×¢ÒâµÄµØ·½¼Ç¼ÈçÏ£º
ÎÒʹÓõĻ·¾³ÊÇ£ºUbuntu8.04
°²×°ÅäÖÃJava»·¾³ÒÔ¼°±àÒë
°²×°java»·¾³Ê±£¬ÎÒ²ÎÕÕÁË http://wiki.ubuntu.org.cn/Java°²×°ÅäÖÃ
µÄ°²×°ÅäÖ÷½·¨£¬°²×°µÄÊÇjava6¡£ÏÂÃæµÄÅäÖ÷¾¶¿ÉÄܸù¾ÝϵͳµÄ²»Í¬£¬ÂÔÓв»Í¬¡£ÔÚubuntuÏÂĬÈÏÊÇ°²×°µ½ÁË/usr/lib/jvmÏ¡£
È»¶ø£¬´Ë´¦µÄ˵·¨£º“
ҪʹÅäÖÃÉúЧ±ØÐëÖØÆô»úÆ÷»òÕßÔÚÃüÁîÐÐÊäÈë
”²¢²»ÍêÈ«ÕýÈ·£¬×îÆðÂë¶ÔÓÚLD_LIBRARY_PATHÀ´Ëµ²»ÕýÈ·£¬ÒòΪÓÐ×ÊÁÏÏÔʾ£º
òËÆ Ubuntu ²»ÄÜÔÚ profile, environment,.bashrcÖÐÉèÖà LD_LIBRARY_PATH,
¿ÉÒÔÕâÑù½â¾ö¿â×°ÔØÎÊÌ⣺
±à¼ /etc/ld.so.conf Îļþ£¬½«Ö¸¶¨µÄ·¾¶¼ÓÉÏ£¬»òÕßÔÚ /etc/ld.so.conf.d/
Ŀ¼ÖÐÌí¼ÓÒ»¸öеÄÅäÖÃÎļþ£¬ÄÚÈÝ¿´Ò»Ï¸ÃĿ¼ÏÂÆäËüÎļþ¾ÍÃ÷°×ÁË¡£¡£¡£µ±È»ÄãµÃÓÐȨÏÞÕâô×ö¡££¨http://forum.ubuntu.org.cn/viewtopic.php?f=56&t=94830
£©
ÎÒµÄ×ö·¨
Ҫôÿ´ÎʹÓÃ֮ǰ£¬ÒªÃ´ÏÈÔËÐГ. /etc/environment”£¬ÒªÃ´“export LD_LIBRARY_PATH=
$JRE_HOME/lib/i386/client”
ÅäÖùý³ÌÖÐÎÒ»¹²ÎÕÕÁ˵ÚÒ»¸öÍøÖ·ÖеÄÄÚÈÝ£º
JAVA_HOME=/usr/local/java/jdk1.5.0_06
PATH=$PATH:/usr/local/java/jre1.5.0_05/bin
export JAVA_HOME PATH
export
JRE_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
exp
Ïà¹ØÎĵµ£º
ÎÒ¾õµÃ,ÔÚÊäÈëÊä³öº¯ÊýÖÐ,scanf()º¯Êý,Ó¦¸ÃÊÇ×îÂé·³µÄ,ÓÐʱËü¸øÎÒÃǵĽá¹ûºÜ¿ÉЦ,µ«ÊÇÒ»¶¨ÊÇÒ»ÔÒòµÄ....
Ê×ÏÈÉùÃ÷Ò»ÏÂ,ÕâƪÈÕÖ¾²»ÊǽéÉÜscanf()Öи÷ÖÖ¸ñʽ·ûÓ÷¨µÄÎÄÕÂ(ûÓÐÕâ¸ö±ØÒª,µ«ÊÇ´ó¼ÒÒ»¶¨Òª»áÓÃ).
ÎÒ³¢ÊÔÁ˺ܶàÖÖÊäÈë,°üÀ¨Ò»Ð©´íÎóµÄÁ·Ï°,Ôø¾¶Ôscanf()ÓÉÃÔãתÏòÇåÐÑ,ÓÖÓÉÇåÐÑÔÙ´ÎתÏòÃÔã......²»ÖªµÀºÎʱÊǸö ......
ÔÚcÖÐenumµÄʹÓúÍstructºÜÏñ
enum name{
a,b,c
};
struct name{
int a;
int b;
char c;
};
or
typedef struct{
int a;
int b;
char c;
}Name;
ʹÓõÄʱºò¶¼ÒªÏÈÉùÃ÷±äÁ¿
enum name n1,n2,n3;
n1=a;
n2=b;
n3=enum name(3-1);
struct name sn1,sn2;
s ......
ÒýÑÔ
¾¡¹Ü C ÓïÑÔÎÊÊÀÒѽü 30 Ä꣬µ«ËüµÄ÷ÈÁ¦ÈÔδ¼õÍË¡£C ÓïÑÔ¼ÌÐøÎüÒý×ÅÖÚ¶àµÄ¿ª·¢Õߣ¬ËûÃÇΪÁ˱àд¡¢ÒÆÖ²»òά»¤Ó¦ÓóÌÐò¶ø±ØÐëѧϰм¼ÄÜ¡£
±¾ÎÄÊÇΪÁËÂú×ã¶ÔCÓïÑÔ³õѧÕß»òÏëÌá¸ß×ÔÉíCÓïÑÔÐÞΪµÄ¿ª·¢ÈËÔ±µÄÐèÒª¶øдµÄ¡£Ï£Íû¶ÔÄúµÄѧϰºÍ¹¤×÷ÓÐËù°ïÖú¡£ÄúÒ²Ðí²»ÔÞͬÆäÖеÄijЩ·½·¨£¬µ«ÎÒÃÇÏ£ÍûÄú»áϲ»¶ÆäÖеÄһЩ¡£
±¾Î ......
gcc ÊÇcµÄ±àÒëÆ÷£¬g++ÊÇc++µÄ±àÒëÆ÷¡£ccÒ»°ãÊÇÒ»¸ö·ûºÅÁ¬½Ó£¬Ö¸Ïògcc¡£
CCÒ»°ãÊÇmakefileÀïÃæµÄÒ»¸öÃû×Ö£¬¾ßÌåÊÇʲô¸ù¾Ýʵ¼ÊÇé¿ö¾ö¶¨¡£
gccºÍg++¶¼ÊÇGNU(×éÖ¯)µÄÒ»¸ö±àÒëÆ÷¡£
ÎóÇøÒ»:gccÖ»ÄܱàÒëc´úÂë,g++Ö»ÄܱàÒëc++´úÂë
Á½Õ߶¼¿ÉÒÔ£¬µ«ÊÇÇë×¢Ò⣺
1,ºó׺Ϊ.cµÄ£¬gcc°ÑËüµ±×÷ÊÇC³ÌÐò£ ......
³ÌÐò¿ªÍ·ÒªÉùÃ÷
#include <string.h>
º¯ÊýÃû: stpcpy
¹¦ ÄÜ: ¿½±´Ò»¸ö×Ö·û´®µ½ÁíÒ»¸ö
ÓÃ ·¨: char *stpcpy(char *destin, char *source);
³ÌÐòÀý:
#include <stdio.h>
#include <string.h>
int main(void)
{
char string[10];
char *str1 = "abcdefghi";
&n ......