Robby
2009-12-21 20:14:01 UTC
Hello,
Okay, I was able to solve for extern variables in the previous post. But
now, I get a linker warning that I think involves an enum command which I
would desire it too to be global.
Please do consider the following code:
============================KERNEL.h
enum enumKM{KM_QUIT = 0, KM_CREATE, KM_RECUR};
============================KERNEL.c
#include <stdio.h>
#include "KERNEL.h"
#include "API.h"
int main()
{
API_InsertMessage(KM_QUIT);
return 0;
}
============================API.h
void API_InsertMessage(enum enumKM m);
============================API.c
#include "API.h"
#include "KERNEL.h"
void API_InsertMessage(enum enumKM m)
{
long h;
h = m;
}
=======================================
Why is the following linker warning is generated:
1>LINK :
C:\_DTS_PROGRAMMING\C_PROGRAMMING\c\C_TESTS\C_FILES\CFILES\ennnum\Debug\ennnum.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
Question: Do we have to use extern for enums too if we want them global?
Okay, I was able to solve for extern variables in the previous post. But
now, I get a linker warning that I think involves an enum command which I
would desire it too to be global.
Please do consider the following code:
============================KERNEL.h
enum enumKM{KM_QUIT = 0, KM_CREATE, KM_RECUR};
============================KERNEL.c
#include <stdio.h>
#include "KERNEL.h"
#include "API.h"
int main()
{
API_InsertMessage(KM_QUIT);
return 0;
}
============================API.h
void API_InsertMessage(enum enumKM m);
============================API.c
#include "API.h"
#include "KERNEL.h"
void API_InsertMessage(enum enumKM m)
{
long h;
h = m;
}
=======================================
Why is the following linker warning is generated:
1>LINK :
C:\_DTS_PROGRAMMING\C_PROGRAMMING\c\C_TESTS\C_FILES\CFILES\ennnum\Debug\ennnum.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
Question: Do we have to use extern for enums too if we want them global?
--
Best regards
Roberto
Best regards
Roberto