GetPrivateProfile sous linux
Bonjour,
J'ai plus l'habitude de programmer sur Windows, mais j'aurai besoin d'ecrire un petit prog sous Linux (Ubuntu 8.04 Server) qui lise et modifie un fichier ".ini"
j'ai fait un petit squelette, qui passe bien avec Visual C++, mais sous Linux en ligne de commande il plante à la compil :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| int main(int argc, char* argv[])
{
char basedir[80];
int nb;
nb=argc;
//printf("nbre : %d\n", argc);
//printf("input : %s %s", argv[0],argv[1]);
//
GetPrivateProfileString("PHP","open_basedir","",basedir,sizeof(basedir),argv[1]);
printf("valeur du champ : %s\n", basedir);
return 0;
} |
Code:
gcc -W -Wall -o testini.exe testini.c
Code:
1 2 3 4 5 6 7
| testini.c: In function âmainâ:
testini.c:13: warning: implicit declaration of function âGetPrivateProfileStringâ
testini.c:14: warning: implicit declaration of function âprintfâ
testini.c:14: warning: incompatible implicit declaration of built-in function âprintfâ
/tmp/cckleoNg.o: In function `main':
testini.c:(.text+0x5d): undefined reference to `GetPrivateProfileString'
collect2: ld returned 1 exit status |
Quelqu'un pourrait il m'eclairer ?
Merci d'avance