When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
254 messages ยท Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
#pragma comment( lib, "libcurl")
Shouldn't the linker do the same thing with the lib I added?
did you #define CURL_STATICLIB 1
not #pragma comment( lib, "libcurl.lib")?
is it same?
it isn't automatic
so then I would just put #pragma comment( lib, "libcurl.lib") right after the include lines?
sure, also in the visual studio project you will need to include the lib folder in linker options
I did that already I think
try then
the pragma says it cannot open file as well
is that because the file is called libcurl.a
ok then you didn't
oh x.x
i thought i downloaded the windows one
for some reason their windows one has .a extensions
no i don't think so, i used curl also
let me see
wait a sec
maybe the fastest way is to compile libcurl with cmake in visual studio
in x64 release and debug
Ive never used cmake I can try rq
download libcurl source https://github.com/curl/curl/releases/tag/curl-8_4_0 -> then open the folder on visual studio -> then wait cmake to configure itself and then compile
you will get .lib compiled from visual studio
and also .dll and .h
download the zip curl
I find the hardest part of learning c++ to be building applications to start from lol
alr one sec lemme do all that rq
if you learn this, you can do much more than before
btw off topic bu do you know if the clr empty project using .net framework is good for creating c++ applications, I am familiar with the c# windows form application but I wanted to create a c++ application to be faster and just to learn really?
in c++ if you want to create gui application i suggest to work with other frameworks like QT
otherwise if you want to work with windows.h library and gdi+, mfc is still existent but it needs to die
I saw qt when i was reasearching what frameworks to work with wasn't sure if it was the best or not or ideal for what i wanted
but just to learn something new
it is a good start point for doing a decent application
Ill try it out after i finish making this project lol
it is also cross platform
oh thats good
can I open this curl folder inside of an existing project
will cmake just configure it from there?
i created some time ago a game launcher in qt quick (private repo) with also libcurl and other libs
thats cool af fr I just wanted to create like a cool design
with ofc like some cool fns lol
with qt quick you can create a cool design and write c++ code in backend (similar javascript for frontend)
then it should do automatically
I made this design in windows form
open the folder from visual studio
based off some other thing i made in a lua project lol
windows form is pretty bad
yeah its annoying to work with
you want to do better things you will need to write custom controls
I literally just wanted to create a minimize animation to the taskbar and its so annoying to do
i had to do some graphs in mfc c++ with gdi+.... 1-2 days for just doing that
thats hell fr
because of the bugs and unexpected behaviour of mfc
also javascript is really easy to write frontend with so I should def try qt
alr can I just open the folder in an existing project will it just configure that project?
you write the interface in qml files that you can customize with QT Creator
then there are ways to connect c++ functions to javascript functions (backend to frontend and viceversa)
is that bad lol
if it does finish then no
ok it should be fine
now up on the visual studio bar
lmao
is it build all?
install CURL
huh that's a visual studio problem
hmm
try build all
they both error with no supported target architecture
ok wait a sec
let's return to the original pragma
write #pragma comment( lib, "libcurl.a")
and let's see if it works
because maybe they renamed wrongly..
#include <iostream>
#include <curl/curl.h>
#pragma comment( lib, "libcurl.a")
int main() {
CURL *curl;
CURLcode result;
curl = curl_easy_init();
if (curl == NULL) {
fprintf(stderr, "HTTP request failed\n");
return -1;
}
curl_easy_setopt(curl, CURLOPT_URL, "https://www.google.com");
result = curl_easy_perform(curl);
if (result != CURLE_OK) {
fprintf(stderr, "Error: %s\n", curl_easy_strerror(result));
return -1;
}
curl_easy_cleanup(curl);
return 0;
}
this is right?
hm?
go to this and then go to Project
and go to project options
cmake project options
I dont see cmake in it
do a screen
nono i meant, return to the visual studio that you opened before onto the curl folder
ok
show the same console but output tab
and you have windows 11 right?
it should be the same
ye
ok
do you have Widnows Universal CRT SDK?
do you have visual studio 2022?
yeah
download v143
whats 143
o
check it
downloading it
why does the sdk kit have multiple windows 11
downloads
do i only need 1 of them
yes
o
those are different versions
o
you need just one
let me know
yep
๐ฆ
there is something wrong on visual studio
im not even sure what it could be
v143 is not selected...
ahahaha
welp time to wait for this to install again lmao
it installed really fast
hopefully thats not a bad sign
now its not even starting cmake
probally
how do I start the cmake with a folder open?
I wanna try it one last time before completly reinstalling
I opened the folder but its not running cmake
atm
some kinda of bug
is there no way to start cmake with the folder being there?
Try to build it
reinstall
ill reinstall in a bit and then ill msg if it worked I have to do some stuff right now
๐
you know win32 already can do HTTP(S) curl not needed.
i mean no ididn't know that i'll probally try to use that after I get curl working atp its just a matter of me wanting to get it working anyway im back now so im gonna reinstall rq
I reinstalled and it is stil lfailing with the same error no supported target architecture
try removing msys64 from path once?
yeah, getting curl working is still a good option. (cross platform too)
just looking at my /c/libs/libcurl i built it from the git repo on windows using msvc2022. which made a libcurl.dll file
i followed the build instructions on the github page
i dont recall having any issues
is msys64 interfearing I don't think I even need it anymore I was using it when I was using c++ in vscode
Maybe it is, but we'll know after you try
Is msys64 actually needed to install curl? it says
i uninstalled it
and removed from path env
var
Edit: I got it working the vs file had the cmake information in it it was the msys64 interfearing with it it seems to work now thx u all for help ๐
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity