Project Getting Corrupted?

I’ve been holding off on moving to the new M2MSudio because all of my active projects use older firmware but now I have no choice (need to use new firmware with needed bug fixes). Moving to the new environment has just wasted the last 3 days of my life and it still isn’t working for me. Here is just the short list of the problems I’m having, has anyone else seen these problems?

My directory structure looks like this:

/MainDirectory
   /SourceDirectory1
   /SourceDirectory2
   /SourceDirectory3
   /SourceDirectory4
   /ProjectFiles

In this case I’ve added a new project directory for M2M Sudio. I created a new project. I haven’t had any problems with adding the include directories.

For the first problem I’m having… To add source directories I go to Project->Properties. From there I go to C/C++ General->Paths and Symbols. I go to the Source Location tab, click the Link Folder button. I click the “Link to folder in the file system”, enter the directory and click OK. In the beginning I folder shows in the project, with a green circle with a “C”. The project builds just fine. Then at some point I’ll go into the Project->Properties page and FOR NO REASON all the source directories revert to “normal” folders. The green “C” circle disappears and I can’t build the project anymore. Can someone tell me how to fix it so my source directories don’t revert? It just happened to me for the again when I added a new library file to the build. The time before that it was when I changed from the 256K memory model to 1MB model. The only way to recover is to delete the older project files and recreate the project from scratch. This is a MAJOR problem for how large and how many files are in the project !!!

Second Problem: Using the process above, it appears I can only add directories to one build Configuration. If I add all the source directories while one configuration is selected (lets say “RVDS Release” build). If I then change to another configuration (lets say “RVDS Debug”) and try to add the same source directories I get an error “The folder already exists”. Why?

Third Problem: If I try the same process above but change the Configuration to [All Configurations] then things get all messed up. After adding the source folder the Properties page goes “Blank” where all the edit boxes disappear and some of the buttons disappear. My only option is to exit the Properties box and enter. Then when I navigate to the “Source Location” tab again, while a specific Configuration is selected (the “RVDS Debug” config for example) the directory isn’t in the source folder list. When I try to add the source directory I get the error “The folder already exists”. So the directory isn’t in the list BUT now I can’t add it!!!

We have already noticed several bad behaviours coming from CDT (the official Eclipse C/C++ plugin) about edition of source paths wrt. multiple build configurations.
A reliable way to handle source paths is to create them through the Right click > New menu rather than from the Path And Symbols dialog. Using this way, source paths will be correctly added to all build configurations.

If you just want to create a new folder in your project, use Right click on project root > New > Source folder way.
If you want to link to a folder out of your project directory, you have to do it in two steps:

  • Use Right click on project root > New > Folder, click Advanced and the Link to folder in the file system checkbox. Name the folder as you want (e.g. “foo”)
  • Use Right click on project root > New > Source folder with the same folder name (“foo”) to “promote” it as a source folder.

Hope it helps.

There are a few problems with this recommendation. If I try to do this on my current project then I get the error that the folder already exists. If I follow your steps on a new folder then adding the regular folder works fine but then trying to add the same folder again (trying to promote the folder) I get this error “Invalid project path: Duplicate path entries.”. Another issue is that if I add a regular folder to a clean project then I can successfully add the folder but since it isn’t a source folder (the “C” in a green circle) then it won’t build the code.

Also, the core of the problem I’m having is with M2MStudio not handling source folders well. One of the symptoms is that it reverts source folders to just regular folders (and then I can’t build the project). Your description seems to be describing the creation of just regular folders. Am I missing something? Can I somehow tell M2MStudio to build “.c” and “.h” files in regular folders?

Please make sure you are using 1.1.1 release: we have fixed an issue regarding “reset” of source folders to regular folders in this one.

The steps mentioned in the previous post describe the creation of source folders. And source folders are necessary to build .c files (files in regular folders are not built, as you already noticed).
Please note that source folders are by default recursive; if you have a directory structure like this:

<project root>
  srcRoot/
    foo/
      src/
        foo.c
      inc/
        foo.h
    bar/
      src/
        bar.c
      inc/
        bar.h

Declaring “srcRoot” folder as a source one is enough to get foo.c and bar.c compiled (.c files are browsed recursively)
Nevertheless, to get bar.h and foo.h files included correctly, you will have to additionally declare “srcRoot/foo/inc” and “srcRoot/bar/inc” include folders.

I’m using OASIS 2.31 which uses 1.1.0. I looked in the Q2687 product area and there is no update for M2MStudio. I also looked int he M2MStudio area and it has a link to download 1.1.0. Where do I get 1.1.1?

download it from the wavecom website.
products -> M2M studio
I know it say’s 1.1.0, but it’s actually 1.1.1 :wink:

I’m working with 1.1.1 now. It may fix issue 1 from my original post. The good news is that I haven’t seen the problem yet… On the other hand, I’ve tried to add a folder in such a way that I can build the same files across multiple builds. Unfortunately, issue 2 and 3 are still broken in 1.1.1.

Does anyone know if there is a way to build the same files in different releases (like both GCC and RVDS release builds)?

Did you try this?

Using this method ensures that source folders are declared for all build configurations in one operation (not have to edit build configurations one after the other).

Yes, I did try that. Did you see my response after that post?

Can you make the try on a clean new project? Maybe the error you get about duplicate path entries is raised because you previously tried to “play” with the source folders in the “Path and Symbols” property page.

Following the thread history, it is fixed now when using M2M Studio 1.1.1, isn’t it?

I have had to start clean project and re-setup the project more times than I can count using 1.1.0. I would say more than two dozen times. Actually, I lost a whole weekend to this bug before I could figured out what was happening. I have a huge project I’m in the middle of… In the begining I thought I was doing something wrong. Changing project settings like switching from 256K to 1MB+ memory model or adding a library to the project seems to make this happen very easily. While trying to learn the M2MStudio environment and setup my project for the first time this issue made me what to do what that guy in “The Happening” did, where he throws himself under a moving lawn mower.

I have not seen the error occur in 1.1.1… yet. But I just switched to it a few deays ago. I don’t want to say that it is fixed just because I havn’t seen it yet. On the other hand, I’ve re-setup my project so many times in 1.1.0 that I can now set it up, in my sleep, in one quick process. After that I don’t mess with the project settings because I have an Ace Hardware down the street and lawn mowers are on sale…

I will post here immediately if I see it again in 1.1.1.

hi,

Thanks for the post “daav”

Regards,
haricool.