www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/02/05/15:16:22

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <47A8C3F9.5020508@x-ray.at>
Date: Tue, 05 Feb 2008 21:15:53 +0100
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: undefined refernce symbol __chkstk
References: <000001c86811$601d3a00$af0ab7a3 AT mea DOT slb DOT com>
In-Reply-To: <000001c86811$601d3a00$af0ab7a3@mea.slb.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Anik Pal schrieb:
> I got the linking error message "undefined reference symbol __chkstk". When
> I try to link my source code with a MSVC compiled library. From the
> following url I got a workaround to remove this problem is to copy
> CHKSTK.OBJ from MSVC library and rename it to chkstk.o and link with it.
> 
> http://eegeerg.blogspot.com/2008_01_01_archive.html#4158852069709002699
>  
> But that option remove this error message and create the executable, But
> when run the executable it doesn't give anything just abort, no error
> message
> 
> I'm also linking my code with cygwin/lib/mingw/libmsvcrt.a
> 
> Now I suspect that wither CHKSTK.OBJ MSVC object file or mingw libmsvcrt.a
> library or both is causing this problem. But I'm not sure How to replace
> them with equivalent lib if I want to remove dependency from Mingc and MSVC
> both.

If your goal is to remove the dependency from Mingw and MSVC, so why are 
still trying to link against MSVC libs with ggc and MSVC specific 
compiler options?
__chkstk is a MSVC-specific stack checker compiled into each debugging 
function.

Get rid of your MSVC build script with cygwin, and use the cygwin 
equivalent of the solaris environment. Esp. get cygwin or mingw libs.
That's your work to do. Or use MSVC.

The day you got your cygwin application to compile against those
MSVC libs will not be the end of your problems.
http://cygwin.com/faq/faq.programming.html#faq.programming.msvcrt-and-cygwin

 > -LF:/geolog6.6.1/lib -lcgg -lgeolog6  -llicence -llogs_dll -lPGILc_dll
 > -lPGILcTool_dll -lcgs -llmgr9a -LD:/cygwin/lib -lcygwin
 > -LD:/cygwin/lib/mingw -lmsvcrt -Bstatic -LD:/cygwin/lib -lm

oh horror.

 >undefined reference to `?instance AT OrbInit@@SAPAV1 AT HPBDH@Z'

So you link against a MSVC C++ library with gcc? Corba?
Maybe possible with a lot of work. But most likely not.
http://cygwin.com/faq/faq.programming.html#faq.programming.msvc-gcc-objects
E.g. besides the different C++ name mangling, your lib is linked against 
the microsoft c runtime, on cygwin you use the cygwin c runtime.
Both together will not work. The C++ members allocate new memory with 
the msvcrt malloc(), which cannot be free'd from any cygwin function. 
And vice versa.
-- 
Reini

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019