LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2004, 12:13 AM   #1
foxele
LQ Newbie
 
Registered: Oct 2004
Location: san diego
Posts: 7

Rep: Reputation: 0
error message's meaning, Please help


Hi:

I was programming using Sparc Assembly Languge. I am suppsed to do the programming under unix. But I was using gvim under window xp.

after I compile it, there are a lot of error message like:

invalid white space character in directive.

Is there anyway that I can correct it, l was trying to use dos2unix to correct my codes. but it doesn't work.

Can somebody tells me what to do?

thanks!
 
Old 11-13-2004, 01:17 AM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
I was programming using Sparc Assembly Languge. I am suppsed to do the programming under unix. But I was using gvim under window xp.
What do u mean?

You cannot run Sparc Assembly Languge on a PC.

Your PC uses x86 instruction set!!!!

You Can't even write linux PC assembly code under Windows!!!

It's like trying to run a linux program under unix!!!

SPARC and x86 (intel, AMD) use different instruction sets.

linux x86 and windows XP use the same instuction set (same low-level commands), but handle thinks in a different way.

Assembly is a Operating-System oriented thing
 
Old 11-13-2004, 06:10 AM   #3
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
wait, maybe i did not understand your problem.
if you mean that u wrote a text file in XP and then tried to compile it in sparc then you
might had this problem:

in Unix the enter button is one character (\n) <- new line
in windows the enter button is 2 char \r\n

try to compile and run this program to delete the \r chars

Code:
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
	FILE *src,*dest;
	char c,name[50];
	if(argc != 2 ){
		fprintf(stderr,"Usage: %s <filename>\n",argv[0]);
		exit(0);
	} 
	
	src = fopen(argv[1],"r");
	strncpy(name,argv[1],45);
	strncat(name,".new",4);
	dest = fopen(name,"w");
	
	c = getc(src);
	while (c != EOF)
	{
		if ( c != '\r') putc(c,dest);
		c = getc(src);
	}
	
	fclose(src);
	fclose(dest);
	return 0;
}
this prog takes as argument a filename, deletes the \r chars and saves it to <filename>.new
 
Old 11-14-2004, 11:50 PM   #4
foxele
LQ Newbie
 
Registered: Oct 2004
Location: san diego
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks, I used a unix commands to correct all the errors. I forgot to tell you I use ssh to connect to school's unix systems. Your help is really appreciated.

Alex
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command meaning ramrann Linux - Newbie 2 10-18-2005 01:56 PM
What's meaning of ':=' in Makefile? cd7809 Programming 2 02-23-2004 01:30 AM
What is the cause/meaning of 07 07 07 error with LILO? nimonm Linux - Newbie 3 01-11-2004 01:58 PM
error message meaning? Michele Linux - Newbie 2 08-12-2003 09:49 PM
what's the meaning of this warning ? jeson_515 Linux - Software 1 08-07-2003 10:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration