ZeeWanderer / binacpp-windows

windows port of Binance C++ library [WIP]
MIT License
1 stars 1 forks source link

how to get set up #3

Closed Umair-khalidkhan closed 3 years ago

Umair-khalidkhan commented 3 years ago

HI! so this isnt any issue of the code, but i am not able to grasp the readme completely and have not yet figured out how to exactly run and set up the code. i do not know how to use the makefile. any guidance would be highly appreciated. thanks.

ZeeWanderer commented 3 years ago

I haven't updated readme from Linux version. next-wip branch is a bit friendlier but it forces to use nlohmann-json just as original master forces to use jsoncpp. At this point i think json parser choice should be up to the end user yet i am not sure how to go about that but i digress.

If you use it on Windows with Visual Studio, for example as a submodule, you can create a project in your solution and then include all the sources from this lib. For practical example you can look at VS project file on the next-wip branch. For building you would also need

jsonccp
libwebsockets
curl

I personally use vcpkg to install and manage C++ libs.

Umair-khalidkhan commented 3 years ago

Hi Zee thanks for the prompt reply, but I really have no idea whay you just wrote. I am just a first year student doing CS, and am not familiar with the lingo and technicalities, if you could give a step by step way to install and use the makefile(I still have not figured it out) would be ton a help. I am on Windows.

Thank you!

On Thu, 10 Jun 2021, 2:41 pm ZeeWanderer, @.***> wrote:

I haven't updated readme from linux version. next-wip branch is a bit friendlier but it forces to use nlohmann-json just as original master forces to use jsoncpp. At this point i think json parser choice should be up to the end user yet i am not sure how to go about that but i digress.

If you use it with visual studio, for example as a submodule in your project, you can create a project in your solution and then include all the sources from this lib. For practical example you can look at VS project file on the next-wip branch. For building you would also need

jsonccp libwebsockets curl

I personally use vcpkg to install and manage C++ libs.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-858474236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HAJJS3UPRFJSP3JBSLTSCCFBANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

Makefiles are for Linux make utility, you cannot use them on Windows without wls or vm. This is a C++ library that uses classes, even if with static methods only, which means you would either need to create C++ interop library with C++/CLI that would wrap this library to use it from C# or make global functions that call the class methods and as far as i know that is the only way because C# can DLLimport only global functions.

If you haven't understood what i wrote then it's no use because i can't provide you a step-by-step solution for this.

Basically you need to be familiar with C++, C# and their interop practices + some common buildsystems.

Umair-khalidkhan commented 3 years ago

Oh, so make files aren't meant for windows, and therefore I cannot directly use your .O and .OS files. I would only be able to use your library is by converting it to a dll for Windows, which I assume isn't easy on its own. I have unbuntu installed, so it should be fine on that. Any guide to how to carry out the steps of readme on that to install your code?

Thanks.

On Thu, 10 Jun 2021, 3:26 pm ZeeWanderer, @.***> wrote:

Makefiles are for Linux make utility, you cannot use them on Windows without wls or vm. This is a C++ library that uses classes, even if with static methods only, which means you would either need to create C++ interop library with C++/CLI that would wrap this library to use it from C# or make global functions that call the class methods and as far as i know that is the only way because C# can DLLimport only global functions.

If you haven't understood what i wrote then it's no use because i can't provide you a step-by-step solution for this.

Basically you need to be familiar with C++, C# and their interop practices

  • some common buildsystems.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-858505669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HA23DTYYT67Q4CXUN3TSCHO7ANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

If you build it under ubuntu you can use it only under Linux unless you crosscompile for windows with something like msys.

I ported the code to work with windows so the easier way would be to use Visual Studio which i assume is something you are familiar with. You can create a VS C++ project in your solution that produces a DLL and then add this library's sources form /src into it. next-wip git branch has a VS project you can use as a reference. To compile this dll you would need a number of C++ libraries i listed above, and the easiest way to get them is vcpkg which is microsoft c++ library manager.

Umair-khalidkhan commented 3 years ago

So sorry but could you explain what you meant by porting. Yes I am familiar with VS and a friend did mention we might have to compile on unbuntu and then use it back for windows. If you could dumb it down a bit for me, as to how exactly I am to proceed from here, it would be of a great help ZeeWanderer.

Thank you!

On Thu, 10 Jun 2021, 3:44 pm ZeeWanderer, @.***> wrote:

If you build it under ubuntu you can use it only under Linux unless you crosscompile foe windows with something like msys.

I ported the code to work with windows so the easier way would be to use Visual Studio which i assume is something you are familiar with. You can create a VS project in your solution that produces a DLL and then add this library's sources form /src into it. next-wip branch has a VS project you can use as a reference. To compile this dll you would need a number of C++ libraries i listed above, and the easiest way to get them is vcpkg which is microsoft c++ library manager.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-858516166, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HDZP5XUY4HNL4JVA7LTSCJRNANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

uuuuh. The code originally was written for Linux with linux specific includes and system libraries, i changed it so it could be compiled and used on windows which is what i mean by ported. And you cannot compile on Ubuntu and use it back on widows without something like msys.

I already told you almost step by step. In Visual Studio you have Solutions, which have Projects. Each Project produces an artefact, exe or dll or whatever. You can create a C++ DLL project in your Solution and add source files of this library to it (located in /src). For reference you can use existing project from the next-wip branch of the git tree. Then you need to install required c++ libraries i listed in the first comment. The easiest way to do so would be vcpkg which is a c++ Microsoft library manager. You can find it here. I don't know how to simplify this even more.

Umair-khalidkhan commented 3 years ago

Thank you so much Zee, for you time. And yes we were doing that as you said, adding the source code files to our project. Problem that arose was for the .O and .OS files.

On Thu, 10 Jun 2021, 4:07 pm ZeeWanderer, @.***> wrote:

uuuuh. The code originally was written for Linux with linux specific includes and system libraries, i changed it so it could be compiled on windows which is what i mean by ported. And you cannot compile on Ubuntu and use it back on widows without something like msys.

I already told you almost step by step. In Visual Studio you have Solutions, which have Projects. Each Project produces an artefact, exe or dll or whatever. You can create a C++ DLL project in your Solution and add source files of this library to it (located in /src). For reference you can use existing project from the next-wip branch of the git tree. Then you need to install required c++ libraries i listed in the first comment. The easiest way to do so would be vcpkg which is a c++ Microsoft library manager. You can find it here https://vcpkg.io/en/index.html. I don't know how to simplify this even more.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-858529089, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HARIQH62KPKPUWI6FDTSCMF7ANCNFSM46NKEF5A .

Umair-khalidkhan commented 3 years ago

Sorry for this follow up email,so I can download the needed libraries you mentioned (which are also part of binacpp I believe) from vcpkg and use them instead of the ones from your repository since they have .S and .OS files and the vcpkg ones bypass that issue and provide me with libraries I can use on windows itself?

On Thu, 10 Jun 2021, 4:15 pm umair khalid, @.***> wrote:

Thank you so much Zee, for you time. And yes we were doing that as you said, adding the source code files to our project. Problem that arose was for the .O and .OS files.

On Thu, 10 Jun 2021, 4:07 pm ZeeWanderer, @.***> wrote:

uuuuh. The code originally was written for Linux with linux specific includes and system libraries, i changed it so it could be compiled on windows which is what i mean by ported. And you cannot compile on Ubuntu and use it back on widows without something like msys.

I already told you almost step by step. In Visual Studio you have Solutions, which have Projects. Each Project produces an artefact, exe or dll or whatever. You can create a C++ DLL project in your Solution and add source files of this library to it (located in /src). For reference you can use existing project from the next-wip branch of the git tree. Then you need to install required c++ libraries i listed in the first comment. The easiest way to do so would be vcpkg which is a c++ Microsoft library manager. You can find it here https://vcpkg.io/en/index.html. I don't know how to simplify this even more.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-858529089, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HARIQH62KPKPUWI6FDTSCMF7ANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

.a and .so are linux only. Basically it's Linux equivalents of static and dynamic dlls. I just haven't deleted then from the repo. You can't use them under windows besides i never recompiled them so they are outdated anyway.

Umair-khalidkhan commented 3 years ago

Hi! ZeeWanderer, so we used vcpkg and got libwebsockets, jsoncpp, and curlcpp. Now the only library left is your own binacpp, now how do we use its .O files, I thought maybe if its just code I can open them in VS and/or somehow open and copy paste the whole source and recompile, VS didn't display, and when I opened in Notepad it showed a lot of weird ASCII characters implying some encoding , or in short it can't be deciphered. What do we do now?

Thanks

On Thu, 10 Jun 2021, 4:56 pm ZeeWanderer, @.***> wrote:

.a and .so are linux only. Basically it's Linux equivalents of static and dynamic dlls. I just havent deleted then from the repo. You cant use them under windows besides i never recompiled them so they are outdated anyway.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-858557425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HFCQ72OAVNWFY6TW7DTSCR7BANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

.so files are for linux only, i already told you. Thats just.... You can download the source from here and then add source files from /src to the C++ DLL VS project. I have done it before, it works. But i forgot that jsoncpp provided by vcpkg is too new and is incompatible. You can try next-wip branch, it requires nlohmann-json. Here, i made a video.

https://user-images.githubusercontent.com/8377469/121650702-7ddbc680-caa2-11eb-8bc7-eb7e2b8d9c8c.mp4

Umair-khalidkhan commented 3 years ago

Thank you for the video, so the only files I can use are the ones located in the second folder in the main folder. And I make a dll of those source files. How do the external libraries come into play? And I am sorry but I have not figured out what the 'next -wip' branch is.

Thanks for your patience

On Fri, 11 Jun 2021, 12:49 pm ZeeWanderer, @.***> wrote:

.so files are for linux only, i already told you. Thats just.... You can download the source from here and then add source files from /src to the C++ DLL VS project. I have done it before, it works. But i forgot that jsoncpp provided by vcpkg is too new and is incompatible. You can try next-wip branch, it requires nlohmann-json. Here, i made a video.

https://user-images.githubusercontent.com/8377469/121650702-7ddbc680-caa2-11eb-8bc7-eb7e2b8d9c8c.mp4

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859360795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HE5CSNPFYDU4SOOVXDTSG5Z3ANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

What do you mean by "How do the external libraries come into play"? binacpp uses those libraries to function, binacpp is dependant on them to work. next-wip is a branch of the git tree, this site is GitHub, all repositories on it use git for source control, so you need to know at least basics of git to do anything meaningful here

ZeeWanderer commented 3 years ago

you said C#? maybe you should use this https://github.com/ilkerulutas/BinanceSdk

Umair-khalidkhan commented 3 years ago

So how do I bring all the libraries together at the end? Since I shouldn't use the vcpkg json file, yours has no Linux files so I think I can directly use yours, we can create the binacpp dll but when we downloaded the curl and libwebsockets libraries, how to do we collectively add their files(so many CMake, headers, source files) make a dll for them aswell like you did for binacpp? I don't know about git tree, or what git itself is, I did download it to use the git clone compand.

On Fri, 11 Jun 2021, 1:40 pm ZeeWanderer, @.***> wrote:

you said C#? maybe you should use this https://github.com/ilkerulutas/BinanceSdk

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859392842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HFN4ALJSLILWYJARD3TSHDZTANCNFSM46NKEF5A .

Umair-khalidkhan commented 3 years ago

Follow up! So I followed your video and created the dll. Didn't build since I had not included the other dlls, so I make another dll for the json file you supplied? (Using only the src file and/or including the 'included headers?) Same goes for the vcpkg libraries I downloaded. I add all the files in source in VS and make a dll of them similarly? If so how at the end I tell the binacpp_dll where its dependencies are?

Thank you soo much Zee!

On Fri, 11 Jun 2021, 2:00 pm umair khalid, @.***> wrote:

So how do I bring all the libraries together at the end? Since I shouldn't use the vcpkg json file, yours has no Linux files so I think I can directly use yours, we can create the binacpp dll but when we downloaded the curl and libwebsockets libraries, how to do we collectively add their files(so many CMake, headers, source files) make a dll for them aswell like you did for binacpp? I don't know about git tree, or what git itself is, I did download it to use the git clone compand.

On Fri, 11 Jun 2021, 1:40 pm ZeeWanderer, @.***> wrote:

you said C#? maybe you should use this https://github.com/ilkerulutas/BinanceSdk

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859392842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HFN4ALJSLILWYJARD3TSHDZTANCNFSM46NKEF5A .

Umair-khalidkhan commented 3 years ago

I have included a SS of the libwebsockets we downloaded

Do I directly use the .dll file(if so which one and how), along with .pdb file, or not and compile a new one by adding all(many) the c++ headers files like your video? And even doing that, how to link both?

On Fri, 11 Jun 2021, 2:44 pm umair khalid, @.***> wrote:

Follow up! So I followed your video and created the dll. Didn't build since I had not included the other dlls, so I make another dll for the json file you supplied? (Using only the src file and/or including the 'included headers?) Same goes for the vcpkg libraries I downloaded. I add all the files in source in VS and make a dll of them similarly? If so how at the end I tell the binacpp_dll where its dependencies are?

Thank you soo much Zee!

On Fri, 11 Jun 2021, 2:00 pm umair khalid, @.***> wrote:

So how do I bring all the libraries together at the end? Since I shouldn't use the vcpkg json file, yours has no Linux files so I think I can directly use yours, we can create the binacpp dll but when we downloaded the curl and libwebsockets libraries, how to do we collectively add their files(so many CMake, headers, source files) make a dll for them aswell like you did for binacpp? I don't know about git tree, or what git itself is, I did download it to use the git clone compand.

On Fri, 11 Jun 2021, 1:40 pm ZeeWanderer, @.***> wrote:

you said C#? maybe you should use this https://github.com/ilkerulutas/BinanceSdk

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859392842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HFN4ALJSLILWYJARD3TSHDZTANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

Visual Studio would copy all dll dependencies by itself. You can see it on the video when i show binaccp dll in folder, all other dlls are already there put by VS. You install c++ libraries via vcpkg, then run vcpkg.exe integrate install and that should be it. No manual dll coping required because Visual Studio will copy them for you. And you need to learn at least basics of git.

Umair-khalidkhan commented 3 years ago

Thanks, that simplifies it, however what about jsoncpp, since you mentioned I can't use the newer version. Make it's own dll but adding src and include files? Will surely learn about git once this semester ends.

On Fri, 11 Jun 2021, 2:56 pm ZeeWanderer, @.***> wrote:

Visual Studio would copy all dll dependencies by itself. You can see it on the video when i show binaccp dll in folder, all other dlls are already there put by VS. You install c++ libraries via vcpkg, then run vcpkg.exe integrate install and that should be it. No manual dll coping required because Visual Studio will copy them for you. And you need to learn at least basics of git.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859461729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HBYHVK7XZV42NPTPSDTSHMUDANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

use next-wip git branch. it uses nlohmann-json library instead of jsoncpp. image

ZeeWanderer commented 3 years ago

btw if you use next-wip branch you can just add binacpp as a submodule and then add existing VS project to your solution from it. image

Umair-khalidkhan commented 3 years ago

Thanks, I'll check it out. 😊

On Fri, 11 Jun 2021, 3:14 pm ZeeWanderer, @.***> wrote:

btw if you use next-wip branch you can just add binacpp as a submodule and then add existing VS project to your solution from it. [image: image] https://user-images.githubusercontent.com/8377469/121671213-f2b8fb80-cab6-11eb-9258-1a52a53d3b1c.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859472748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HB3PJQ3AE72UWL6I73TSHOZLANCNFSM46NKEF5A .

Umair-khalidkhan commented 3 years ago

Hi Zee! I am not getting the next -wip branch, I clicked view all, this master was the online thing I was getting.

On Fri, 11 Jun 2021, 3:23 pm umair khalid, @.***> wrote:

Thanks, I'll check it out. 😊

On Fri, 11 Jun 2021, 3:14 pm ZeeWanderer, @.***> wrote:

btw if you use next-wip branch you can just add binacpp as a submodule and then add existing VS project to your solution from it. [image: image] https://user-images.githubusercontent.com/8377469/121671213-f2b8fb80-cab6-11eb-9258-1a52a53d3b1c.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859472748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HB3PJQ3AE72UWL6I73TSHOZLANCNFSM46NKEF5A .

Umair-khalidkhan commented 3 years ago

Follow up, We are suppose to get the curlpp library right? and not curl. If so, then your binacc dll includes curl/curl.h wouldn't that cause issues?

On Fri, 11 Jun 2021, 8:13 pm umair khalid, @.***> wrote:

Hi Zee! I am not getting the next -wip branch, I clicked view all, this master was the online thing I was getting.

On Fri, 11 Jun 2021, 3:23 pm umair khalid, @.***> wrote:

Thanks, I'll check it out. 😊

On Fri, 11 Jun 2021, 3:14 pm ZeeWanderer, @.***> wrote:

btw if you use next-wip branch you can just add binacpp as a submodule and then add existing VS project to your solution from it. [image: image] https://user-images.githubusercontent.com/8377469/121671213-f2b8fb80-cab6-11eb-9258-1a52a53d3b1c.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859472748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HB3PJQ3AE72UWL6I73TSHOZLANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

I did not mention curlpp ever. It is clearly stated curl, no idea where you got that one. I have no idea what to do about you not seeing the next-wip branch. GitHub UI is quite simple and i even included a screenshot... You can use git cli to checkout the branch. Plus i already suggested you a C# alternative.

Umair-khalidkhan commented 3 years ago

Yeah sorry read somewhere on the Internet, got confused. Downloading curl as we speak. We'll I've also sent you my SS apparently github isn't showing me next -wip. Furthermore, if you could look at the attached SS can't I include the json files supplied in your binacpp master file like this?

On Fri, 11 Jun 2021, 9:17 pm ZeeWanderer, @.***> wrote:

I did not mention curlpp ever. It is clearly stated curl, no idea where you got that idea. I have no idea what to do about you not seeing the next-wip branch. GitHub UI is quite simple and i even included a screenshot... You can use git cli to checkout the branch. Plus i already suggested you a C# alternative.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859692238, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HFDWUV6VK3OO6FZX7TTSIZLPANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

What attached SS? I see no attached images or anything. Maybe you should stop replying by email

Umair-khalidkhan commented 3 years ago

Oh, so sorry , i thought you have been getting my screenshots, now i am commenting via github directly, now ive attached, as said, ive addded your binacpp master file json headers in the headers files folder and the srx one in source,is that okay? since luike you i am not getting the option of next -wip under the master file in the git tree branch. also your C# replacement is for this json file?

thanks for your patience

it[](Capture)

Umair-khalidkhan commented 3 years ago
Capture
ZeeWanderer commented 3 years ago

that looks like you don't have curl installed and available

Umair-khalidkhan commented 3 years ago

I havnt built it yet, but I have installed libwebsockets(along with its extra libraries) and applies integrate install aswell.

On Fri, 11 Jun 2021, 9:44 pm ZeeWanderer, @.***> wrote:

that looks like you don't have curl installed and available

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-859708990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HFV2VJ4EW4LOWLWFETTSI4OPANCNFSM46NKEF5A .

Umair-khalidkhan commented 3 years ago

So i just had to restart my system for VS to detect the libraries, and they are working. only json library is left, so can I add and compile the json.h json-forwards.h and jsoncpp.cpp like I did. Will that work?

thanks a ton!

ZeeWanderer commented 3 years ago

i never compiled jsoncpp by myself so idk, you probably would have to modify jsoncpp includes. Here is next-wip branch that uses nlohmann-json binacpp-windows-next-wip.zip

Umair-khalidkhan commented 3 years ago

Hi! Zee quick update, so i added your own json files to the dll worked fine, then there were some other LINUX headers that i also had to replace such as sys/time.h (commented out fnmatch.h) however i am stuck for unistd.h i did find a windows library that services but stil lgetting it set up, anywho thanks for the helping out the whole proccess otherwise i wouldve been stuck on my own. thanks

uni
Umair-khalidkhan commented 3 years ago

Hi! Zee something seems to be wrong while linking your library to a test project. ive added the debug folder in which the .dll files are stored in Linker -> General-> additional Library directories but I get external errors, and when I add the folder in references it still gives another error

Capture
Umair-khalidkhan commented 3 years ago
Capture2
Umair-khalidkhan commented 3 years ago

additionally this function of yours has a return type of int but isnt returning any value, when i add the satement return 0;(just for testing purposes ) i keep on getting the same error that it must return a value.

func
Umair-khalidkhan commented 3 years ago

Hi! Zee, so im implementing klines and managed to get it up but, since only you know how your functions are operating can you help me out here? why is this like this, i have added my API and secret keys in the binacpp.cpp file

klines
Umair-khalidkhan commented 3 years ago

similarly i am getting this error in your example.cpp project, also note for candles.cpp and for this example.cpp i was having linking issues to the binacpp_dll so instead I copied all the files to source of the test projects to work.

example
ZeeWanderer commented 3 years ago

Functions you are mentioning like ws_klines_onData are in example sources in examples/ folder. I haven't even looked at them because they are irrelevant to the library. There is some broken stuff there. IDK why would you use any of that thou.

Umair-khalidkhan commented 3 years ago

That was so because was trying to compile your examples and was trying to use your functions, since I myself do not know how which functions and how they work, hence was compiling and checking yours to learn. Your own example.cpp is throwing some external error, klines.cpp runs but doesn't function as its suppose to I guess, furthermore in the klines SS, it says ssl error, so does that have something to do with your .Pem file, the certificate? Or the run.sh files? .sh files are again Linux so how can I integrate them with the project?

Thanks.

On Sun, 13 Jun 2021, 3:24 pm ZeeWanderer, @.***> wrote:

Functions you are mentioning like ws_klines_onData are in example sources in examples/ folder. I haven't even looked at them because they are irrelevant to the library. There is some broken stuff there. IDK why would you use any of that thou.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ZeeWanderer/binacpp-windows/issues/3#issuecomment-860187784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKA53HBEBHIE53V7FRFU7E3TSSBPRANCNFSM46NKEF5A .

ZeeWanderer commented 3 years ago

I already told you i haven't touched example*.cpp files because they are irrelevant and there is a lot of broken stuff there so unless you fix them by yourself and then port them to windows most of that stuff would not work out of the box.

Readme provides a good overview of the library and a number of working examples sans links to .ccp files.

If you are using BinaCPP_websocket::init(); and getting ssl certificate error you need to download cacert.pem, and pass its location to BinaCPP_websocket::init();.

Umair-khalidkhan commented 3 years ago

How can i pass location to it since its a function that accepts no parameters?

cert
ZeeWanderer commented 3 years ago

Have you downloaded sources form this repo? https://github.com/ZeeWanderer/binacpp-windows/blob/5e3f17987b331f14d01be65cd42968795f654bc1/src/binacpp_websocket.cpp#L78 Honestly this is ridiculous

ZeeWanderer commented 3 years ago

I bet you followed README instructions and cloned original repository and not this fork. I already told you that i haven't touched readme but you should have been able to see that you are clonning the wrong repo by contents of the link and by its name. Maybe i should change it after all...

Umair-khalidkhan commented 3 years ago

I never cloned the repository via command line. I downloaded the zip, extracted and compiled the source files into a single project. I take it that I had to use the next -wip branch ;-;

ZeeWanderer commented 3 years ago

Then either you have done it the wrong way or more than 15 days ago. As i added that parameter 15 days ago when someone else encountered SSL error. image

Both master and next-wip have that parameter. In fact the link i gave you points to master's binacpp_websocket.cpp

Umair-khalidkhan commented 3 years ago

This is exactly where i went and how i downloaded it ;-;

Umair-khalidkhan commented 3 years ago

if this is the only edit you made, I can change the function myself aswell ;-;