Cabbage Logo
Back to Cabbage Site

Compilation error in VS2019 from "cabbageCopyFile" new opcode

When I tried to install the same modules as yours, VS upgraded to the lastest version, so i have exactly the same version as yours now

I’m really stumped on this one. I’ve never had this issue, and I’ve set up countless number of Windows builds environments to build Cabbage on. Even the Azure builds all use the latest version of Visual Studio. Perhaps you can take a look at the software installed in the Azure build. They have a comprehensive list of all installed SDKs/API/OSs etc at this page.

After that I’m out of ideas :grimacing:

I found that double clicking on the error shows where it happens !

So, here it is when I include chrono :

image

I don’t know, but to me it seems like the variable name “_CR” is misunderstood by VS…

Here is what I get with my new Solution blank project :

Seems to be alright here, VS not trying to “expand to 0x0020” which I think is the issue

Some steps closer to the solution I think :slight_smile:

We both very much in the dark here. Can you try adding
#include <ctime>
to the filesystem.hpp file?

I don’t actually think this will help at all… sorry…

I just can’t understand why it says chrono is not a member of std. It has been since C++14. Maybe open your simple project up alongside Cabbage and go through the C++ language and linker settings, and see if there are any extra flags added to your simple project.

Also, just to double check, you’re using Producer 5.7.4 to generate the VS project right?

I was right :smiley:
image

I just replaced in the chrono header all the “_CR” by “_CRfix” because I don’t know why but the compiler seemed to replace the _CR with the hex value 0x0020

Now it works !

So my guess is that VS has something to auto-expand common identifier names and it was activated for some reasons on my project ?

Really it would need some further investigation, for now I’ll stick with that solution and enjoy the CabbageCopyFile opcode :slight_smile:

Thanks for all the guidance and time spent on this Rory !

That’s some seriously impressive work! :clap:

So I’m guessing that if you have any issues with the cabbageCopyFile opcode you’ll be able to submit a fix through a github pull request :rofl:

1 Like

Thanks :slight_smile:

And I found the culprit :
image

In this csound file, there is a #define _CR 0x0020 :sweat_smile:

So that was why when trying to compile Cabbage which uses Csound I have this issue, and I don’t have it in a blank project !

And sure if I have issues with the opcode I’ll let you know :wink:

Edit : I still don’t get why you don’t have this issue too, maybe different Csound versions ? :thinking:

It might be, what version are you using? I think I was using 6.15 when I wrote that opcode.

[edit] I see it’s also in that latest Csound source. Odd that I don’t get the same issue here…