473,471 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Compilation problems with vc++


Hi,

This is the compilation errors which I am getting when I compiling the
code with VC++ 6.0. The same code is getting compiled in Linux OS. I
would like to know how this compiler error can be eliminated?

d:\vasant\mysys\encoder\events.cpp(40) : error C2511: 'Register' :
overloaded member function 'void (enum EventType,void (__cdecl *)(enum
EventType,void *,void *),void *)' not found in 'EventManager'
d:\vasant\mysys\encoder\events.h(58) : see declaration of
'EventManager'
d:\vasant\mysys\encoder\events.cpp(54) : error C2511:
'CallbackRecord::CallbackRecord' : overloaded member function 'void
(enum EventType,void (__cdecl *)(enum EventType,void *,void *),void *)'
not found in 'CallbackRecord'
d:\vasant\mysys\encoder\events.h(68) : see declaration of
'CallbackRecord'

THE CONTENTS OF EVENTS.H

typedef void Callback (EventType, void*, void*);

class CallbackRecord;

class EventManager
{
public:
EventManager ();
void Register (EventType, Callback, void*);
void Trigger (EventType, void*);
private:
CallbackRecord* Callbacks[NumberEventTypes];
};

class CallbackRecord
{
public:
EventType type;
Callback* callback;
void* client_data;
CallbackRecord (EventType, Callback, void*);
};

THE CONTENTS OF EVENTS.CPP

void EventManager::Register (EventType t, Callback f, void* d)
{
CallbackRecord* crec = new CallbackRecord(t, f, d);
Callbacks[t] = crec;
}
CallbackRecord::CallbackRecord (EventType t, Callback c, void* d)
{
type = t;
callback = c;
client_data = d;
}

Thanks in advance.

Have a wonderful day.

With best wishes

Vasant

--
vasant63
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jun 17 '06 #1
1 1207
vasant63 wrote:
This is the compilation errors which I am getting when I compiling the
code with VC++ 6.0.
seems like compiler problem, but there is easy workaround. Explicitly use
pointer to function type in function parameters, that is replace Callback with
Callback* in following lines:
void Register (EventType, Callback, void*);
CallbackRecord (EventType, Callback, void*);
void EventManager::Register (EventType t, Callback f, void* d)
CallbackRecord::CallbackRecord (EventType t, Callback c, void* d)


You wouldn't have this problem if you used newer compiler. Regards
B.
Jun 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ram Sundaram | last post by:
Hi, I am trying to port some linux code to windows under Visual studio. The regex package currently used is the GNU regex package which calls for <strings.h>. This is not found in visual studio....
5
by: ideas2050 | last post by:
Observed a compilation error reporting differences between VC++ 6.0 and 7.0 VS .NET 2003. Seeking opinions. Here is the code abbreviated:- main() {
1
by: Paljo | last post by:
Trying to compile VC++ 6 project in VC++ 7 and getting a compiling error, error C2955: '_com_ptr_t' : use of class template requires template argument list Any thoughts? Thanks
6
by: vaishnavnitin | last post by:
Hello Al I am re-designing 16-bit application of other party. but currently i don't have VC++ 1.52 I want to compile or debug the original 16-bit application Thank you.
2
by: Michael Braitmaier | last post by:
I have a quite severe problem. I am trying to compile a C++ library initially written for VC++ 6. To make the library available for .NET languages I want to compile the library as managed C++...
0
by: Ganapathy | last post by:
I have COM dll code written in VC 6.0. When i tried compiling this code in VC 7, The MIDL cmpiler gets called twice. i.e. it initially compiles fully & immediately a line - 64 bit processing'...
1
by: Arsalan Ahmad | last post by:
Hi all, I am trying to compile some source files using makefile. While compiling I am getting errors as shown below. Any idea how can I solve this problem. I believe I need to add some...
4
by: marathoner | last post by:
I tried your advice, and replaced "ifstream" with "std::ifstream". I also replaced instances of "ofstream" with "std::ofstream". Those syntax errors were resolved. When I added "std" to the...
8
by: ftjonsson | last post by:
hello, I was wondering if anyone could tips me on what I am doing wrong when writing the following code: #include <iostream> using namespace std; int main () {
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.