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

Linking error: file is not of required architecture

regis_vincent
Beginner
435 Views
I'm trying to compile a project using icpc v.11 for Mac OS X. I should mention that using gcc 4.2 this project compiles fine. When I change g++ by icpc I'm getting this cryptic same error:
ipo: warning #11009: file format not recognized for /opt/local/lib/libpng.dylib
ld warning: in ~/Intel/Darwin/mkl/current/lib/32/libmkl_intel.a, file is not of required architecture
ld warning: in ~/Intel/Darwin/mkl/current/lib/32/libmkl_intel_thread.a, file is not of required architecture
ld warning: in ~/Intel/Darwin/mkl/current/lib/32/libmkl_core.a, file is not of required architecture
ld warning: in ~/Xerces/Darwin/32/current/lib/libxerces-c.a, file is not of required architecture
ld warning: in /opt/local/lib/libpng.dylib, file is not of required architecture
Undefined symbols:
all undefined symbols from these libraries ....

The linking command is:
/usr/bin/icpc -dynamiclib -headerpad_max_install_names -o ../../lib/libmylib.dylib -install_name /usr/local/lib/libmylib.dylib CMakeFiles/mylib/*.o -L/opt/local/lib ~/Intel/Darwin/mkl/current/lib/32/libmkl_intel.a ~/Intel/Darwin/mkl/current/lib/32/libmkl_intel_thread.a ~/Intel/Darwin/mkl/current/lib/32/libmkl_core.a ~/Intel/Darwin/mkl/current/lib/32/libguide.a ~/Intel/Darwin/ipp/current/ia32/lib/libippcvemerged.a ~/Intel/Darwin/ipp/current/ia32/lib/libippiemerged.a ~/Intel/Darwin/ipp/current/ia32/lib/libippcvmerged_t.a ~/Intel/Darwin/ipp/current/ia32/lib/libippimerged_t.a ~/Intel/Darwin/ipp/current/ia32/lib/libippvcmerged_t.a ~/Intel/Darwin/ipp/current/ia32/lib/libippcore_t.a -framework CoreServices ~/Xerces/Darwin/32/current/lib/libxerces-c.a -lpng

Any help ?
0 Kudos
2 Replies
TimP
Honored Contributor III
435 Views
What does icpc -V say? file /opt/local/lib/libpng.dylib? e.g. have you mixed 64-bit compilation with the 32-bit libraries?
0 Kudos
regis_vincent
Beginner
435 Views
Quoting - tim18
What does icpc -V say? file /opt/local/lib/libpng.dylib? e.g. have you mixed 64-bit compilation with the 32-bit libraries?
icpc -V
Intel C++ Compiler Professional for applications running on Intel 64, Version 11.0 Build 20081105 Package ID: m_cproc_p_11.0.056
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.

you are completely right, I assume icpc was compiling for ia-32 not 64-bit version ?

Using the right version, solved my issue.

Thanks
0 Kudos
Reply