Bitcoin Forum
September 18, 2018, 10:31:32 PM *
News: ♦♦ Bitcoin Core users must update to 0.16.3 [Torrent]. More info.
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Win32 CgMiner CURL static linking  (Read 1812 times)
Offline Offline

Activity: 2
Merit: 0

View Profile
March 30, 2014, 04:29:17 PM

Helloo, i have build libcurl with ssl support statically myself, when i try to compile a simple samples it links allright in a static executable,
but when i try to link it with cgminer 3.6.6 i get

c:\mingw\include\sdkddkver.h:154:0: note: this is the location of the previous d
 #    define _WIN32_WINNT _WIN32_WINNT_WIN2K
  CC     cgminer-api.o
  CC     cgminer-logging.o
  CC     cgminer-driver-opencl.o
  CC     cgminer-ocl.o
  CC     cgminer-findnonce.o
  CC     cgminer-adl.o
  CCLD   cgminer.exe
cgminer-cgminer.o:cgminer.c:(.text+0x3304): undefined reference to `timeEndPerio
cgminer-cgminer.o:cgminer.c:(.text+0x9f77): undefined reference to `timeEndPerio
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cgminer-cg
miner.o: bad reloc address 0x200 in section `.data'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make[2]: *** [cgminer.exe] Error 1
make[2]: Leaving directory `/home/user/cgminer2/cgminer-3.6.6'

So i assume timeEndPeriod are undefined for some reason now, how do i fix that?

My configuration of cgminer is
configure --enable-opencl --enable-adl --disable-shared CFLAGS="-DCURL_STATICLIB -DPTW32_STATIC_LIB -O2 -msse2"

My configuration of libcurl is
configure --disable-shared --disable-ldap --with-ssl=/usr/local LIBS="-lgdi32"

My configuration of openssl is
perl Configure mingw no-shared no-asm --prefix=/c/OpenSSL
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Offline Offline

Activity: 52
Merit: 0

View Profile
April 06, 2014, 07:45:05 AM

Just solved the issue:

Add to your CFLAGS

That solved the timeEndPeriod for me. Also, have you used the  <winsock2.h> edit?

I am building 4.2.2 and with less settings but did encounter the same issues. My last build had zero errors but wouldn't run. If I discover anything that could help you I'll post or edit my post.

Edit:Sorry I'm also assuming you've made all necessary changes: such as -lcurl -lcurldll to libcurl.pc

**Throws Hands In The Air** I'm compiling with no errors and it still or won't run or I'm getting _WIN32.... already redifined >> When I fix this I get timeradd errors...

CFLAGS="-O2 -msse2 -DWIN32_LEAN_AND_MEAN -lws2_32 -lshlwapi -lmswsock" ./configure --enable-icarus

Minimum system required Minimum value for _WIN32_WINNT and WINVER
Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602)
Windows 8 _WIN32_WINNT_WIN8 (0x0602)
Windows 7 _WIN32_WINNT_WIN7 (0x0601)
Windows Server 2008 _WIN32_WINNT_WS08 (0x0600)
Windows Vista _WIN32_WINNT_VISTA (0x0600)
Windows Server 2003 with SP1, Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502)
Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501)
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!