OneLoneCoder / synth

The latest code to make your own virtual sound synthesizer in Windows. Please see the videos associated with this code. Links in the source files.
http://www.onelonecoder.com
350 stars 128 forks source link

Errors with main3a.cpp and main4.cpp #15

Open ShuhabA opened 3 years ago

ShuhabA commented 3 years ago

Severity Code Description Project File Line Suppression State Error C2664 'void olcNoiseMaker::SetUserFunction(double (cdecl *)(double))': cannot convert argument 1 from 'double (cdecl )(int,double)' to 'double (__cdecl )(double)' Prime Synth C:\Users\A12st\Downloads\synth-master\synth-master\main4.cpp 559

I'm getting this error when I compile the code in Visual Studio 2019 Community Edition. This is happening with the main3a.cpp and main4.cpp files.

chrisdcs commented 2 years ago

I got this.

In a project, we can only have one main*.cpp.

For example, if we have main1.cpp or main2.cpp, only include olcNoiseMaker.h.

If we have main3a.cpp or main4.cpp, only include olcNoiseMaker_VIDEO_PARTS_3_4.h

Select the debug version to be x86, then it should work.

ShuhabA commented 2 years ago

Explain to me what an overload is? I'm still pretty new to C++.

On Wed, Aug 11, 2021, 10:39 AM Chris D. @.***> wrote:

I have the same issue, seems to be an overload problem.

Severity Code Description Project File Line Suppression State Error C2664 'void olcNoiseMaker::SetUserFunction(double (cdecl *)(double))': cannot convert argument 1 from 'double (cdecl )(int,double)' to 'double (__cdecl )(double)' SoundGen E:\coding\c++\synth-master\main3a.cpp 394

Severity Code Description Project File Line Suppression State Error C2664 'void olcNoiseMaker::SetUserFunction(double (cdecl *)(double))': cannot convert argument 1 from 'double (cdecl )(int,double)' to 'double (__cdecl )(double)' SoundGen E:\coding\c++\synth-master\main4.cpp 559

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OneLoneCoder/synth/issues/15#issuecomment-896885351, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPPEFCRWW6ULTW5E56JT43T4KDT3ANCNFSM47E4V5BA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

bert8128 commented 2 years ago

Problem 1 - There is a different main cpp for each of the episodes. So only include one of them in the project, not all 4. Problem 2 - The 64 bit build has a compilation error, so just use a 32 bit build Problem 3 - main3a and main4 require a different version of olcNoiseMaker.h. So change the name of olcNoiseMaker.h to olcNoiseMaker_VIDEO_PARTS_3_4_VIDEO_PARTS_1_2.h and rename olcNoiseMaker_VIDEO_PARTS_3_4.h to olcNoiseMaker.h.