Thread: ? .s files/"undeclared identifier"?

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    ? .s files/"undeclared identifier"?

    I'm fixing/finishing the programming for a TI MSP430 microcontroller that has been variously worked on by 3 others. I'm trying to follow their formating/styling, but I'm a geezer and out of date here!! (I used to be okay at programming in assembly, C, etc - never an expert or a hacker, programming wasn't my primary job - but I haven't worked in about 6 years so I'm behind the times.)

    The main problem I'm coming against in debugging the software that is already written is "undeclared identifiers". I don't know where they declared MOST of their identifiers!!! I've been able to work with it for the first 12 hours of plowing through, but now I've hit a wall. Are they declared in the .h files??

    There are also some .s files corresponding with the .c files. Most of the .s files have the file's exact c code in comments with the related assembly below the commented c code. All except the file I'm having problems with. Is the .s file generated when the project is compiled or is it something I should edit?

    Thank you for any help you can give me.

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Quote Originally Posted by myshlp
    I don't know where they declared MOST of their identifiers!!! I've been able to work with it for the first 12 hours of plowing through, but now I've hit a wall.
    firstly what compiler are u using. there are few compiler which acually points out which variable are not actually declared.

    Quote Originally Posted by myshlp
    Are they declared in the .h files??
    right, it depends where do u get the error. when u create a .exe file of your .h file and if if u get any error telling u that the vraiable is not declared then the focus of finding the thing should be on your .h file if isn't it should be .c file. the .c file are those file which actually shows u the assemble code of your actaul code. this is uaually used for the purpose of debugging and things.

    ssharish2005

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > Is the .s file generated when the project is compiled or is it something I should edit?
    That would be my interpretation of the things you're seeing.

    > All except the file I'm having problems with
    Is the basic structure the same as all the other .s files, in that it too looks like it was generated by a compiler?

    Knowing which tool set (compiler, assembler) you're using, as well as the exact error message (like is it coming from the compiler or linker) would be useful.

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    3
    ssharish2005:
    I'm using the ImageCraft IDE ICC 430 for development. It has a search feature to find the variable in the files, but so far it only seems to find them in the c files, not the h ones.

    I'm getting the error when I compile the whole project and load it to the controller.

    Salem:
    I think the .s file is generated by the compiler, the file I'm having problems with seems to be missing some of the code that is in the actual .c file, so maybe it was created in an earlier compile - before I started working with it.

    Thanks.

  5. #5
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Quote Originally Posted by myshlp
    ssharish2005:
    I'm using the ImageCraft IDE ICC 430 for development. It has a search feature to find the variable in the files, but so far it only seems to find them in the c files, not the h ones.

    I'm getting the error when I compile the whole project and load it to the controller.
    Thanks.
    i am sorry i dont no more abour the imageCraft IDE ICC 430. but i suspect that if u find that variable in the .c file and then its not decaled in this file thats .c there would be a chances of dealaring it in .h file and then used in .c file as well.

    ssharish2005

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Are all the .s files changed whenever you do a build - check the file create date/time using explorer.

    Backup first.
    If you delete all the .s files, does a full rebuild recreate all of them?

  7. #7
    Registered User
    Join Date
    Jan 2006
    Posts
    3
    Salem: A full rebuild recreated all of them.

    ssharish2005 & Salem: I actually found the .h file I needed to declare it in. It was in a .h associated with a totally different (and seemingly unrelated) file name. Basically, it was in the measure.h file when the call for it was in the time.c file.

    Thank you for your help. It seems like it's always the little things that make my programming life miserable!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. "undeclared identifier" error
    By ExDHaos in forum C++ Programming
    Replies: 4
    Last Post: 05-22-2009, 04:10 PM
  2. Replies: 1
    Last Post: 08-06-2007, 10:09 PM