Skip to content

Instantly share code, notes, and snippets.

@BoonsNaibot
Created September 18, 2014 20:18
Show Gist options
  • Save BoonsNaibot/a90c311df99efb915172 to your computer and use it in GitHub Desktop.
Save BoonsNaibot/a90c311df99efb915172 to your computer and use it in GitHub Desktop.
undefined reference to `STATIC_FUNCTION' collect2: error: ld returned 1 exit status
#include <stdio.h>
#include <string.h>
static int static_function(int i) {
printf("%i", i);
return i;
}
static void *IMPORT_q[] = { (void *)static_function };
void main()
{
STATIC_FUNCTION(8);
return;
}
static void **IMPORT_q = NULL;
static int static_function(int i) ;
#define FUNCTION_INDX 0
#define STATIC_FUNCTION (*(int)IMPORT_q[FUNCTION_INDX])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment