• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • drawtiming
  • Patches

Link failure when --as-needed is passed to gcc

Status: Beta
Brought to you by: ecounce, ultim
  • Summary
  • Files
  • Reviews
  • Support
  • Tickets ▾
    • Bugs
    • Patches
    • Feature Requests
  • News
  • Code
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#11 Link failure when --as-needed is passed to gcc

open
nobody
None
5
2010-12-14
2010-12-14
Ahmed El-Mahmoudy
No

g++ -I/usr/include/GraphicsMagick -DYYDEBUG=1 -g -O2 -Wl,-Bsymbolic-functions -o drawtiming -lGraphicsMagick++ -lGraphicsMagick main.o parser.o scanner.o timing.o
main.o: In function `main':
/build/buildd/drawtiming-0.7.1/src/main.cc:101: undefined reference to `Magick::InitializeMagick(char const*)'
/build/buildd/drawtiming-0.7.1/src/main.cc:213: undefined reference to `Magick::Color::Color(char const*)'
[...]

Turns out that the problem is that the object files should be before the linked libraries. Please find the fix in the attached patch.

Discussion

  • Ahmed El-Mahmoudy

    Ahmed El-Mahmoudy - 2010-12-14
     
    switch_LDFLAGS_LDADD.diff
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    225 Broadway Suite 1600
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2025 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.