ld: symbols not found for architecture x86_64

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
gates
In need of some credit
In need of some credit
Posts: 3
Joined: Sat Jun 02, 2018 4:11 am

ld: symbols not found for architecture x86_64

Post by gates »

Hi , am building adaptit app for osx 10.13.4 using wxWidgets-3.0.4 and keep hitting this error in where libtool: link fails in this file :-
wxDocument::LoadObject(std::__1::basic_istream<char, std::__1::char_traits<char> >&)", referenced from:
vtable for CAdapt_ItDoc in Adapt_ItDoc.o

when I compiled and linked this whole source set with xcode 9.3 ( april 20th ) it was a straight clean build. Now, updating to xcode 9.4
I have tried , new autogen/aclocal/automake updates, extra g++ flags.

This leads me to ask , just how do I compile wxWidgets-3.0.4 on macosx using osx-cocoa and xcode 9.4 ?

Note: wxWidgets-3.0.4/3.1.1 builds happily on linux mint 18.3 with no change to the source and the source app adaptit runs fine.

Any help is much appreciated. :D
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: ld: symbols not found for architecture x86_64

Post by eranon »

Hello, You should show the exact build output and embed it in a

Code: Select all

 block. This said, if your own project doesn't find a wxWidgets symbol for the x86_64 architecture, it's maybe because you didn't build the 64-bit flavor of wxWidgets. I don't use nor know Xcode (I'm building from command line or Code::Blocks in OS X), but what's the issued build's command line (I mean the one generated by Xcode when you built wxWidgets)?
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: ld: symbols not found for architecture x86_64

Post by ONEEYEMAN »

Hi,
Also, can you post complete configure command you used?

Thank you.
gates
In need of some credit
In need of some credit
Posts: 3
Joined: Sat Jun 02, 2018 4:11 am

Re: ld: symbols not found for architecture x86_64

Post by gates »

Hi ,

The build call is :- ../configure --enable-debug && make ( from the build_cocoa_debug directory I use )
The complete build is done from the commandline on osx 10.13 and I am using the commanline tools
not the xcode ide.
The wxWidgets builds ok but I find I have to hard code the wx-config setting in the 'configure' file then the
output shows that wx-config has been located and confirms '3.0.4' ... I would have thought the incorrect
architecture ( 32/64 bit ) would have been detected long before this point.

As far as the wxWidgets-3.0.4 source is concerned , is there a 64 bit version? your download page dosen't seem
to mention one ... happy to try that if there is one .

regards,
gates
In need of some credit
In need of some credit
Posts: 3
Joined: Sat Jun 02, 2018 4:11 am

Re: ld: symbols not found for architecture x86_64

Post by gates »

Hi Sir,

I forgot to mention that while there was a clean compile April 20th for wxWidgets-3.0.4, it fails with tr1/types_traits : file not found in
strvararg.h line 30... I got around this by adding this code snippet just before that line ...I found on the net :-

#include <ciso646> // detect std::lib
#ifdef _LIBCPP_VERSION
// using libc++
#ifndef HAVE_TYPE_TRAITS
#define HAVE_TYPE_TRAITS 1
#endif
#else
// using libstdc++
#ifndef HAVE_TR1_TYPE_TRAITS
#define HAVE_TR1_TYPE_TRAITS 1
#endif
#endif

and commenting out the original lines at line 30 to remove the HAVE_TR1_TYPE_TRAITS flag.

I downloaded wx version 2.9.4 having read the notes on compiling for OSX to see if I can get the app to build against this version.

regards,
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: ld: symbols not found for architecture x86_64

Post by ONEEYEMAN »

Hi,
Lets start from the end.
The "type_traits" error you saw has been fixed in Git HEAD but I guess was not backported to 3.0 branch (yet?).
You can check the commit log for the master branch of the library on how to properly fix that error.
Or you can try to build the 3.1 release of the library - everything is backward compatible.

Now about your first issue.
I'd suggest to add "--with-cocoa --macosx_version_min=10.8" to you configure options. First of all Cocoa is only 64-bit API and second, in 3.0.4 its possible that the default is Carbon which is 32/64 one. Or maybe it just defaults to the earlier OSX SDK which does support 32 bit by default.

Delete the build directory, recreate it configure and build the library and then rebuild you application.

Let us know if that fix the issue.

If not please post any errors you encounter.

Thank you.
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: ld: symbols not found for architecture x86_64

Post by eranon »

Hello, Don't know for your error on macOS 10.13 since I only build in OS X 10.9. About the architecture, you can build both 32-bit and 64-bit flavors of wxWidgets 3.0. For this, you have to indicate the architecture you want in the --enable-macosx_arch option. It can be --enable-macosx_arch=i386 or --enable-macosx_arch=x86_64 if you install them in different locations (ie. using prefix). If you want a single build containing both architectures (ie. fat or universal binaries), you have to indicate both at the same time.

EDIT : And to check the architecture(s) of your libs afterward, you can use "lipo -info <path-to-lib>"
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply