Andre
Andre

Reputation: 1267

rpcgen in Windows 7 - no preprocessor found

I created an IDL like this:

struct intpair { 
    int a; 
    int b; 
}; 
program ADD_PROG { 
    version ADD_VERS { 
         int ADD(intpair) = 1; 
     } = 1; 
} = 0x23451111;

I installed rpcgen, but when I try to compile this with

rpcgen -C add.x

or

rpcgen add.x

the error-message below is shown

cannot find any C preprocessor (cpp)

I have a gcc installed.


Ok, the command is now working, but it returns an error-message.

C:\Users\baco\Desktop\rpcTest>rpcgen -C -Y "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin" add.x 

produced the output:

Der Befehl "C:/Program" ist entweder falsch geschrieben oder konnte nicht gefunden werden.

So it produces an error message (the command was not found or misspelled) but also the following files are created: add.h, add_clnt.c, add_svc.c, add_xdr.c

When I add the -a flag to produce additional template-code, this error-message appears:

rpcgen: unable to open Makefile.add=C:\Ú☻<ms\: m

Maybe a problem with the path again ?

Upvotes: 0

Views: 2911

Answers (4)

ts1690
ts1690

Reputation: 11

You can use the -Y flag to specify the path of where cpp is. On windows for instance this might be: rpcgen -Y c:\pathtogcc myfile.x

In answer to the fopen error above its a permissions problem ie. Access Denied. On windows for instance you need to run the cmd prompt as administrator.

Upvotes: 1

Ian
Ian

Reputation: 1

It doesn't like the spaces in the path to the preprocessor.

Upvotes: 0

Gopi Muthusamy
Gopi Muthusamy

Reputation: 1

Here is what I did and it worked on Windows 7 system: (1) Installed cygwin 32 bit with following packages rpcgen gcc-core all the isl libraries (cpp.exe requires isl, isl10, cloog-isl, ...) (2) added cygwin\bin to PATH (in dos) (3) ran rpcgen in windows DOS prompt, and with this it is able to generate the .h and .c files.

From your description, it appears that your rpcgen is looking for cpp not cpp.exe and dont know of any way to change that, so, choosing the right rpcgen that looks for cpp.exe is the way to go. I did look at the rpcgen code and it appears that it looks for cpp or cpp.exe depending on the OS setting.

Upvotes: 0

Jens
Jens

Reputation: 72717

Check these:

  1. Is gcc in the PATH? How did you install gcc? Cygwin or something else?
  2. Is the C preprocessor named cpp? (On some systems it is cccp)

If all else fails, create a script named cpp.bat that calls gcc -E with all arguments.

Upvotes: 0

Related Questions