What is the best editor to mod the source code for FreeFileSync in Ubuntu?

Get help for specific problems
Posts: 3
Joined: 18 May 2020

Chris

Hi!
I wish to add some functions to the app but I will give a try to do that in Linux environment.
I installed Visual Studio Code and tried to open the source code which I downloaded from the download section and I have problems with :
cannot open source file "numbers" (dependency of "/home/chris/VS_Projects/FreeFileSync/FreeFileSync/Source/application.cpp")
I have to say, I'm not a developer who have experience in developing apps under Linux but C++ is my major programming language in Windows, and I wish to start using Linux as my major dev. platform.
Can somebody help me how to correct open in some development tool this source code but in Ubuntu?

Thank you.
My best regards.
Posts: 305
Joined: 7 Jan 2018

bgstack15

It sounds like your editor is looking ahead and trying to open all the included files! I caught that #include <numbers.h> but I don't have that header file myself. I don't know the details of any release of Ubuntu, but it's possible that a traditional distro like Ubuntu may not have the latest version of gcc or a standard C++ library that provides that. If Zenju could speak to the matter that would be fantastic.

Found it: https://en.cppreference.com/w/cpp/header/numbers says it is from C++20. My Devuan Ceres doesn't have c++20 standard c++ library yet so I had to revert the code to the previous contents:
diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/zen/legacy_compiler.h 10.24-1/zen/legacy_compiler.h
--- 10.24-0/zen/legacy_compiler.h   2020-05-17 13:44:27.542140458 -0400
+++ 10.24-1/zen/legacy_compiler.h   2020-05-17 14:07:49.115166339 -0400
@@ -7,9 +7,6 @@
 #ifndef LEGACY_COMPILER_H_839567308565656789
 #define LEGACY_COMPILER_H_839567308565656789

-    #include <numbers> //C++20
-
-    #include <span> //requires C++20



@@ -21,8 +18,53 @@

 //---------------------------------------------------------------------------------

+#if __cpp_lib_span
+    #error get rid of workaround:
+#endif
+
+template <class T>
+class span
+{
+public:
+    template <class Iterator>
+    span(Iterator first, Iterator last) : size_(last - first), data_(first != last ? &*first : nullptr) {}
+
+    template <class Container>
+    span(Container& cont) : span(cont.begin(), cont.end()) {}
+
+    using iterator        = T*;
+    using const_iterator  = const T*;
+
+    iterator begin() { return data_; }
+    iterator end  () { return data_ + size_; }
+
+    const_iterator begin() const { return data_; }
+    const_iterator end  () const { return data_ + size_; }

+    const_iterator cbegin() const { return begin(); }
+    const_iterator cend  () const { return end  (); }

+    T*     data() const { return data_; }
+    size_t size() const { return size_; }
+    bool  empty() const { return size_ == 0; }
+
+private:
+    const size_t size_;
+    T* const data_;
+};
+
+
+#if __cpp_lib_math_constants
+    #error get rid of workaround:
+#endif
+
+namespace numbers
+{
+const double pi    = 3.14159265358979323846;
+const double e     = 2.71828182845904523536;
+const double sqrt2 = 1.41421356237309504880;
+const double ln2   = 0.693147180559945309417;
+}
 }
Zenju, my specific question for you is, what version of c++ library do you use, and how do you get it, and what compiler do you use?
Posts: 3
Joined: 18 May 2020

Chris

Hi.
Thank you for your reply.

What editor/IDE is the best to use to develop this app under Linux? I mean under Ubuntu.

Maybe Zenju could share with as what is he using.

Thank you.