C language > Beginner questions

Symbol multiply defined, but only appeaars in Project File.

(1/2) > >>

AJ Crayon:
Don't know if this is the correct forum for this question.

I am getting the following multiply defined error with Pelles C version 9.00:
POLINK: error: Symbol '_location' is multiply defined: 'C:\Users\AJ Crayopn\Google Drive\Observing\Double Stars\Measure\output\main.obj' and 'C:\Users\AJ Crayopn\Google Drive\Observing\Double Stars\Measure\output\Proc_Star.obj'.

Neither my source modules nor headers use this symbol.  The only place in the project location appears is in the project file - twice.

I'm sure there is a way to recover from this but have been unsuccessful so far.

Any help would be appreciated.

frankie:
Hi welcome to PellesC forum.
It isn't possible to understand from where comes the problem with the info you gave us.
What is sure is that the symbol location is defined twice in 2 modules.
You should produce a very reduced sample to publish so we can have a look at it.
In the meantime I suggest you to check in files included in the 2 modules for a symbol location non preceeded by the extern or static qualifiers.
Even a function defined in the header file, not defined as static and inline can produce the same problem.

AJ Crayon:
Thank you for response.  I have tried to reproduce the error with smaller program - to no avail, but will try again. I will follow-up on your suggestion and see if anything turns up.

AJ Crayon:
Frankie, I found my problem by following your suggestion about checking includes files.  Found the culprit a
   char location[] = "../pipe.txt";
Changed location to another symbol and get Project build ended successfully.

John Z:
Something to try is to use the 'Find in Files' feature under Edit, search for the symbol in your project directory and search *.c;*.h.  This will show all occurrences and allow you to easily access them. It also  will show the entire line so look for places where the symbol does not show an 'extern' preface but has a type identifier in front. Of course you'll need to check if using a global symbol locally in which case it would be ok without extern. Example search for 'int a'

main.c (10) int a;
menu.c (20) extern int a;
crypt.c (5) int a;  <- no extern suspect because declared in main.c



Hope this help,
John

Navigation

[0] Message Index

[#] Next page

Go to full version