Created
September 18, 2014 20:18
-
-
Save BoonsNaibot/a90c311df99efb915172 to your computer and use it in GitHub Desktop.
undefined reference to `STATIC_FUNCTION' collect2: error: ld returned 1 exit status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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