The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 printf problem

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bwitkamp Posted - 03/15/2005 : 05:48:00 AM
Origin Version 7.0 sr1:
Operating System: windows xp

dear all,

I have this really dumb problem. My computer broke down, so I had to reinstall origin 7.0 on my new copmuter. However since then, I am unable to run even the most simple scripts. It always returns a "command error". I reinstalled it twice with the same effect. For example if I run the simple "hello world" example:

#include <stdio.h>

void main(void)
{
printf("Hello, World!\n");

return 0;
}

I get " command error!!!"

Could anyone please help me

thanks

Benoit
3   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 03/16/2005 : 3:45:23 PM
Hi Benoit,

From the image it looks like what you did was to create a new .OGS file and not a new .C file.

OGS files are files that contain LabTalk script. You cannot place C code in them and compile and run.

To create a new C file, use the File->New command in Code Builder, and in the dialog that comes up, make sure to select "C File" at the top of the list. Then you can also check the "Add to Workspace" checkbox so that the newly created file is already added to your workspace. Then put in your code and build as Mike described above. You will then see the statement in the output window that specifically says your file has been compiled, which is of course missing in your image becuase the file is .OGS and so it does not get compiled at all.

Easwar
OriginLab

bwitkamp Posted - 03/16/2005 : 3:33:39 PM
Hi Mike,

I tried your suggestion, however I still got an error. For simplicity I took a screenshot of the problem, and put it on my homepage.

the link is http://qt.tn.tudelft.nl/~bwitkamp/screenshot.JPG

Please help me out....

regards,

Benoit

Edited by - bwitkamp on 03/16/2005 3:39:21 PM
Mike Buess Posted - 03/15/2005 : 09:31:16 AM
Hi Benoit,

I don't think you've added the file containing the "Hello World" function to your Origin C Workspace and compiled.

1. Select File->Add To Workspace
2. Select Tools->Build and you'll see these compiler messages (subtitute your file name for Test2.c)...

>compiling...
>Test2.c
>D:\OriginLab\OriginPro70\OriginC\Test2.c(29) :Error, Invalid "return" statement
>D:\OriginLab\OriginPro70\OriginC\Test2.c(29) :Error, general compile error
>D:\OriginLab\OriginPro70\OriginC\Test2.c(25) :Error, error(s) found in compiling function main
>
>Compiling errors found, linking cannot start!

3. Delete the "return 0;" statement and Build again. This time you will see no error messages.

Now enter "main" in the script window and you'll see your "Hello World" message.


Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000