ofxIO icon indicating copy to clipboard operation
ofxIO copied to clipboard

not c++17 compliant

Open fred-dev opened this issue 2 years ago • 14 comments

Hi, I wanted to check if you are still going to develop this addon. It is not c++17 compliant as it uses a few functions that no longer exist like std::ptr_fun and std::filesystem::extension, as you are aware this addon is also a dependant for your ofxHTTP addon (which is also not c++ 17 compliant). The upcoming OF release (and the current master use c++17), I have several porjects relying on these addons and am wondering if you think you might get around to this or if I should start looking for other solutions.

fred-dev avatar Dec 19 '22 01:12 fred-dev

Hi there, I don't currently have time to update these, but I would welcome pull requests.

bakercp avatar Dec 21 '22 04:12 bakercp

I'd love to but I had a look at some of the issues and it was beyond my understanding. Ill give it a go anyway and see how far I get.

Thanks for the helpful code anyway.

fred-dev avatar Dec 21 '22 04:12 fred-dev

Hi, I've come across this issue after updating to an OF nightly build as recommended at https://forum.openframeworks.cc/t/note-nightly-builds-recommended-over-0-11-2/41220. We need C++17 for some WinRT developments in our app and are eagerly awaiting the OF12 release which is said to be imminent.

I see "fred-dev" has submitted a pull request with a fix but it has not yet yet been accepted. I tried it anyway and can confirm that it builds without issues but we don't use the RecursiveDirectoryIterator so I haven't tested it.

With the upcoming OF12 release will you be looking at the pull request sometime soon?

rjx-ray avatar May 30 '23 07:05 rjx-ray

Actually that fixed only the include error from "ofx/RecursiveDirectoryIterator.h".

After fixing many other errors in the OF12/C++17 version of my app I'm getting an error whilst compiling DrectoryUtils.cpp:

Error C2143 syntax error: missing ',' before '<' IglooCoreEngine ofxIO\libs\alphanum\include\alphanum.hpp 308

I'll see if I can track it down tomorrow

rjx-ray avatar May 30 '23 14:05 rjx-ray

The error was because std::binary_function has been removed from C++17. I couldn't see what was using alphanum_less so commented out lines 307 to 314 of alphanum.hpp to see where I got errors. But I didn't then get any build errors so I think its not needed.

rjx-ray avatar May 31 '23 11:05 rjx-ray

Hello @fred-dev I am having this error: https://github.com/bakercp/ofxIO/issues/32

Should i roll back these new two commits? I am not using the OF nighty, just master branch.

moebiussurfing avatar Aug 08 '23 08:08 moebiussurfing

Hi I don't have access to windows easily now. I can check this out in a few days. Is your OF from the git main up to date? I'm not sure when each of the changes came through VS where you branch of OF is. If you can it would be good to check against the latest commits to the main branch of OF. I had checked the c++17 changes on windows a few months ago. I will check again but if I need to make changes I'll be aiming to make things work with current commits as the current release cycle is out the window and OF is advising nightlies.

fred-dev avatar Aug 09 '23 22:08 fred-dev

Yes, I was using OF master branch with recent commits...

But I solved it for my use by rolling back the commits to the latest 2019 from ofxIO develop branch. This works for the Github path-release branch and probably works also with OF 0.12 downloadable release too. (If I am not wrong, these are C++14.)

moebiussurfing avatar Aug 12 '23 04:08 moebiussurfing

Any progress to make it work under Windows? @bakercp , @fred-dev I am updating to OF 0.12/C++17 but having too many errors/branches...

moebiussurfing avatar Sep 27 '23 21:09 moebiussurfing

I had a quick look and made some changes so the code is compatible with win c++17 (these changes were to ofxIO) - I also merged the develop branch of ofxIO on my fork to the master, so you should be able to use the master branch of both repos. At the moment I have pulled all commits to the main branch of OF and am using Visual Studio 2022 and the code compiles. ****But there is a linker error I did not track down. There is a requirement on ofxPoco for the libraries required to use SSL. There is a linker error that needs to be solved linking libcrypto from ofxPoco. This could come from the project generator, or just that I need to download libs again. At some point a long time ago I had an issue with ofxPoco not being bundled with these libs for windows. Let me know if these changes work for you.

fred-dev avatar Sep 27 '23 22:09 fred-dev

Ok, had a further look, you need to add this path to the additional library directories in the visual studio project properties ..\..\..\addons\ofxPoco\libs\openssl\lib not sure where this comes from, maybe @bakercp knows.

fred-dev avatar Sep 27 '23 22:09 fred-dev

Thanks a lot @fred-dev ,

I'll try soon and report back.

I was having this libcrypto error too:

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB6006	"link.exe" exited with code 1104.	example_json_utils	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets	1134	
Error	LNK1104	cannot open file 'libcrypto64mdd.lib'	example_json_utils	C:\Users\moebi\Documents\of_v0.12.0_vs_release\addons\ofxIO\examples\json\example_json_utils\LINK	1
```	

PS
I am trying to make ofxHTTP work back and requires all these (sub) addons. 
I only need to check folder-file-changes and some REST API HTTP logging.
I don't know if some files can be removed maybe, to avoid fix things that maybe we don't need to use...

moebiussurfing avatar Sep 28 '23 19:09 moebiussurfing

If you don't need ssl then you can get away without these tools and life will be much easier. The standard built in OF tools can handle a lot of functions.

fred-dev avatar Sep 28 '23 23:09 fred-dev

Well... in fact, I think that I’ll need SSL to login into colourlovers I need to fix that addon: https://github.com/moebiussurfing/ofxColourLoversHelper

moebiussurfing avatar Sep 29 '23 07:09 moebiussurfing