News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Why .cpp compiler error?

Started by rogerio, April 25, 2009, 03:39:09 PM

Previous topic - Next topic

rogerio

Why do I get this RadASM .cpp compiler error - see error.zip attached. Thanks...

main()
{ printf("Hello World\n");
}

[attachment deleted by admin]

mitchi

I won't download the attachment provided but you might want to switch to this syntax fulltime.
main() is not really supported across compilers.
int main() is supported everywhere

#include <stdio.h>
int main()
{
     printf("hello world\n");
     return 0;
}

BlackVortex

Something is wrong with the command RadAsm is trying to execute to compile. It's not related to the actual source script.

rogerio

Thanks for the replies. Tried mitchi's code and now I get "Make error(s) occured while process RC /v "HelloWorld.rc". without a error code.

This may be the problem: CL /c /O1 /GB /w /TP /nologo /Fo /I"C:\Program Files\Microsoft Visual Studio\VC98\Include" "Console.cpp"

Why is Rad looking for "Microsoft Visual Studio\VC98\Include"?

Vortex

rogerio,

A typical hello world application does not require the usage of a resource ( .rc ) file. Are you sure that you have a resource script?

PauloH

Rogerio,

Try the following:
1 - Create a new RadAsm project --> File -> New Project -> Console App
2 - Type the code supplied by mitchi
3 - Compile and run.

This is an example of a console application and should run without errors.

PS: Do you speak portuguese (Rogerio is a Spanish or Portuguese name?).

rogerio

I did exactly as requested and got the same error: This may be the problem: CL /c /O1 /GB /w /TP /nologo /Fo /I"C:\Program Files\Microsoft Visual Studio\VC98\Include" "Console.cpp"

I think there is something wrong in the cpp.ini file supplied with RadASM, but I don't know what. I even have a console file supplied with Rad and it gives the same erros. I currently use Rad's masm side and it works fine; I just decided to give the C side a try.

No PauloH, I don't speak any other languages, not even English well. This was a nickname given to me many years ago by someone who spoke Spainish.

PauloH

Rogerio,

Here is my cpp.ini file.  Before use it, you should change the [Environment] section to reflect you compiler installation properly.

I'll will read the this file to search the problem.

Kind regards

PauloH.

[attachment deleted by admin]

rogerio


rogerio

Ok, I think I see the problem now. Every the [Environment] section of every cpp.ini I have looked at is point to C/C++'s Bin, Include and Lib and I don't have them. I do have the SDK include and lib folders, but there must be some files that Rad is looking for in the Bin folder that I do not have.

PauloH

Rogerio,

I'm using visual studio 2008, then, some folders and files are from this release and not from VC 6.
If you are using the old VC 6, your path should be ok with the cpp.ini.

Kind regards.

PauloH.

rogerio

PauloH, that's my problem, I don't have VC of any kind loaded, and I tried setting the path to SDK's Bin, lib and include. Do you have any idea of what files Rad is looking for? Thanks...


PauloH

Rogerio,

If I understood you, you do not have the MS c/c++ compiler installed, right?  Well, you could try the Visual Studio Express without problems.
The link is here here.

For a pure C compiler which works with RadAsm try lcc
Its homepage is this: here

rogerio

mitchi - thanks, problem solved, GCC works great.