[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Re: Undefined reference to `cos' (och allt annat i math.h)



Uppsamlingskommentarer:

_Carsten Svaneborg_

> Så vidt jeg har hørt har www.3dfx.com en X server for
> VooDoo3 kort [...] Prøv at kigge på Mesa, der er en almost?
> openGL ting til linux, med en del hardware support.

VooDoo... Mitt kort har ett billigt SiS 6326 chip (4 meg minne).
Tvingades ta hem SuSE-s specialskrivna server (XFCom_SiS) för att allt
skulle fungera. Nästa version av Xfree86 kommer att ha den servern
inbyggd. Hade tänkt mig att köra ren Xlib. När man sitter med en svag
processor (och dessutom kommer från assembler-världen) vill man lägga så
lite API lager mellan kod och hårdvara som möjligt. Tro mig, på den här
maskinen _märks_ det om ett program använder extra lager (Qt, Gtk eller
så) :-) Vis av DOS-döden vill jag dessutom slippa fundera över
eventuella framtida dödsryckningar hos saker som Mesa/openGL. Skall dock
ta en titt på biblioteken. Vem vet... en nybörjare har inte råd att vara
dogmatisk i sina inledande beslut.

_Frank Damgaard_

>> "This is possibly a good candidate for *the* most frequently asked
>> C programming related question ever."

> Helt sikkert ! :)

Då borde någon göra frågan överflödig :-) Till exempel att inkludera
raden "Try to link with -lm if you get 'undefined' errors" i varje
man-sida som rör math.h (och liknande råd för alla andra "icke"-standard
bibliotek). Skulle spara bandbredd på nätet, och tid/energi för
nybörjare/vana användare.

_Emil S Hansen_

> Uhhh, du har lige fået mit program til at virke :))

Gud vare tack! Då var frågan inte _helt_ överflödig :-) Steve Summit
påpekar dessutom i sin C-faq att länkningen vanligtvis skall ligga som
sista parameter. Ordningen är viktig eftersom:

http://www.eskimo.com/~scs/C-faq/q13.26.html

Fråga:
"I'm still getting errors due to library functions being undefined, even
though I'm explicitly requesting the right libraries while linking"

Svar:
"Many linkers make one pass over the list of object files and libraries
you specify, and extract from libraries only those modules which satisfy
references which have so far come up as undefined. Therefore, the order
in which libraries are listed with respect to object files (and each
other) is significant; usually, you want to search the libraries last.
(For example, under Unix, put any -l options towards the end of the
command line.) See also question 13.28"

Mvh
Mats Johannesson


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *