Error: "syntax error: got (, expecting Newline"

D

Deepak

Hi friends i tried to compile following programs and link it, i got an error like

// hellofunc.h
/*
example include file
*/

extern void myPrintHelloMake(void);



// hellomake.cpp
#include "hellofunc.h"

int main()
{
// call a function in another file
myPrintHelloMake();

return 0;
}





// hellofunc.cpp
#include "hellofunc.h"
#include <iostream.h>


void myPrintHelloMake(void)
{

cout<<"Hello make files \n";

return;

}

i compiled the file with following commands on MKS KORN SHELL

cc hellofunc.cpp
cc hellomake.cpp
cc -hello hellofunc.obj hellomake.obj



i got this following error
"syntax error: got (, expecting Newline"

i cant understand why i get this error please help me in solving this problem.
your help is really appreciated..



regards,
Deepak
 
R

Rolf Magnus

Deepak said:
Hi friends i tried to compile following programs and link it, i got an
error like

// hellofunc.h
/*
example include file
*/

extern void myPrintHelloMake(void);



// hellomake.cpp
#include "hellofunc.h"

int main()
{
// call a function in another file
myPrintHelloMake();

return 0;
}





// hellofunc.cpp
#include "hellofunc.h"
#include <iostream.h>


void myPrintHelloMake(void)
{

cout<<"Hello make files \n";

return;

}

i compiled the file with following commands on MKS KORN SHELL

cc hellofunc.cpp
cc hellomake.cpp
cc -hello hellofunc.obj hellomake.obj

I doubt that '-hello' is a valid command line option for your compiler.
Also, are you sure that the output file names end in '.obj'? It looks like
you're on a Un*x-like system, and most of those seem to use '.o' instead if
you don't specify anything else.
i got this following error
"syntax error: got (, expecting Newline"

And it didn't tell you which line or even which file the error is in?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top