• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Error when compiling with gcc 4.2.1 and linking with a static library build with older gcc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error when compiling with gcc 4.2.1 and linking with a static library build with older gcc


  • Subject: Error when compiling with gcc 4.2.1 and linking with a static library build with older gcc
  • From: Dieter Oberkofler <email@hidden>
  • Date: Fri, 25 Sep 2009 11:38:45 +0200

I'm having a hard time to migrate to the new Xcode 3.2 environment on Snow Leopard.

I have recompiled all of my sources with gcc 4.2.1 and when trying to link with a static library that must have been build with an older version of gcc I get some warnings and some "symbol(s) not found" errors.
Using a simple test case I get an error message as follows when linking:
-----
/Developer/usr/bin/g++-4.2 -c -x c++ -arch i386 -m32 -D_RWCONFIG=11s -I/MyDev/ljs_app/trunk/xvt/mac/include test.cpp
/Developer/usr/bin/g++-4.2 -arch i386 -m32 ./test.o /MyDev/ljs_app/trunk/xvt/mac/lib/libtls11s_mac.a -framework Carbon -o ./rw_app
Undefined symbols:
  "RWCString::assertElement(unsigned long) const", referenced from:
      RWCString::operator[](int)in test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
-----

When compiling my sources with gcc 4.0 there are no unresolved symbols so I assume it has something to do with the compatibility of gcc 4.2.1 with "older" (static) libraries.
I'm building a i386 and a ppc application and also explicitly using the -m32 option with the compiler and the link.

file on the static library returns:
libtls8s_mac.a: Mach-O universal binary with 2 architectures
libtls8s_mac.a (for architecture ppc): current ar archive
libtls8s_mac.a (for architecture i386): current ar archive

file on a test object I've build from source:
test.o: Mach-O object i386 for i386
test.o: Mach-O object ppc

I do not have the source for the (3rd party) static library so I'm kind of stuck with what I have and any help you be really appreciated.

Thank you,
-D 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Error when compiling with gcc 4.2.1 and linking with a static library build with older gcc
      • From: Dieter Oberkofler <email@hidden>
    • Re: Error when compiling with gcc 4.2.1 and linking with a static library build with older gcc
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Upgrading Xcode
  • Next by Date: conversion printf format to icu style format (maybe OT)
  • Previous by thread: Upgrading Xcode
  • Next by thread: Re: Error when compiling with gcc 4.2.1 and linking with a static library build with older gcc
  • Index(es):
    • Date
    • Thread