Jump to content

[Dúvida] biblioteca crypt em linux


Recommended Posts

Posted

Boa noite,

Estou a tentar compilar um programa onde uso a biblioteca 'crypt', mas não estou a conseguir. Já andei a pesquisar, mas nada até agora. Penso estar a fazer o necessário..

#define PIPE_NAME   "connect"
#define _XOPEN_SOURCE
#define _GNU_SOURCE
#include <unistd.h>
#include <crypt.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
#include <errno.h>
(..)

Tenho um simples makefile, com o comando

gcc -lm -lcrypt -o teste teste.c

A resposta diz me sempre: referência indefinida a `crypt'. Isto tudo no sistema xubuntu.

Alguém que saiba o que me está a faltar?

Obrigado pela atenção,

alves077

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.