|
Dear PK
header files are to declare functions and datastrucures. They should not be used to define
global variables.
So now you can do the following.
1-- Create a new file global.c Add this to you project.
Declare whichever variable you want to declare/define.
2 -- use extern name of global variable in the file you want it to be used.
Or you can make a header file containing these extern variables and incude them in the file,
where you inted to use those glob vars.
Tell me whether this solves your problem
Thanks
Ragu
c...@yahoogroups.com wrote:
------------------------ Yahoo! Groups Sponsor
---------------------~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon
or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US &
Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/26EolB/TM ---------------------------------------------------------------------~->
There
is 1 message in this issue.
Topics in this digest:
1. Multi File
Project From: "zhk_pk"
________________________________________________________________________ ________________________________________________________________________
Message:
1 Date: Fri, 16 Apr 2004 05:20:46 -0000 From: "zhk_pk" Subject: Multi File
Project
How can i include global variables in multifile projec!
t.
The method which i have adopted is: 1) declare global variables and global
define directive in the header file "def.h"(including ifdef directive too.)
2)
Add this header file in the different files of my project by #include directive
Problem: CCS v2.10 gives the compilation error of "multiple variables declaration"
Then i have adopted the following method:
1) declare global variables and
global define directive in the header file "def.h"(including ifdef directive too.)
2)Made another header file"def_extern.h" in which redeclare all global variables
with the "extern" directive.
3)add "def.h" in the main file with the "#include"
directive
4) add "def_extern.h" in the other files with the "#include" directive
recompiled the project.This time i donot get the compilation error but the
linking error "unable to add in .text ".
Can anyone help me in this regard.
I am using CCS v!
2.1 and curently using it in the tms320c6711 IDK
Thanks________________________________________________________________________ _____________________________________________________________________________________________
________________-------------------------------------------------------------------------------
-----------------------------------------------------------------
Indiatimes Email now powered by APIC Advantage. Help!
HelpClick on the image to chat with me
|