This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • TI Thinks Resolved

CCS/MSP-EXP432P401R: Bitset headers not resolving in CCS

Part Number: MSP-EXP432P401R

Tool/software: Code Composer Studio

Hi folks, I have been trying to load the BitSet header and related headers into CCS to no avail. I get a plethora of errors from all the headers/c files that BitSet calls. I have tried installing all the headers into the work space and via full paths using all the locations that BitSet is listed within the TI CCS space. I tried to find a sample program in the Resource Explorer to no avail.

Does anyone have experience in using Bitset and how CCS should be configured to acquire and resolve the headers.

Thanks,

Roger

  • Hi Roger,

    Is your source file that is containing bitset ending with .cpp?

    I compiled this quick minimal example and it compiled fine but only after I used the .cpp extension.

    #include "msp.h"
    
    /* Example 01: Bitset
    Explains the usage std::bitset
    */
     
    
    #include <bitset>
    
     
    using namespace std;
     
    void main()
    {
    	WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;		// stop watchdog timer
        //Constuct 01: 8 bits initialized to zero
        bitset<8> bitset1;
     }
    

  • In reply to Franklin Cooper:

    I tried the above example by creating a new CCS project and then copied the code above into that main() and renamed to cpp. I get all the same errors as before - this is a small snippet. The errors seem to be on all the header files bitset is 'including'. Is there a option or ? I need to set in the project properties or do I need to open a new project in some other way.

    **** Build of configuration Debug for project test ****

    "F:\\TI\\ccsv8\\utils\\bin\\gmake" -k -j 16 all -O

    Building file: "../main.cpp"
    Invoking: ARM Compiler
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="F:/TI/ccsv8/ccs_base/arm/include" --include_path="F:/TI/ccsv8/ccs_base/arm/include/CMSIS" --include_path="F:/TI/ccsv8/eclipse/TI/workspace_v8/test" --include_path="F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include" --advice:power=all --define=__MSP432P401R__ --define=ccs -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="main.d_raw" "../main.cpp"

    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'main.obj' failed
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/libcxx/bitset", line 15: error #41: expected an identifier
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stddef.h", line 47: warning #12-D: parsing restarts here after previous syntax error
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stddef.h", line 54: error #29: expected an expression
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stddef.h", line 54: error #68: expected a "}"
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/stddef.h", line 99: error #171: expected a declaration
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/libcxx/initializer_list", line 77: error #20: identifier "_Ep" is undefined
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/libcxx/initializer_list", line 81: error #131: expected a "{"
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/libcxx/initializer_list", line 85: error #1939: a type qualifier is not allowed on a nonmember function
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/libcxx/initializer_list", line 85: error #20: identifier "__size_" is undefined
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include/libcxx/initializer_list", line 89: error #20: identifier "_Ep" is undefined
  • In reply to Roger Rose:

    Hey Roger,

    Try importing this project via CCS Import -> C/C++ -> CCS Projects. I see the issue you are having but didn't experience this problem when using CCS Cloud. So I downloaded my test project from CCS Cloud and imported into CCS and it works fine. So I would have to dig in to understand what the difference is but hopefully by using this project you will be unblocked for now.

    87871.test.zip

  • In reply to Roger Rose:

    Something quite odd is happening.  I copied these steps ...

    Roger Rose
    I tried the above example by creating a new CCS project and then copied the code above into that main() and renamed to cpp.

    It builds fine for me.  

    Please package up your problem project as described in the article Project Sharing, then attach the resulting zip file to your next post.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Hi George,

    Attached is a sample project. Basically I created this via CCS using File -> Project -> CCS Project. Select target to MSP432P4111. I use the above code that I showed and change main.c to main.cpp. What is weird is that using the CCS Cloud project works but a project created from CCS isn't working.

    bitset-test.zip

  • In reply to Franklin Cooper:

    Thank you for submitting your project.   When I build it, I only see these two compiler diagnostics ...

    "../main.cpp", line 10: error #20: identifier "bitset" is undefined
    "../main.cpp", line 10: error #20: identifier "bitset1" is undefined

    That is because line 10 is ...

        bitset<8> bitset1;

    The type bitset is not in the global namespace, but the std namespace.  There is no using directive which brings in the std namespace.  When I change that line to ...

        std::bitset<8> bitset1;

    ... it builds clean.  For a discussion of this solution compared to a using directive, please see this FAQ (not from TI).

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Hi George, what is even more wierd is that at my office computer I deleted and reinstalled CCS with only the EXP432 family selected - no SDKs. I then imported your project and compiled - it compiled without error.
    Last night I did the same thing with my computer at home (which is the one I am creating the code on), uninstalled, reinstalled with only 432 family - imported the file and got the following errors:

    **** Build of configuration Debug for project bitset-test ****

    "F:\\TI\\ccsv8\\utils\\bin\\gmake" -k -j 16 all -O

    Building file: "../main.cpp"
    Invoking: ARM Compiler
    "F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="F:/TI/ccsv8/ccs_base/arm/include" --include_path="F:/TI/ccsv8/ccs_base/arm/include/CMSIS" --include_path="F:/TI_Workspace/bitset-test" --include_path="F:/TI/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include" --advice:power=all --define=__MSP432P4011__ --define=ccs -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="main.d_raw" "../main.cpp"

    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'main.obj' failed
    "../main.cpp", line 10: error #20: identifier "bitset" is undefined
    "../main.cpp", line 10: error #20: identifier "bitset1" is undefined
    2 errors detected in the compilation of "../main.cpp".
    gmake: *** [main.obj] Error 1
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****

    both computers running WIN 10 latest updates.
    The only difference I can figure is that the work computer has one drive: 'C' and my home computer has many drives with CCS being installed on my development drive with no other modifications to the install parameters.

    I am perplexed!

    Roger
  • In reply to Roger Rose:

    This ...

    Roger Rose
    "../main.cpp", line 10: error #20: identifier "bitset" is undefined
    "../main.cpp", line 10: error #20: identifier "bitset1" is undefined
    2 errors detected in the compilation of "../main.cpp".

    ... looks like the exact same error I discuss in my previous post.  If the fix in that post does not address this situation, then I'm stumped.  And the only way forward is for you to somehow send us a test case which allows us to experience the same problem for the same reason.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Did you resolve your problem?  If so, I'd appreciate hearing how you resolved it.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Hi George, I did resolve the issue but I do not know how I resolved it :-) 

    As I mentioned earlier, I had loaded CCS onto two work computers and tested 'bitset' with positive results. And, as I had mentioned I could not get it to work on my computer at home. I proceeded to copy all the settings on one of the computers at work into a word doc (using snippet) so that I could see if there was something different between the installs. There were no differences - which made it even more perplexing. I reinstalled on my computer at home and tried four times using the different ways of creating a new project. Starting a project from the 'project' tab did not work but starting the project from the 'file, new project' tab did work. So, at this point I have it working but have no clue as to why it does not when opening a new project (blank or with main.c) from the projects tab but seems to work from the 'File, New Projects'.

    Roger

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.