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

linuxÏÂgcc±àÒësinº¯Êý³ö´íµÄÎÊÌâ

 
Q:
I
keep getting
errors due to library functions being undefined,
but I'm #including all
the right header files.
A:
In the general case of calling code in an
external library,
using #include
to pull in
the right header file(s) is only half
of the story; you also have to tell the linker to search the
external library itself.
The declarations in the header file
only tell the compiler how to call the external functions;
the header file doesn't supply the definitions of the external
functions, or tell the compiler/linker where to find those
definitions.
In some cases
(especially if the functions are nonstandard)
obtaining
those definitions
may require explicitly asking
for the correct libraries to be
searched
when you link the program.
(Some systems may be able to arrange
that whenever you #include
a header,
its associated library, if nonstandard,
is automatically requested at link time,
but such a facility is not
widespread.)
See also questions
10.11
,
11.30
,
13.26
,
14.3
,
and
19.40
.
Q:
I'm trying to do some simple
trig,
and I am #including <math.h>
,
but
the linker keeps
complaining
that functions like sin
and cos
are undefined.
A:
Make sure you're actually linking with the math library.
For instance,
due to a longstanding bug in Unix and Linux systems,
you usually need to use an explicit -lm
flag,
at the
end
of the command line,
when compiling/linking.
See also questions
13.25
,
13.26
,
and
14.2
.
µ±Ê¹ÓÃgcc±àÒëÆ÷±àÒ뺬Êýѧº¯ÊýµÄC³ÌÐòʱ,»á³öÏÖundefined reference to `sin'´íÎó.ÕâÖÖ´íÎóÒ»°ãÊÇÓÉÓÚȱÉÙ¿âÔì³ÉµÄ.ʹÓÃ-lm¼´¿É.Makefile¿ÉÒÔÕâÑùд:
pe14-18-11:pe14-18-11.o
         gcc pe14-18-11.o -lm -o pe14-18-11
pe14-18-11.o:pe14-18-11.c
         gcc -c pe14-18-11.c -o pe14-18-11.o
clean:
         rm -f *.o pe14-18-11
¾ßÌåÔ­Òò¼°½â¾ö°ì·¨Îª:
¼ÓÈëÁ¬½áµÄº¯Ê½¿


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

linuxÖÐmount¹²Ïísmbfs

 ×ª×Ô£ºhttp://www.neatstudio.com/show-365-1.shtml
ÔÚubuntuÏÂÃæĬÈÏÊDz»ÄÜmount samba¹²ÏíµÄĿ¼µÄ£¬¶øÔÚ¹«Ë¾ÀÎÒ²»µÃ²»Á¬½ÓÕâÑùµÄĿ¼£¬ÔÚwindowsÏÂÃæµÄʱºò£¬samba¹²Ïí¾ÍÏówindowsµÄ¹²ÏíĿ¼ÄÇÑùµÄ·½±ã£¬µ«ÊÇÔÚlinuxÏÂÃæ¾Í²»ÊÇÕâÑùµÄÁË¡£
Ê×ÏÈ£¬ÄãÒªÏÂÔØsmbmount,ÔËÐÐ £º
apt-get install smbfs
È»ºó¾Í»á°² ......

Linux findÃüÁîÏê½â

http://blog.chinaunix.net/u1/53398/showart_478990.html
ÓÉÓÚfind¾ßÓÐÇ¿´óµÄ¹¦ÄÜ£¬ËùÒÔËüµÄÑ¡ÏîÒ²ºÜ¶à£¬ÆäÖд󲿷ÖÑ¡ÏֵµÃÎÒÃÇ»¨Ê±¼äÀ´Á˽âһϡ£¼´Ê¹ÏµÍ³Öк¬ÓÐÍøÂçÎļþϵͳ( NFS)£¬findÃüÁîÔÚ¸ÃÎļþϵͳÖÐͬÑùÓÐЧ£¬Ö»Äã¾ßÓÐÏàÓ¦µÄȨÏÞ¡£
ÔÚÔËÐÐÒ»¸ö·Ç³£ÏûºÄ×ÊÔ´µÄfindÃüÁîʱ£¬ºÜ¶àÈ˶¼ÇãÏòÓÚ°ÑËü·ÅÔÚºǫִ́ÐУ¬Òò ......

Linux³£ÓÃÎļþ²Ù×÷ÃüÁî

 ÕâƪÎĵµÊµÓÃÐÔºÜÇ¿£¬Ëü²»Êǽ²Ä³¸öÃüÁîµÄ²ÎÊý¾ßÌ庬Ò壬¶øÊÇ´Óʵ¼Ê
¹¤×÷µÄ½Ç¶ÈÀ´¿¼ÂÇ£¬Íê³Éʲô¹¤×÷ÐèҪʲôָÁî¡£
ÏÂÃæÊÇÎÒÃǾ­³£Òª×öµÄһЩÊÂÇé¡£ÔÚÏÂÃæ¾ßÌå²ÎÊýÒâÒå²»½âÊÍ£¬ÒªÁ˽âÕâЩ
¿ÉÒÔ²éѯ¸ÃÃüÁî°ïÖúÎĵµ
1. ´´½¨Ä¿Â¼
mkdir
NO1. ÔÚµ±Ç°Â·¾¶´´½¨Ò»¼¶Ä¿Â¼
[root@rehat root]# mkdir test
NO2. ÔÚµ±Ç°Â ......

LinuxÖеÄÄÚ´æ¹ÜÀí

Ò».ÔÚLinux²Ù×÷ϵͳµÄÄÚ´æÖй²ÓÐÎå¿é¿Õ¼ä:´úÂë¶Î£¬Êý¾Ý¶Î£¬BBS¶Î£¬¶ÑºÍÕ»
´úÂë¶Î£º´úÂë¶ÎÊÇÓÃÀ´´æ·Å¿ÉÖ´ÐÐÎļþµÄ²Ù×÷Ö¸ÁҲ¾ÍÊÇ˵ÊÇËüÊÇ¿ÉÖ´ÐгÌÐòÔÚÄÚ´æÖֵľµÏñ¡£´úÂë¶ÎÐèÒª·ÀÖ¹ÔÚÔËÐÐʱ±»·Ç·¨Ð޸ģ¬ËùÒÔÖ»×¼Ðí¶ÁÈ¡²Ù×÷£¬¶ø²»ÔÊÐíдÈ루Ð޸ģ©²Ù×÷——ËüÊDz»¿ÉдµÄ¡£
 
Êý¾Ý¶Î£ºÊý¾Ý¶ÎÓÃÀ´´æ·Å¿ÉÖ´ÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ