cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem with ming32 and curl with ssl enabled

From: <Surfman19_at_gmx.at>
Date: Fri, 28 Apr 2006 22:27:05 +0200 (MEST)

Hi,

i compiled this sample code:
#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
  CURL *curl;
  CURLcode res;
 
  curl = curl_easy_init();
  if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "http://rafb.net");
     res = curl_easy_perform(curl);
  
     /* always cleanup */
     curl_easy_cleanup(curl);
   }
   return 0;
}

debugger output:

C:\curl_test>gdb Projekt1
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) run
Starting program: C:\curl_test/Projekt1.exe

Program received signal SIGSEGV, Segmentation fault.
0x77c16137 in _libwsock32_a_iname ()
(gdb) backtrace
#0 0x77c16137 in _libwsock32_a_iname ()
#1 0x00efa3a0 in ?? ()
#2 0x0040b4ac in Curl_clone_ssl_config ()
#3 0x0040601a in Curl_connect ()
#4 0x0040a2ac in Curl_connect_host ()
#5 0x0040a515 in Curl_perform ()
#6 0x0040133e in main () at main.cpp:12

whats wrong with wsock32 library?

here my makefile:
# Project: Projekt1

CPP = g++.exe -D__DEBUG__
CC = gcc.exe -D__DEBUG__
WINDRES = windres.exe
RES =
OBJ = main.o $(RES)
LINKOBJ = main.o $(RES)
LIBS = -L"C:\c++\mingw\lib" -L"C:/c++/curl/lib" -L"C:\C++\openssl\lib"
-lcurl -lssl -lcrypto -lwsock32 -lgdi32 -lwinmm
INCS = -I"C:\c++\mingw\include" -I"C:/c++/curl/include"
CXXINCS = -I"C:/c++/curl/include"
BIN = Projekt1.exe
CXXFLAGS = $(CXXINCS) -g3 -DCURL_STATICLIB
CFLAGS = $(INCS) -g3 -DCURL_STATICLIB
RM = del

.PHONY: all all-before all-after clean clean-custom

all: all-before Projekt1.exe all-after

clean: clean-custom
        ${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
        $(CPP) $(LINKOBJ) -o "Projekt1.exe" $(LIBS)

main.o: main.cpp
        $(CPP) -c main.cpp -o main.o $(CXXFLAGS)

any idea?
best regards,
Surf

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
Received on 2006-04-28