Author

Topic: Win32 CgMiner CURL static linking (Read 1875 times)

newbie
Activity: 52
Merit: 0
April 06, 2014, 02:45:05 AM
#2
Just solved the issue:

Add to your CFLAGS
Code:
-DWIN32

That solved the timeEndPeriod for me. Also, have you used the   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

Code:
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)
newbie
Activity: 2
Merit: 0
March 30, 2014, 11:29:17 AM
#1
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

Code:
c:\mingw\include\sdkddkver.h:154:0: note: this is the location of the previous d
efinition
 #    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
d'
cgminer-cgminer.o:cgminer.c:(.text+0x9f77): undefined reference to `timeEndPerio
d'
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
Quote
configure --enable-opencl --enable-adl --disable-shared CFLAGS="-DCURL_STATICLIB -DPTW32_STATIC_LIB -O2 -msse2"

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

My configuration of openssl is
Quote
perl Configure mingw no-shared no-asm --prefix=/c/OpenSSL
Jump to: