Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Undefined symbols for architecture x86_64

One_C_
Beginner
1,032 Views

Hi,

I am compiling an old project with Composer X 2013 U1 on a Mac. It compiles and links fine but I am compiling on Mac OS X 10.7 and I would like the app to be compatible with Mac OS X 10.6 too. So I add this argument: -mmacosx-version-min=10.6 When I do it, the linkier fails:

Undefined symbols for architecture x86_64: "_main", referenced from: start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64

I guess I will have to add some special library to the linker?

0 Kudos
5 Replies
Feilong_H_Intel
Employee
1,032 Views

Hi,

I can't reproduce the error on my OS X 10.7.  See below.  Could you please provide more details, including a simple test case and command line?

$ icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.0.1.119 Build 20121010
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

$ icc a.c -mmacosx-version-min=10.6
$ icc a.c

Thank you.
--
Feilong H.
Intel Developer Support

Tools Knowledge Base:  http://software.intel.com/en-us/articles/tools

0 Kudos
Feilong_H_Intel
Employee
1,032 Views

BTW, my OS X version is 

$ sw_vers -productVersion
10.7.5

0 Kudos
One_C_
Beginner
1,032 Views

Hi,

When I run the following, it works fine:

icc  -I../../include  -O0 -fmath-errno -fp-model precise -fno-omit-frame-pointer -g -fPIC -fvisibility=hidden -pthread -openmp -mmacosx-version-min=10.6 -DFL_LTL_ENDIAN -DFL_MACI64 -o /.............../myfile.o -c myfile.c

But I get the error when I run this:

icc -dynamiclib -framework Foundation -mmacosx-version-min=10.6 -L/..................  -fmath-errno -fp-model precise -g -fPIC -fvisibility=hidden -fno-omit-frame-pointer -pthread -openmp -o /......./libmyfile.dylib  /......./myfile.o

When I run sw_vers -productVersion I get 10.7.5 and when I run icc -V I get Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.0.1.119 Build 20121010 so it seems that we have same versions.

0 Kudos
Feilong_H_Intel
Employee
1,032 Views

Thanks for the command lines.  Unfortunately, I still failed to reproduce the error with a simple file.  Could you please upload a small test case?

$ icc -O0 -fmath-errno -fp-model precise -fno-omit-frame-pointer -g -fPIC -fvisibility=hidden -pthread -openmp -mmacosx-version-min=10.6 -c a.c
$ icc -dynamiclib -framework Foundation -mmacosx-version-min=10.6 -fmath-errno -fp-model precise -g -fPIC -fvisibility=hidden -fno-omit-frame-pointer -pthread -openmp -o a.dylib a.o
$

0 Kudos
SergeyKostrov
Valued Contributor II
1,032 Views
>>...I guess I will have to add some special library to the linker? Take a look at TBB library make files for a complete list of libraries used in case of x86_64 platform(s). As far as I know there are No any issues with compiling TBB library for these platforms.
0 Kudos
Reply