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.

Repeated warnings in workspace with multiple projects

I am working on an MSP430 application and I have two projects in the workspace.  One references the other and they both have similar included files.  On one pc (running vista), when I compile the workspace, i only get 14 warnings from the first project, most due to unreferenced variables (I didn't write the code), and they are all explained fine. Also the second project produces no warnings or errors when compiled, even though it includes the same files as the first.  On the other computer, I get the original 14 on the first project, but an additional 15 warnings on the second.  14 of them are repeats of the warnings from the same files in the first project, but there is now the addition of an internal/external linkage error because the included files in the project are the same, and so the one that declares the static variable is compiled twice, I guess.  Why isn't this happening on the first computer?  I thought it was maybe something in the environment settings but I am not familiar enough with CCSv4 to do anything about it.  Any help would be appreciated!

  • Is the exact same version of CCSv4 running on the two machine? 

    I would suggest starting by comparing the build options for both projects on the two machines, and also the version of compiler tools being used to buid. You can check the build options by right-clicking on the project and going into Properties. Click on C/C++ Build and then on Compiler. In the right side you should see all the compiler options being passed to the compiler. Similarly when you click on Linker you can see the options being passed to the linker. Compare these for both proejcts between the two machines.

    If the options and versions used in both machines are the same, please provide more details on the warning messages you are seeing. It might help to see the full output of the CCS build console which shows the difference between the messages.

  • I have tried to duplicate the situation on both computers, and now they are both giving me the same warnings, so at least it is consistent.  Now I guess my problem is the first warning, "internal/external linkage conflict with previous declaration" .  The problem arises from the fact that both projects include the same set of files, and compiles them both twice.  Is CCS actually compiling the two projects into one executable?  I can't explain why otherwise.  The variable it is complaining about is defined as a static in one module, and extern elsewhere, but that module is included in both projects.

    Any ideas?

  • Ryan,

    Usually dependent projects are built into libraries, which are then linked into the main project. Is that what you are doing? It sounds like both are being built as executables in your case. How are you actually linking in the dependent project into the main project?

    Also the build output you attached does not show the warnings. Can you show the build with the warnings?

  • Aarti,

    Thanks for the reply, I am attaching the build outputs with the proper warnings.  Yes, it seems they are both built as executables.  I think I may need to dig more into this code to understand that.  This was a project that was handed off to me.

  • Ryan,

    The warning "external/internal linkage conflict with previous declaration" is coming at compile time so this is even before the point of linking (which is where the dependent project would even come in).  I don't see any linker errors so the linking is probably going fine.

    I think this warning means that something is implicitly declared as extern and then later re-declared as static. You might be able to suppress the warning by first finding the diagnostic number for it and then suppressing it. Please take a look at the Compiler Users Guide for the diagnostic message options.