Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual C++ Compile error

Status
Not open for further replies.

mikeol

Programmer
Apr 22, 2003
8
IE
Hi,
I downloaded some C source code that was written in Borland, which I am now trying to compile in Microsoft Visual C++

#include <stdio.h>
#include <conio.h>
#include <windows.h>

typedef short _stdcall (*inpfuncPtr)(short portaddr);
typedef void _stdcall (*oupfuncPtr)(short portaddr, short datum);


I get an error at both typedef lines:
test.c(5) : error C2059: syntax error : '('
test.c(6) : error C2059: syntax error : '('

Can someone tell me how to fix it so that it compiles?
 
my first guess would be:

replace

typedef short _stdcall (*inpfuncPtr)(short portaddr);
typedef void _stdcall (*oupfuncPtr)(short portaddr, short datum)

with

typedef short _stdcall (*inpfuncPtr, short portaddr);
typedef void _stdcall (*oupfuncPtr, short portaddr, short datum)
 
Thanks for the reply, tried that, but it still didn't work... the error appears to be caused by the opening barcket
 

Never mind, got it fixed now...
What I needed was:

typedef short (_stdcall *inpfuncPtr)(short portaddr);
typedef void (_stdcall *oupfuncPtr)(short portaddr, short datum);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top