GDL
About building parametric objects with GDL.

libcurl library causing plugin to disappear from menu

Anonymous
Not applicable
Hello,

I'm trying to implement curl library into my archicad plugin. On MAC there are no problems with it, but on Windows I can only compile the code without errors, and then if I open AC21 on Windows it says that the plugin is outdated.

This is the code that causes the error:
curl_global_init(CURL_GLOBAL_ALL);

	

	CURL *curl;
	CURLcode res;

	curl = curl_easy_init();

	string urlString = "somesite";

	
	if (curl) {


		curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);

		curl_easy_setopt(curl, CURLOPT_URL, urlString.c_str());
		
		curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

	
		
		res = curl_easy_perform(curl);

		WriteReport("CURL IS %s", urlString.c_str());
		
		WriteReport("CURL status is %i", res);
		if (res != CURLE_OK)
			fprintf(stderr, "curl_easy_perform() failed: %s\n",
				curl_easy_strerror(res));

		setProjectBuildups(userID);

		
		curl_easy_cleanup(curl);
	}
	
If I remove this code the plugin doesn't appear as outdated and it runs fine. I also notice that when I compile in VS2017 there is a libcurl.dll file in the build folder. Should I somehow include this .dll file in the add-ons folder ? Every help will be highly appreciated

Thanks in advance,
Julian
1 REPLY 1
Ralph Wessel
Mentor
It's probably down to the way you link the curl library into the add-on. If you're using dynamic linking and library can't be found at runtime, the add-on won't load. ARCHICAD always says the add-on is outdated no matter what the problem is.

You could either bundle the dll with the add-on or try static linking instead.
Ralph Wessel BArch
Software Engineer Speckle Systems