473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problem of linking libraries with GC_MALLOC

hi all
I have a problem of linking static libraries with GC_MALLOC, I
have made my routine smaller to make it simpler. I m using fedora 7
kernel version 2.6.18-1.2798.fc6

void
str_check_alloc( char **str, int required, int size)
{
int init_reqd, space2alloc;
if( size == 0) {
init_reqd = 1;
space2alloc = required;
}
else {
init_reqd = 0;
space2alloc = size*2;
}

if (init_reqd) {
*str = GC_MALLOC(space2alloc);
(*str)[0] = '\0';
} else
*str = GC_REALLOC(*str, space2alloc);
}

name of main program is "test_toupper.c" which calls this routine
"str_check_alloc" internally.
i m extracting executables in "test_toupper"

gcc -static -g -DINLINE= -I../../../install/include test_toupper.c -
L../../../install/lib -lgc -lsvcr -lm -o test_toupper

.../../../install/lib/libsvcr.a(libsvcr_a-str.o): In function
`str_check_alloc':
/work/anonymous/svc/libsvcr/str.c:47: undefined reference to
`GC_realloc'
/work/anonymous/svc/libsvcr/str.c:44: undefined reference to
`GC_malloc'

I have added "gc.h" library also but still it is showing undifined
reference to GC_MALLOC
what can be the problem.

Regds

Jitender

Aug 8 '07 #1
2 1878
ji************@gmail.com wrote:
hi all
I have a problem of linking static libraries with GC_MALLOC, I
have made my routine smaller to make it simpler. I m using fedora 7
kernel version 2.6.18-1.2798.fc6
Wrong group, try a Linux one.

--
Ian Collins.
Aug 8 '07 #2
Richard Tobin wrote:
<ji************@gmail.comwrote:
>/work/anonymous/svc/libsvcr/str.c:47: undefined reference to
`GC_realloc'

This is referring to a reference to GC_realloc in libsvcr. Your
own code doesn't use GC_realloc, it uses GC_REALLOC (unless
that's a macro referring to GC_realloc).
This doesn't exist in standard C, and is thus off-topic. I don't
know where you should go, but it's not here.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Aug 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sunil | last post by:
Hi, We have lot of c and fortran archive libraries that have complex dependencies. We have different server tasks that use some of these libraries. We have developed a tool inhouse that links...
14
by: m | last post by:
all, i am trying to use the function round() which I found through google to be declared in math.h ( http://www.gnu.org/software/libc/manual/html_node/Rounding-Functions.html). this function does...
2
by: Joerg M. Colberg | last post by:
I have a VS.Net solution that contains various projects. Some of the projects contain programme blocks (legacy code) that are used by some of the other projects. One project contains some C code...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
1
by: fsmountain | last post by:
Hi guys, I am trying to compile VTK5.0 with Qt GUI Support in Windows 2000 that has Qt Open-Sourced 4.1.2 and CMake 2.4.2 installed. After QVTK is enabled in CMake, configuring it will prompt...
6
by: John | last post by:
I have 5 native static libraries that are being compiled in Visual Studio 2005 with the /MDd C Runtime option. I have 2 CLR DLLs (all managed code) in Visual Studio 2005 and the /MDd C Runtime...
4
by: Richard | last post by:
First question - let's get this out of the way since it might be the solution to all my woes: Does it make sense to have a .cpp file for a class that is declared as having pure virtual functions...
0
by: zhenya.tkachenko | last post by:
Hi! Have a problem with mod_auth_mysql. Compilation and installation of module done ok: # /usr/local/apache/bin/apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz...
2
by: Manuel T | last post by:
Hello everybody, I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a Debian-like: Kubuntu), but I'm facing a lot of linking problems. This project needs libraries xerces...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.