CodeWarrior 6.2 Not Recognizing `typedef` and User-defined Types

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CodeWarrior 6.2 Not Recognizing `typedef` and User-defined Types

跳至解决方案
831 次查看
jimfell
Contributor III

I am using CodeWarrior 6.2, and it's not recognizing the `typedef` keyword or any user-defined types.  Right now I'm just trying to compile a workspace made with the New Project Wizard.  For example, the first error it gives:

 

Error   : declaration syntax error

(included from:

cstddef:24

stddef.h:17

hidef.h:22

main.c:1)

size_t.h line 28     typedef _MSL_SIZE_T_TYPE size_t; 

 

This seems highly unusual to me.  Any ideas?

 

标签 (1)
0 项奖励
1 解答
452 次查看
jimfell
Contributor III

This issue has been resolved.

The problem was a result of how I was defining pre-defined constants in the project settings.  I had entered one contant per line, which is how other compilers do this, but the textbox for predefined symbols actually needs to be treated as if it were a text file.  Each symbol needs to be entered as `#define SYMBOL`.

在原帖中查看解决方案

0 项奖励
2 回复数
453 次查看
jimfell
Contributor III

This issue has been resolved.

The problem was a result of how I was defining pre-defined constants in the project settings.  I had entered one contant per line, which is how other compilers do this, but the textbox for predefined symbols actually needs to be treated as if it were a text file.  Each symbol needs to be entered as `#define SYMBOL`.

0 项奖励
452 次查看
CrasyCat
Specialist III

Hello

I would suggest you to generate the preprocessor listing for the source file you are trying to build.

Open the file in an edit window click right inside of the file and select preprocess.

There might be some unexpected macro substitution in your code.

The preprocessor listing will present you the code the compiler is seeing after all macros and includes  have been expanded.

This might help you determine where the problem is.

CrasyCat

0 项奖励