Function not appearing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Function not appearing

1,730 Views
bazza
Contributor I
Hello,
I am halfway through an app using Code Warrior for Palm and cannot get a new function to appear.
 
I only have nine functions in the particular segment.
 
The function is:
static Boolean StrToDouble(Char* dist, double newdist);

I did have the function appearing at first but could not proceed due to a link error so I inserted the 'static'  and it worked. I was trying to alter the return value when all reference to the function disappeared and now the program will not compile while the function is there. If I comment it out it will compile. I am at a loss as to why a function cannot be active. I have defined it under processes.

The color of the function indicates it is inactive and it does not appear in the drop down list. Also I get a stupid error claiming every line of the program is a syntax error.

Regards, Bazza

 


 
Labels (1)
0 Kudos
2 Replies

346 Views
bazza
Contributor I
The mystery gets bigger. If I make a new function with some other name it's OK. I have started doing this but not finished yet, so it's not as if I can't add functions to the project. There is just some devil of a gremlin somewhere in code warrior preventing me from using the title 'strToDouble'.
 
If I comment out every trace of strToDouble function and enter a new function say with the title GetDouble then it compiles happily.
 
This makes Code Warrior look pretty sick. The error messages are also pretty stupid and extremely unhelpful.
0 Kudos

346 Views
CompilerGuru
NXP Employee
NXP Employee
Hi bazza,

While this list is for CodeWarrior, it is also for Freescale devices. I'm sure there are much more appropriate forums dedicated to palm, but sorry I dont know Palm or their forums.
Anyway, I shortly asked Google for "Palm strToDouble" and some hits did show up. strToDouble is a library function used on Palm, please check the documentation of the libraries you are using.
Note that the function is strToDouble" not "StrToDouble" as in your initial mail (but I'm not 100% that he palm linker is case sensitive. I would hope so, but ANSI-C does not guarantee this).
Also name collisions tend to generate strange error messages, unfortunately you did not copy the ones you got, so its hard to say if they were actually a mystery or just what to expect for your error setup.
Anyway, the first thing to do when you get some error you really do not expect is to check the preprocessor output. Then look how your strToDouble code looks like and search in it for other declarations of strToDouble. Usually the name collision can be easily spotted this way (actually not sure for your case as you may have a link time name collision only).

Also you found the cure: use another name :smileyhappy: (or in C++, use a namespace).

Daniel
0 Kudos