473,387 Members | 1,318 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,387 software developers and data experts.

Circular linking of libraries in C/C++

Hello,

I have following problem: I use a Qt GUI frontend where I use the QImage.load function which uses for jpeg the free libjpeg. In this application i link another shared library which also uses libjpeg. with this setup my application crashes with a segmentation fault in an libjpeg function. When i remove the dependency of the linked shared library to libjpeg the application is working. Thats why i am pretty shure that the "circular" linking to libjpeg is the problem. the usual header #ifndef XXX #define XXX #endif precompiler statements dont help. what should i do to solve the problem? this must be a standard problem because many libraries link to the same standard libs like libjpeg. is there a standard approach like the "#ifndef" for the compiler?

my Setup is gcc on Ubuntu/Linux
Aug 4 '10 #1
1 1490
I got it! I had two different libjpeg versions installed: 6.2 and 8. When linking to 8 ; which i had been built by myself and was installed in /usr/local/lib - the application crashed. The Reason why Qt has problems with libjpeg8 is not clear to me but the solution was to remove libjpeg8.
Aug 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: LinuxN00b | last post by:
Hey, I have a problem linking Xerces-c (Apache's XMLParser) with my program. Here is a copy of my makefile. # CXX is for GNU make, CCC is for Solaris make # Define the default compiler to...
1
by: Bernd Geiser | last post by:
Recently I tried the following: I created two libraries lib1.a and lib2.a. Both contain the object a.o which instantiates a class from b1.o (or b2.o respectively), where b1.o and b2.o have the...
1
by: paddy | last post by:
I keep digging through tut after tut and I find lots and lots of C++ logic, but I can't find any straight forward plain and simple info on the whole linking and library process. Can anyone...
2
by: Ian | last post by:
I've downloaded 3rd party libraries and I'm trying to link them in with my code but when I use -l<library name> it gives me the error "ld: cannot find -l<lib name>". When I link the libraries...
11
by: crash_zero | last post by:
Hi, I am writing a program and I have to use a library which my lecturer passed to me and I'm not sure how to link the libraries. My program name is module.c and my library is crack.a. It is...
7
by: barias | last post by:
Although circular dependencies are something developers should normally avoid, unfortunately they are very easy to create accidentally between classes in a VS project (i.e. circular compile-time...
2
by: jitender001001 | last post by:
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(...
1
by: pensive | last post by:
Hi! I was trying to create a library file for this i created two C codes, in two folders... and then build the file using gcc -fPIC -g -c -Wall d1.c and then gcc -shared...
6
by: idev | last post by:
Hi all, Please help me with my stuff. I downloaded python 2.5.1 package from http://blastwave.org it was compiled using Sun Studio 11 for Solaris 8 sparc. My system is Solaris 10 sparc and I...
1
by: CBFalconer | last post by:
kooladi wrote: Yes. The first module that satisfies a function load request will normally resolve that function forever. This sequence is normally needed to make libraries flexible, but is not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.