Sida 1 av 1

Nybörjarfråga om diverse bibliotek...

Postat: 24 nov 2007, 15:21
av Johnny Rosenberg
Efter att ha försökt använda en plugin till GIMP som heter MathMap och kapitalt misslyckats med detta har jag bara en liten kort fråga att ställa, efter att ha läst den logfil som MathMap så snällt efterskänkte. Den hävdar nämligen följande:

Kod: Markera allt

gcc -O2 -c -fPIC -o /tmp/mathfunc32576_1.o /tmp/mathfunc32576_1.c
/tmp/mathfunc32576_1.c:38:20: error: stdlib.h: No such file or directory
/tmp/mathfunc32576_1.c:39:18: error: math.h: No such file or directory
/tmp/mathfunc32576_1.c:40:21: error: complex.h: No such file or directory
/tmp/mathfunc32576_1.c:272: error: expected ‘;’, ‘,’ or ‘)’ before ‘n1’
/tmp/mathfunc32576_1.c:274: error: expected ‘;’, ‘,’ or ‘)’ before ‘i’
/tmp/mathfunc32576_1.c:276: error: expected ‘;’, ‘,’ or ‘)’ before ‘n’
/tmp/mathfunc32576_1.c:278: error: expected ‘;’, ‘,’ or ‘)’ before ‘i’
/tmp/mathfunc32576_1.c:279: error: expected ‘;’, ‘,’ or ‘)’ before ‘i’
/tmp/mathfunc32576_1.c:300: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘float’
/tmp/mathfunc32576_1.c: In function ‘calc_lines’:
/tmp/mathfunc32576_1.c:561: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c:587: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c:614: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c:640: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c:667: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c:693: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c:700: warning: incompatible implicit declaration of built-in function ‘hypot’
/tmp/mathfunc32576_1.c:743: warning: incompatible implicit declaration of built-in function ‘pow’
/tmp/mathfunc32576_1.c: In function ‘init_frame’:
/tmp/mathfunc32576_1.c:797: warning: incompatible implicit declaration of built-in function ‘malloc’
Så min kanske allt för snabba slutsats blir att jag måste installera något som ger mig tillgång till stdlib.h, math.h och complex.h.

Säkert busenkelt, men vad är det jag troligen inte fattat att jag måste installera?

J.R.

SV: Nybörjarfråga om diverse bibliotek...

Postat: 24 nov 2007, 15:48
av gasol
installera build-essential paketet, där förljer libc-dev paketet med

SV: Nybörjarfråga om diverse bibliotek...

Postat: 24 nov 2007, 16:01
av Johnny Rosenberg
Tack så mycket för ditt svar.

Dock måste jag erkänna att jag strax efter att ha ställt frågan lyckades få det att fungera med hjälp av det engelskspråkiga forumet där jag fick denna användbara länk. En sökning där på nyckelordet "stdlib.h" gav en mängd alternativ på paket, varav vi installerade libc6-dev, som vi hittade i Synaptic. Efter att ha installerat detta fungerade det hela perfekt, i alla fall vid en första test. Får hoppas att det kommer att fungera i fortsättningen. Och inget behövde man starta om heller...

Och nu när du nämnt det, kommer jag ihåg att jag installerade build-essential-paketet tidigare i min förra Ubuntu-installation (gjorde en nyinstallation från nyformaterade hårddiskar relativt nyligen från Ubuntu Studio 7.10-alternate-skivan) och att det fungerade. Så nu till min följdfråga:

I synaptic kan man läsa följande information om build-essential:

Kod: Markera allt

informational list of build-essential packages 
If you do not plan to build Debian packages, you don't need this
package.  Moreover this package is not required for building Debian
packages.

This package contains an informational list of packages which are
considered essential for building Debian packages.  This package also
depends on the packages on that list, to make it easy to have the
build-essential packages installed.

If you have this package installed, you only need to install whatever
a package specifies as its build-time dependencies to build the
package.  Conversely, if you are determining what your package needs
to build-depend on, you can always leave out the packages this
package depends on.

This package is NOT the definition of what packages are
build-essential; the real definition is in the Debian Policy Manual.
This package contains merely an informational list, which is all
most people need.   However, if this package and the manual disagree,
the manual is correct.
Jag tolkade det först som att jag, som inte bygger deb-paket, inte behöver detta. Dock kom jag just på att detta förmodligen är sant, i mitt fall räckte det ju med en liten delmängd av detta, nämligen lib6-dev, så jag antar att jag just besvarade min egen följdfråga innan jag ens hann ställa den ordentligt...  :P

Tack i alla fall för snabbt svar, skönt att veta att man kan få hjälp här.

J.R.

SV: Nybörjarfråga om diverse bibliotek...

Postat: 24 nov 2007, 16:49
av gasol
Nope egentligen så behöver du inte det paketet, det är bara ett samlingspaket för de grundbibliotek & verktyg du behöver, samt en kompilator så att man slipper installera allt separat.

Dock så tycker jag inte beskrivningen är riktigt korrekt för det paketet. Allt som ingår i build-essential (förutom dkpg-dev) behövs för att kompilera ett program i C / C++ för GNU/Linux.

Du behöver en kompilator, libc, och väldigt ofta make (gnu make).