Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

linking warning message. C Question!

0 views
Skip to first unread message

Robby

unread,
Dec 21, 2009, 3:14:01 PM12/21/09
to
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

Igor Tandetnik

unread,
Dec 21, 2009, 3:43:06 PM12/21/09
to
Robby <Ro...@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

Robby

unread,
Dec 21, 2009, 8:13:01 PM12/21/09
to
"Igor Tandetnik" wrote:

> Robby <Ro...@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

Igor Tandetnik

unread,
Dec 21, 2009, 8:31:31 PM12/21/09
to
Robby <Ro...@discussions.microsoft.com> wrote:
> Can we turn off Incremental link?

Project | Properties | Linker | General | Enable Incremental Linking

Robby

unread,
Dec 22, 2009, 11:08:01 AM12/22/09
to
"Igor Tandetnik" wrote:

Thanks Igor!

0 new messages