Bitcoin Forum
May 14, 2024, 01:01:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Win32 CgMiner CURL static linking  (Read 1870 times)
Vanya228 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 30, 2014, 04:29:17 PM
Last edit: March 30, 2014, 04:51:43 PM by Vanya228
 #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
1715691716
Hero Member
*
Offline Offline

Posts: 1715691716

View Profile Personal Message (Offline)

Ignore
1715691716
Reply with quote  #2

1715691716
Report to moderator
1715691716
Hero Member
*
Offline Offline

Posts: 1715691716

View Profile Personal Message (Offline)

Ignore
1715691716
Reply with quote  #2

1715691716
Report to moderator
1715691716
Hero Member
*
Offline Offline

Posts: 1715691716

View Profile Personal Message (Offline)

Ignore
1715691716
Reply with quote  #2

1715691716
Report to moderator
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715691716
Hero Member
*
Offline Offline

Posts: 1715691716

View Profile Personal Message (Offline)

Ignore
1715691716
Reply with quote  #2

1715691716
Report to moderator
1715691716
Hero Member
*
Offline Offline

Posts: 1715691716

View Profile Personal Message (Offline)

Ignore
1715691716
Reply with quote  #2

1715691716
Report to moderator
Proteu5
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
April 06, 2014, 07:45:05 AM
Last edit: April 06, 2014, 04:59:21 PM by Proteu5
 #2

Just solved the issue:

Add to your CFLAGS
Code:
-DWIN32

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

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)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!