gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smsd-postgresql compilation error


From: jtulin
Subject: Re: smsd-postgresql compilation error
Date: Wed, 25 Jun 2003 16:33:40 +0800 (PHT)

//****this code is from smsd****//


#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <pthread.h>
#include <getopt.h>
#include <time.h>
#include <dlfcn.h>

#ifndef WIN32
# include <unistd.h>  /* for usleep */
# include <signal.h>
#else
# include <windows.h>
# include "../win32/winserial.h"
# define WRITEPHONE(a, b, c) WriteCommBlock(b, c)
# undef IN
# undef OUT
#endif

#include <glib.h>

#include "misc.h"

#include "gnokii.h"
#include "smsd.h"
#include "lowlevel.h"
#include "db.h"


/* Hold main configuration data for smsd */
SmsdConfig smsdConfig;

/* Global variables */
bool GTerminateThread;

/* Local variables */
static DBConfig connection;
void (*DB_Bye) (void) = NULL;;
gint (*DB_ConnectInbox) (const DBConfig) = NULL;
gint (*DB_ConnectOutbox) (const DBConfig) = NULL;
gint (*DB_InsertSMS) (const gn_sms * const) = NULL;
void (*DB_Look) (void) = NULL;

static pthread_t db_monitor_th;
pthread_mutex_t db_monitorMutex;
static volatile bool db_monitor;



/*************************************/
gint LoadDB (void)
{
  void *handle;
  GString *buf;
  gchar *error;

  buf = g_string_sized_new (64);

  g_string_sprintf (buf, "%s/lib%s.so", smsdConfig.libDir,
smsdConfig.dbMod); <--------------- error point this line 107

#ifdef XDEBUG
  g_print ("Trying to load module %s\n", buf->str);
#endif

  handle = dlopen (buf->str, RTLD_LAZY);
  if (!handle)
  {
    g_print ("dlopen error: %s!\n", dlerror());
    return (1);
  }

  DB_Bye = dlsym(handle, "DB_Bye");
  if ((error = dlerror ()) != NULL)
  {
    g_print (error);
    return (2);
  }

  DB_ConnectInbox = dlsym(handle, "DB_ConnectInbox");
  if ((error = dlerror ()) != NULL)
  {
    g_print (error);
    return (2);
  }

  DB_ConnectOutbox = dlsym(handle, "DB_ConnectOutbox");
  if ((error = dlerror ()) != NULL)
  {
    g_print (error);
    return (2);
  }

  DB_InsertSMS = dlsym(handle, "DB_InsertSMS");
  if ((error = dlerror ()) != NULL)
  {
    g_print (error);
    return (2);
  }

  DB_Look = dlsym(handle, "DB_Look");
  if ((error = dlerror ()) != NULL)
  {
    g_print (error);
    return (2);
  }

  return (0);
}

/****************************************/
 anyone can help me?

 thank.
    jotol




> On Wed, 25 Jun 2003 address@hidden wrote:
>
>> hi,
>>   please advice what me is this error, is there any library needed? i
>> am
>> using gnokii 0.5.1 and it works okey, when i compile smsd i got this
>> error.
>>
>> gcc  smsd.o lowlevel.o   -lpthread `glib-config --libs` -s -rdynamic
>> -L../common -lgnokii -ldl -o smsd
>> smsd.o: In function `LoadDB':
>> /usr/src/gnokii/smsd/smsd.c:107: undefined reference to
>> `g_string_printf' collect2: ld returned 1 exit status
>> make: *** [smsd] Error 1
>
> Seems that somebody hacked your source. The original line 107 looks
> like:
>
> g_string_sprintf (buf, "%s/lib%s.so", smsdConfig.libDir,
> smsdConfig.dbMod);
>
>
>
>                                       jan
>
>
> --
>
>
>
> _______________________________________________
> gnokii-users mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/gnokii-users







reply via email to

[Prev in Thread] Current Thread [Next in Thread]