?
Solved

Using libAfter

Posted on 2003-02-20
11
Medium Priority
?
239 Views
Last Modified: 2010-04-22
Hi,

I'm trying to do some image manipulation in an app I'm writing in C. I compiled and installed libAfter-0.92 with default configuration (static libraries).

When I try to compile my code (gcc 3.2), with:

gcc -lAfterBase -lAfterImage main.c -o test
or
gcc -L/usr/local/lib -lAfterBase -lAfterImage main.c -o test
or
gcc -L/usr/local/lib -lAfterBase -lAfterImage --static main.c -o test
(doesn't seem to matter)

I get a "/tmp/blabla.o: undefined reference to *function name*" for every function that's supposed to be in the libAfter libraries.

I also #include'ed libAfterImage/afterimage.h and libAfterImage/afterbase.h
0
Comment
Question by:herr_apfelschnitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 8

Expert Comment

by:akshayxx
ID: 7991678
gcc main.c -o test
 -L/usr/local/lib -lAfterBase -lAfterImage
the libraries to be linked should be specified at the end
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 7991680
u'll also have to provide the include path.. where are ur include header files lying
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7993736
does following return an entry with  T

  nm -gop /usr/local/lib/libAfterBase*|grep "function name"
0
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 
LVL 1

Author Comment

by:herr_apfelschnitt
ID: 7998284
Lol. Kind of a pretty dumb mistake. It works fine now. (had to link some more libraries though)
0
 
LVL 1

Author Comment

by:herr_apfelschnitt
ID: 7998292
Still wondering why gcc won't give an error message otherwise...
0
 
LVL 5

Expert Comment

by:bryanh
ID: 8000663
>Still wondering why gcc won't give an error message
>otherwise...

Other than what?  It looks to me like Gcc does give an error message when you don't link in the required libraries.
0
 
LVL 1

Author Comment

by:herr_apfelschnitt
ID: 8002454
Yes, but why it doesn't give an error message when you give the arguments in the wrong order.
0
 
LVL 5

Expert Comment

by:bryanh
ID: 8003678
There's nothing in this question about arguments being in the wrong order.  Can you give an example of giving arguments in the wrong order and not getting an error message?
0
 
LVL 1

Author Comment

by:herr_apfelschnitt
ID: 8004455
Check my question: If I supply the libraries to be linked before the name of the source file I want to compile, it doesn't seem to link the libraries at all. However, gcc doesn't give a specific error message about the arguments, it just tells me it can't find those functions.
0
 
LVL 8

Accepted Solution

by:
akshayxx earned 600 total points
ID: 8005445
once i also observed similar behaviour ..
if u wish follow up the following discussion
http://www.experts-exchange.com/Programming/Programming_Languages/C/Q_20393213.html
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 8005450
though my case was weird enough that .. same compilation command worked on gcc on aix .. but didnt work with my gcc on linux..
i dont remember exactly if i had same versions of gcc on both.. because sometime around that  i upgraded one of my gcc
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question