Jean-Philippe Barrette-LaPierre wrote:
> On 14 December 2005 10:30, Giuseppe Corbelli wrote:
>> Hi
>> I'm a new user of curlpp, forced to work on win32 systems.
>> I am building the DLL version of 0.6 pre3 with msvc7.1.
>> I found that some features lack the name decoration, thus are not exported
>> in the DLL.
>> Up till now I found cURLpp::{Info,InfoTypeConverter,InfoGetter}, they need
>> the usual CURLPPAPI trick. Sorry if I don't provide a patch, I'm a cvs-only
>> guy.
>
> Well, I must admit that the CVS to GNU Arch move was a bad one. I'll set a
> subversion repository sooner or later. But can you provide a patch that I
> could apply?
Ok. Here's the (stupid) patch for Info.hpp
28c28
< #include "dllfct.h"
---
>
39c39
< struct CURLPPAPI Info
---
> struct Info
52c52
< struct CURLPPAPI InfoTypeConverter
---
> struct InfoTypeConverter
65c65
< struct CURLPPAPI InfoGetter
---
> struct InfoGetter
>> Not a promise, mind, but I will try to provide a makefile for msvc, sooner
>> or later :-)
>
> That would be appreciated.
I'm attaching the Makefile.msvc, based heavily on libcurl makefile.
It has to be put in curlpp/ and (at the moment) does not take care of utilspp/
Using this I was able to build an usable curlpp dll.
I'm also attaching an "autolink.h" that implements automatic linking on win32
with supported compilers. It may be left anywhere in the source tree, and the
user has to explicitly include it.
There's still an issue with win32 compilation: the config.h file.
For non-autotools build systems there should be a standard, hand-crafted
config.h, say config.h.win32, without the STATICLIB define, which is managed
in the Makefile.
This config.h.win32 should be distributed with curlpp and conditionally
included where applicable. I'm attaching it here.
Ok, that's all. Let me know if all these ravings make some sense or not :-)
--
Giuseppe "Cowo" Corbelli ~\/~ My software: http://cowo.yoda2000.net
-<! Non c'e' niente da dire in proposito. Tutto quello che uno deve fare e'
colpire i tasti giusti al momento giusto, e lo strumento suona da solo. !>-
J.S. Bach
#############################################################
#
# Makefile for building libcurlpp with MSVC
# Based heavily on libcurl Makefile
# Giuseppe "Cowo" Corbelli - cowo at lugbs dot linux dot it
#
# Usage: see usage message below
# Should be invoked from curlpp/ directory
# Edit the LIBCURL_PATH or set LIBCURL_PATH envvar
#
##############################################################
LIB_NAME = libcurlpp
LIB_NAME_DEBUG = libcurlppd
#############################################################
!IFNDEF LIBCURL_PATH
LIBCURL_PATH = ../../curl/include
!ENDIF
CCNODBG = cl.exe /MD /O2 /DNDEBUG /GR
CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D_DEBUG /GZ /GR
CFLAGS = /I ../ /I "$(LIBCURL_PATH)/include" /nologo /W3 /GX /DWIN32 /YX /FD /c
CFLAGSLIB = /DCURLPP_STATICLIB
CFLAGSDLL = /UCURLPP_STATICLIB
LNKDLL = link.exe /DLL /INCREMENTAL:NO /OPT:NOREF
LNKLIB = link.exe /lib
LFLAGS = /nologo /LIBPATH:"$(LIBCURL_PATH)/lib"
CURLLIB = libcurl_imp.lib
CFGSET = FALSE
######################
# release
!IF "$(CFG)" == "release"
TARGET = $(LIB_NAME).lib
DIROBJ = $(CFG)
LNK = $(LNKLIB) /out:$(DIROBJ)/$(TARGET)
CC = $(CCNODBG) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
######################
# release-dll
!IF "$(CFG)" == "release-dll"
TARGET = $(LIB_NAME).dll
DIROBJ = $(CFG)
LNK = $(LNKDLL) $(CURLLIB) /out:$(DIROBJ)/$(TARGET)
CC = $(CCNODBG) $(CFLAGSDLL)
CFGSET = TRUE
!ENDIF
######################
# debug
!IF "$(CFG)" == "debug"
TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LNK = $(LNKLIB) /out:$(DIROBJ)/$(TARGET)
CC = $(CCDEBUG) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
######################
# debug-dll
!IF "$(CFG)" == "debug-dll"
TARGET = $(LIB_NAME_DEBUG).dll
DIROBJ = $(CFG)
LNK = $(LNKDLL) $(CURLLIB) /DEBUG /out:$(DIROBJ)/$(TARGET) /PDB:$(DIROBJ)/$(LIB_NAME_DEBUG).pdb
CC = $(CCDEBUG)
CFGSET = TRUE
!ENDIF
#######################
# Usage
#
!IF "$(CFGSET)" == "FALSE" && "$(CFG)" != ""
!MESSAGE Usage: nmake /f makefile.msvc CFG=<config>
!MESSAGE where <config> is one of:
!MESSAGE release - release static library
!MESSAGE release-dll - release dynamic library
!MESSAGE debug - debug static library
!MESSAGE debug-dll - debug dynamic library
!ERROR please choose a valid configuration "$(CFG)"
!ENDIF
#######################
# Only the clean target can be used if a config was not provided.
#
!IF "$(CFGSET)" == "FALSE"
clean:
@-erase /s *.dll 2> NUL
@-erase /s *.exp 2> NUL
@-erase /s *.idb 2> NUL
@-erase /s *.lib 2> NUL
@-erase /s *.o 2> NUL
@-erase /s *.pch 2> NUL
@-erase /s *.pdb 2> NUL
@-erase /s *.res 2> NUL
!ELSE
# A config was provided, so the library can be built.
#
X_OBJS= \
$(DIROBJ)/CurlHandle.o \
$(DIROBJ)/cURLpp.o \
$(DIROBJ)/Exception.o \
$(DIROBJ)/Easy.o \
$(DIROBJ)/Form.o \
$(DIROBJ)/Info.o \
$(DIROBJ)/OptionBase.o \
$(DIROBJ)/OptionList.o \
$(DIROBJ)/OptionSetter.o \
$(DIROBJ)/SList.o \
all : $(TARGET)
$(TARGET): $(X_OBJS)
$(LNK) $(LFLAGS) $(X_OBJS)
$(X_OBJS): $(DIROBJ)
$(DIROBJ):
@if not exist "$(DIROBJ)" mkdir $(DIROBJ)
.SUFFIXES: .cpp .obj
{.\}.cpp{$(DIROBJ)\}.o:
$(CC) $(CFLAGS) /Fo"$@" $<
!ENDIF # End of case where a config was provided.
/*
* Copyright (c) <2005> <Giuseppe "Cowo" Corbelli>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (cURLpp), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __AUTOLINK__H_
#define __AUTOLINK__H_
/*
* Auto-link feature on win32 supported compilers. Reading boost sources it seems
* that _MSC_VER definition does not guarantee a ms compiler. However this should
* not be a problem for autolink.
*/
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
#if defined(_MSC_VER ) || defined(__INTEL_COMPILER) || defined(__ICL) || \
defined(__ICC) || defined(__ECC) || defined(__MWERKS__) || defined(__BORLANDC__)
#if defined(_DEBUG) || defined(DEBUG)
#pragma comment(lib, "libcurlppd.lib")
#else //DEBUG
#pragma comment(lib, "libcurlpp.lib")
#endif //DEBUG
#endif //Supported compilers
#endif //Windows
#endif //__AUTOLINK__H_
/* config.h.in. Generated from configure.ac by autoheader. */
/* when building cURLpp itself */
#define BUILDING_CURLPP 1
/* Define to 1 if you have the <curl/curl.h> header file. */
#define HAVE_CURL_CURL_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <ostream> header file. */
#define HAVE_OSTREAM 1
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#define PACKAGE "curlpp"
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#define PACKAGE_NAME "CurlPP"
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS
/* Version number of package */
#define VERSION 0.6.0-pre3
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2005-12-16