Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

qt4ÖÐÈçºÎµ÷ÓÃCº¯Êý£¨linuxÏ£©

qtĬÈϵıà³ÌÓïÑÔΪC++ÓïÑÔ¡£Èç¹ûÄãÓÃqt±àÒë.cÎļþ£¬»á³öÏÖÕÒ²»µ½CÓïÑÔµÄĬÈÏÍ·ÎļþµÈ´íÎó£¨È磺stdio.hµÈ£©¡£qtÖв»Ö§³Ö
extern "C"{}µÄÕâÖÖд·¨£¬ÎÒÇ°¼¸ÌìÓÐÒ»¸öC³ÌÐòÐèÒªÒÆÖ²µ½QtµÄ¹¤³ÌÖУ¬±¾Ï£ÍûÖ±½Óextern "C"¾ÍokÁË£¬µ«·¢ÏÖqt4¾ÓÈ»²»Ö§³ÖÕâÖÖд·¨¡£ÎҵijÌÐòÖÐÓõ½Á˺ü¸¸ölinuxϵͳͷÎļþ£¬ÊÇÏò´®¿Ú·¢Ö¸ÁîÖ®ÀàµÄ³ÌÐò£¬³ÌÐòÖÐÓõ½ÁË»¥³âËø²¢´´½¨ÁËÒ»¸öÏ̡߳£Èç¹ûÔÙÓÃqtÓïÑÔÀ´Ð´Ò»±éµÄ»°ÎÒ»á¹ÒµôµÄ£¬ËùÒÔûÓа취£¬ÔÚÍøÉÏÕÒÁË°ëÌ죬ÖÕÓÚÕÒµ½½â¾ö·½·¨¡£
½«.cÎļþ±àÒëΪº¯Êý¿âµÄ·½Ê½ÔÚqtϵ÷Óã¬ÕâÖÖ·½·¨Ã²ËÆÐеÃͨ£¬ÎҾͿªÊ¼Ðж¯ÁË¡£
ÏÂÃæµÄÄÚÈݽ²µÃ±È½Ï¶à£¬±È½ÏÈ«£¬±È½ÏÊʺϳõѧÕߣ¬ÊÇÎÒÔÚÍøÉÏdownµÄ£¬¸ø³öÁËÔ­ÍøÕ¾µÄÁ´½Ó£¬×îºó¸ø³öÁËÒ»¸ö³ÌÐò¡£¾­¹ý×Ô¼ºÕûÀíºÃ¹éÄÉÈçÏ£º
ÐèҪ˵Ã÷µÄÊÇ£ºÊ¹ÓÃgcc¿ÉÒÔ½«³ÌÐò±àÒë³É¶¯Ì¬¿â»òÕß¾²Ì¬¿âµÄÐÎʽ£¬ËüÃÇÔÚ³ÌÐòÖеĵ÷Óõķ½Ê½Ò²²»¾¡Ïàͬ£¬¸ø³öµÄ³ÌÐòÖе÷ÓõÄÊǶ¯Ì¬Á¬½Ó¿â¡£±àÒë³É¶¯Ì¬µÄ»¹ÊǾ²Ì¬µÄ¸ù¾Ý×Ô¼ºµÄÐèÒª½øÐС£Èç¹ûÔ­C³ÌÐò±àÒëµÄʱºòÐèÒªgccµÄ¶îÍâÑ¡Ïî(Èç gcc -lpthread -o hello hello.c)µÈ£¬½¨Òé²ÉÓö¯Ì¬µÄÐÎʽ¡£
1.ʲôÊǾ²Ì¬Á¬½Ó¿â£¬Ê²Ã´ÊǶ¯Ì¬Á´½Ó¿â
         ¾²Ì¬Á´½Ó¿âÓ붯̬Á´½Ó¿â¶¼Êǹ²Ïí´úÂëµÄ·½Ê½£¬Èç¹û²ÉÓþ²Ì¬Á´½Ó¿â£¬ÔòÎÞÂÛÄãÔ¸²»Ô¸Ò⣬lib ÖеÄÖ¸Áȫ²¿±»Ö±½Ó°üº¬ÔÚ×îÖÕÉú³ÉµÄ EXE ÎļþÖÐÁË¡£µ«ÊÇÈôʹÓàDLL£¬¸Ã DLL ²»±Ø±»°üº¬ÔÚ×îÖÕ EXE ÎļþÖУ¬EXE ÎļþÖ´ÐÐʱ¿ÉÒÔ“¶¯Ì¬”µØÒýÓúÍжÔØÕâ¸öÓë EXE ¶ÀÁ¢µÄ DLL Îļþ¡£¾²Ì¬Á´½Ó¿âºÍ¶¯Ì¬Á´½Ó¿âµÄÁíÍâÒ»¸öÇø±ðÔÚÓÚ¾²Ì¬Á´½Ó¿âÖв»ÄÜÔÙ°üº¬ÆäËûµÄ¶¯Ì¬Á´½Ó¿â»òÕß¾²Ì¬¿â£¬¶øÔÚ¶¯Ì¬Á´½Ó¿âÖл¹¿ÉÒÔÔÙ°üº¬ÆäËûµÄ¶¯Ì¬»ò¾²Ì¬Á´½Ó¿â¡£ÔÚwindowsºÍlinuxÉ϶¼ÊÇÏàͬµÄ£¬Ö»²»¹ýÎļþµÄ¸ñʽ²»Í¬¶øÒÑ¡£
http://www.cnblogs.com/winston/archive/2008/07/05/1236273.html
2.gccÉú³É¾²Ì¬¿âºÍ¶¯Ì¬¿â
µÚ1²½£º±à¼­µÃµ½¾ÙÀýµÄ³ÌÐò--hello.h¡¢hello.cºÍmain.c£»
µÚ2²½£º½«hello.c±àÒë³É.oÎļþ£»
ÎÞÂÛ¾²Ì¬¿â£¬»¹ÊǶ¯Ì¬¿â£¬¶¼ÊÇÓÉ.oÎļþ´´½¨µÄ¡£Òò´Ë£¬ÎÒÃDZØÐ뽫Դ³ÌÐòhello.cͨ¹ýgccÏȱàÒë³É.oÎļþ¡£
ÔÚϵͳÌáʾ·ûϼüÈëÒÔÏÂÃüÁîµÃµ½hello.oÎļþ¡£
# gcc -c hello.c
µÚ3²½£ºÓÉ.oÎļþ´´½¨¾²Ì¬¿â£»
¾²Ì¬¿âÎļþÃûµÄÃüÃû¹æ·¶ÊÇÒÔlibΪǰ׺£¬½ô½Óןú¾²Ì¬¿âÃû£¬À©Õ¹ÃûΪ.a¡£ÀýÈ磺ÎÒÃǽ«´´½¨µÄ¾²Ì¬¿âÃûΪmy


Ïà¹ØÎĵµ£º

ÈçºÎÔÚWINDOWSºÍLinuxÏÂÅäÖû·¾³±äÁ¿

ÍøÂçÉϺÍÊéÉÏÓи÷ÖÖÅäÖÃJDK»·¾³±äÁ¿µÄ·½·¨£¬µ«ÊÇÈ·ÃèÊö²»Ò»Ö£¬¸ø³õѧÕßÔì³ÉÁËÒ»¶¨µÄÀ§ÄÑ£¨ÏëÆðµ±Ê±µÄÎÒ£©¡£ÒÔÏÂÊÇÎÒ×Ô¼º×ܽáµÄ£¬°Ù·Ö°Ù¿ÉÒÔÓá£
´ËÎÄÏêÊöÁËÈçºÎÔÚwindowsºÍlinuxÏÂÅäÖû·¾³±äÁ¿¡£
Ò»¹²ÐèÒªÅäÖÃ3¸ö±äÁ¿£º
JAVA_HOME£ºÖ÷ÒªÊÇΪÁËÆäËüÁ½¸öʹÓ㬼ò»¯ÅäÖã¬jdk°²×°µÄÍêÕûµÄ·¾¶Ãû£¬Ò»Ö±µ½jdk...Ϊֹ¡£
CLAS ......

SQLiteÓëC½áºÏ

SQLite¹Ù·½ÍøÕ¾Àý×Ó£º
#include <stdio.h>
#include <sqlite3.h>
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
i ......

linux CÕýÔò±í´ïʽ

ÔÚÍøÉÏÕÒµ½µÄÒ»¸ö³ÌÐò
[c]
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
/* È¡×Ó´®µÄº¯Êý */
static char* substr(const char*str,unsigned start, unsigned end)
{
      unsigned n = end - start;
      static char stbuf[256]; ......

[C/C++] °ÑÒ»¸öÕûÐÍÕûÊýת³É×Ö·û´®

ÎÊÌâÃèÊö£ºÐ´Ò»¸öº¯Êý£¬½ÓÊÜÒ»¸öÕûÊý£¨¼Ù¶¨ÓÃint±íʾ£©£¬Êä³ö¸ÃÕûÊýµÄ×Ö·û´®ÐÎʽ¡£²ÉÓÃÈçϺ¯ÊýÔ­ÐÍ£º
void itoa ( int val, char* buf );

ÕâÀï¼Ù¶¨buf×ã¹»´óÒÔÈÝÄÉÈκÎintÀàÐÍÊýÖµµÄ×Ö·û´®¡£
Õâ¸öÎÊÌ⣬³õ¿´ºÃÏñûÓÐʲôÄѶȡ£Èç¹ûÊÇ0£¬¾ÍÖ±½ÓÊä³ö'0'£»Èç¹ûÊÇÕýÊý£¬¾Íͨ¹ýÈ¡Ä£(%)ºÍÇóÉÌ(/)ÔËËã¿ÉÒÔÖðλȡµÃ¸ÃÕûÊýµÄÊ ......

ÓÀÔ¶Éñ»°——C#/C/C++µ½µ×»¹ÄÜ×öʲô£¿

http://blog.csdn.net/tonyxiaohome/archive/2010/04/27/5536367.aspx
ÎÒ¿´ÁËÒÔºóÎÒҲ˵¼¸¾ä£¬ËãÎÒÔÚITÐÐÒµ´òƴһЩ¾­Ñé¡£
 Ê×ÏÈÕâ¸ö»°ÌâʵÔÚÊÇÌ«´óÁË¡£
C++ °üÀ¨C²»£¿
Æ»¹û¡¢Ò»Ð©Èí¼þ ±ÈÈçMysql£¬sqlite ¶¼ÊÇÄ£¿é»¯ÎªÖ÷
»ù±¾¾ÍÊÇCÓïÑÔ¡£
 Ê×ÏÈÎÒ²»ÈÏͬ C++°üÀ¨C¡£
Õâ¸ö»°Ìâ ¾ÍÓÐÎÊÌâ¡£
ÎÒÃǸĸĿ´  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ