Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Preprocessor output for Series 60 SDK

2 replies · 1,541 views · Started 14 June 2003

I am getting the following link error on one of my classes:
.... error LNK2001: unresolved external symbol "int __cdecl
operator==(int,enum TTrue)" (??8@YAHHW4TTrue@@@Z) ....

I looked carefully at my code, but can't figure out where things are going
wrong. So I said to myself, why don't I look at the preprocessor output.

Turns out I'm having trouble figuring out how to do that.
According to the MSDN the relevant compiler options are /P (for preprocssor
output as *.i files) and /C (to keep the comments around).
I looked in the Visual Studio 6.0 project settings and couldn't find any
checkbox for keeping preprocessor files.
I then tried modifying the makefiles generated by
>abld build wins udeb
and tried to add those options to the CFLAGS attribute. Unfortunately, it
seems these makefiles keep being overridden.

1) So how do I go about seeing the preprocessor output for one of my Symbian
classes?

2) Does anyone have a good idea why I am getting the link error above? I
tried looking for somewhere in the offending code that I compared a TInt to
a TBool, but I never found such an occurance. (I do have several TBool
comparisons with == though.)

Thank you for your time and effort.

Sincerely,
James Carpenter
Email: [email protected]
AOL IM: nawkboyrules

Not sure why there's a problem there - TBool equates to an int (for legacy reasons) so there shouldn't be any problem using ==

One thing to note though is that using == against TBool's is a bad idea as C++ will interpret any non zero value as true. Your safer using

[code:1]if(TBool) {...}[/code:1]

than

[code:1]if(TBool == ETrue) {...}[/code:1]

Though I don't think it will be the cause of your link error, it might be worth trying

Sorry I couldn't be of more help.

If you want to see the preprocessor output then use the gcc provided along with Symbian
g++ -E -o src_filename.ii src_filename.cpp
This creates the .ii preprocessor file.