Author Topic: Libcurl static compiling  (Read 12403 times)

Offline adrianc

  • Single posting newcomer
  • *
  • Posts: 2
Libcurl static compiling
« on: September 24, 2012, 07:58:56 pm »
I am trying to create my program using static linking.I download the lastest version of mingw curl.I followed these steps in the link
http://stackoverflow.com/questions/6243638/adding-static-libcurl-to-codeblocks-ide

I add linker libaries these libaries:
curl, rtmp, idn, ssl, ssh2, crypto, z, ws2_32, wldap32, winmm, gdi32

in linker its is : -static

I add Project->Build options->Compiler settings->#defines
CURL_STATICLIB

In project->build options->search directories
libcurl include file

Everything seems fine except for there is a error like that.I followed  the answer of stackoverflow question
What am i doing wrong

||Warning: .drectve `-aligncomm:"_sigx_app",2 ' unrecognized|
||Warning: .drectve `-aligncomm:"_sig_app",2' unrecognized|
..\..\Desktop\curl\lib\libcurl.a(mprintf.o)|| undefined reference to `__chkstk_ms'|
..\..\Desktop\curl\lib\libcurl.a(formdata.o)|| undefined reference to `__chkstk_ms'|
..\..\Desktop\curl\lib\libcurl.a(formdata.o)|| undefined reference to `__chkstk_ms'|
..\..\Desktop\curl\lib\libcrypto.a(cryptlib.o):cryptlib.c|| undefined reference to `__chkstk_ms'|
..\..\Desktop\curl\lib\libcrypto.a(bss_file.o):bss_file.c|| undefined reference to `__chkstk_ms'|
..\..\Desktop\curl\lib\libcrypto.a(err_prn.o):err_prn.c|| more undefined references to `__chkstk_ms' follow|
||=== Build finished: 6 errors, 2 warnings ===|


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Libcurl static compiling
« Reply #1 on: September 24, 2012, 09:09:35 pm »
Make sure you have Full Compiler Logging turned on.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Then post the build log on a site that supports your compiler.
NOTE: This site does NOT support any compiler!!

FYI: In doing linker the order of the library and object files matter!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline adrianc

  • Single posting newcomer
  • *
  • Posts: 2
Re: Libcurl static compiling
« Reply #2 on: September 24, 2012, 09:19:11 pm »
Thank you for response i enabled full command line logging.This is the situation


mingw32-g++.exe -Wall -fexceptions -DCURL_STATICLIB  -g    -I..\..\Desktop\curl\include  -c C:\Users\len1927\Documents\test\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -L..\..\Desktop\curl\lib  -o bin\Debug\test.exe obj\Debug\main.o   -static  ..\..\Desktop\curl\lib\libcurl.a ..\..\Desktop\curl\lib\librtmp.a ..\..\Desktop\curl\lib\libidn.dll.a ..\..\Desktop\curl\lib\libssl.a ..\..\Desktop\curl\lib\libssh2.a ..\..\Desktop\curl\lib\libcrypto.a ..\..\Desktop\curl\lib\libz.a "..\..\..\..\Program Files\CodeBlocks\MinGW\lib\libwldap32.a" "..\..\..\..\Program Files\CodeBlocks\MinGW\lib\libws2_32.a" "..\..\..\..\Program Files\CodeBlocks\MinGW\lib\libwinmm.a" "..\..\..\..\Program Files\CodeBlocks\MinGW\lib\libgdi32.a" ..\..\Desktop\curl\libeay32.dll.a
Warning: .drectve `-aligncomm:"_sigx_app",2 ' unrecognized
Warning: .drectve `-aligncomm:"_sig_app",2' unrecognized
..\..\Desktop\curl\lib\libcurl.a(mprintf.o):(.text+0xff): undefined reference to `__chkstk_ms'
..\..\Desktop\curl\lib\libcurl.a(formdata.o):(.text+0x27b): undefined reference to `__chkstk_ms'
..\..\Desktop\curl\lib\libcurl.a(formdata.o):(.text+0x153a): undefined reference to `__chkstk_ms'
..\..\Desktop\curl\lib\libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x52d): undefined reference to `__chkstk_ms'
..\..\Desktop\curl\lib\libcrypto.a(bss_file.o):bss_file.c:(.text+0x8dd): undefined reference to `__chkstk_ms'
..\..\Desktop\curl\lib\libcrypto.a(err_prn.o):err_prn.c:(.text+0x8a): more undefined references to `__chkstk_ms' follow
collect2: ld returned 1 exit status
Process terminated with status 1 (1 minutes, 30 seconds)
6 errors, 2 warnings
 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Libcurl static compiling
« Reply #3 on: September 24, 2012, 09:22:16 pm »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Libcurl static compiling
« Reply #4 on: September 24, 2012, 09:46:41 pm »
And please resepect the forum rules.
You accepted to follow these rules when registerung here:

[...]

1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.

2. Compiler/Linker errors are NOT Code::Blocks errors. Usually, C++ newcomers tend to confuse the Editor/IDE (Code::Blocks) with the Compiler (MINGW / GCC). You may see some errors in the compiler output because you missed to do something right in your code. But that's not Code::Blocks troubleshooting, that's C++ troubleshooting and does not belong in here. If your program doesn't compile, READ THE C++ MANUAL.

[...]

Topic locked !!