R
Robert Mens
Hi,
My compiler/linker gives me the strangest error:
process.o(.text+0x0): In function `login_user_login':
: multiple definition of `login_user_login'
login.o(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [imserver] Error 1
I only have this function defined once:
this is my login.c file
-----------------------------------------------------------------
/*
** login.c - handles the login requests from servers
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mysql.h"
void login_user_login(char * username, char * password)
{
if (mysql_user_login(username, password) == 1)
{
printf("Access denied for user %s\n", username);
}else{
printf("User %s logged in\n", username);
mysql_user_setstatus(username, "online");
}
}
-----------------------------------------------------------------
this is my login.h file for including from other source files:
void login_user_login(char * username, char * password);
I did this this way in my project and never encountered that error...
Also, it only happens when i do a make clean; make, thus when the whole
source gets recompiled instead of just login.o
If i do a make "clean; make" and then adjust the login_user_login in login.c
to something different en then "make" the program works fine!?!?
Anyone knows the solution?
Thanks in advance,
Robert
My compiler/linker gives me the strangest error:
process.o(.text+0x0): In function `login_user_login':
: multiple definition of `login_user_login'
login.o(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [imserver] Error 1
I only have this function defined once:
this is my login.c file
-----------------------------------------------------------------
/*
** login.c - handles the login requests from servers
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mysql.h"
void login_user_login(char * username, char * password)
{
if (mysql_user_login(username, password) == 1)
{
printf("Access denied for user %s\n", username);
}else{
printf("User %s logged in\n", username);
mysql_user_setstatus(username, "online");
}
}
-----------------------------------------------------------------
this is my login.h file for including from other source files:
void login_user_login(char * username, char * password);
I did this this way in my project and never encountered that error...
Also, it only happens when i do a make clean; make, thus when the whole
source gets recompiled instead of just login.o
If i do a make "clean; make" and then adjust the login_user_login in login.c
to something different en then "make" the program works fine!?!?
Anyone knows the solution?
Thanks in advance,
Robert