From: Robby on
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?

--
Best regards
Roberto
From: Igor Tandetnik on
Robby <Robby(a)discussions.microsoft.com> wrote:
> 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

This warning has nothing to do with your actual source code. You have incremental link turned on (default in Debug build), which speeds up linking somewhat: if, say, only one OBJ file changed, the linker can take a previously built EXE and update just that one module. Time savings can be significant for large projects.

In this case, the linker tried to do that, but couldn't find the previously built EXE, or found it but discovered that it wasn't last built with incremental linking on. The warning is harmless, you can safely ignore it.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

From: Robby on
"Igor Tandetnik" wrote:

> Robby <Robby(a)discussions.microsoft.com> wrote:
> > 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
>
> This warning has nothing to do with your actual source code. You have incremental link turned on (default in Debug build), which speeds up linking somewhat: if, say, only one OBJ file changed, the linker can take a previously built EXE and update just that one module. Time savings can be significant for large projects.
[snip]

Can we turn off Incremental link?

Regards
Robbert
From: Igor Tandetnik on
Robby <Robby(a)discussions.microsoft.com> wrote:
> Can we turn off Incremental link?

Project | Properties | Linker | General | Enable Incremental Linking
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

From: Robby on
"Igor Tandetnik" wrote:

> Robby <Robby(a)discussions.microsoft.com> wrote:
> > Can we turn off Incremental link?
>
> Project | Properties | Linker | General | Enable Incremental Linking
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

Thanks Igor!