I've downloaded the latest release of libzip and am currently trying to build it on OSX and failing:
Linking C shared library libzip.dylib
Undefined symbols for architecture x86_64:
"_crc32", referenced from:
__zip_filerange_crc in zip_filerange_crc.o
_crc_read in zip_source_crc.o
_decrypt in zip_source_pkware.o
__zip_string_crc32 in zip_string.o
(maybe you meant: __zip_string_crc32)
"_deflate", referenced from:
_compress_read in zip_source_deflate.o
(maybe you meant: _zip_source_deflate)
"_deflateEnd", referenced from:
_deflate_compress in zip_source_deflate.o
"_deflateInit2_", referenced from:
_deflate_compress in zip_source_deflate.o
"_inflate", referenced from:
_decompress_read in zip_source_deflate.o
"_inflateEnd", referenced from:
_deflate_decompress in zip_source_deflate.o
"_inflateInit2_", referenced from:
_deflate_decompress in zip_source_deflate.o
"_zError", referenced from:
__zip_error_strerror in zip_error_strerror.o
_zip_error_to_str in zip_error_to_str.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libzip.3.0.dylib] Error 1
make[2]: *** [CMakeFiles/zip.dir/all] Error 2
make[1]: *** [CMakeFiles/zip.dir/rule] Error 2
make: *** [zip] Error 2
It needs a crc32 function but it doesn't include one nor does it seem to link to anything else. Has anyone been able to build libzip on OSX 10.9?
You seem to be missing to link a against libz.
Get the developer files for zlib somewhere and add -lz to the (end of the command line of the) link command.
Related
I am trying to install and run OpenMPI on VSCode using this tutorial https://medium.com/#li.nguyen_15905/setting-up-vscode-for-mpi-programming-b6665da6b4ad
When I "Run build task" to compile the Hello.c file I receive this error:
(`Executing task: C/C++: mpicc build active file <
Starting build...
/Users/mohamad/opt/usr/local/bin/mpicc -g /Users/mohamad/opt/usr/local/bin/helloworld/.vscode/hello.c -o /Users/mohamad/opt/usr/local/bin/helloworld/.vscode/hello
ld: warning: ignoring file /Users/mohamad/opt/usr/local/lib/libmpi.dylib, **building for macOS-x86_64 but attempting to link with file built for macOS-arm64**
Undefined symbols for architecture x86_64:
"_MPI_Comm_rank", referenced from:
_main in hello-c829ad.o
"_MPI_Comm_size", referenced from:
_main in hello-c829ad.o
"_MPI_Finalize", referenced from:
_main in hello-c829ad.o
"_MPI_Get_processor_name", referenced from:
_main in hello-c829ad.o
"_MPI_Init", referenced from:
_main in hello-c829ad.o
"_ompi_mpi_comm_world", referenced from:
_main in hello-c829ad.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build finished with error(s).
The terminal process failed to launch (exit code: -1).`)
Running the command mpirun -np 2 hello gives:
mpirun was unable to find the specified executable file, and therefore
did not launch the job. This error was first reported for process
rank 0; it may have occurred for other processes as well.
NOTE: A common cause for this error is misspelling a mpirun command
line parameter option (remember that mpirun interprets the first
unrecognized command line token as the executable).
Node: Mohamads-MBP
Executable: hello
--------------------------------------------------------------------------
2 total processes failed to start
Any suggestions that could resolve this issue?
Note: All configuration settings used are included in the link.
I keep getting this error after I try to build on ios :
Undefined symbols for architecture arm64:
"_kCFStreamSSLPeerName", referenced from:
-[ca_weblite_codename1_net_impl_NativeSocketImpl createSocket:param1:] in ca_weblite_codename1_net_impl_NativeSocketImpl.o
"_kCFStreamSSLValidatesCertificateChain", referenced from:
-[ca_weblite_codename1_net_impl_NativeSocketImpl createSocket:param1:] in ca_weblite_codename1_net_impl_NativeSocketImpl.o
"_kCFStreamSSLLevel", referenced from:
-[ca_weblite_codename1_net_impl_NativeSocketImpl createSocket:param1:] in ca_weblite_codename1_net_impl_NativeSocketImpl.o
"_kCFStreamPropertySSLSettings", referenced from:
-[ca_weblite_codename1_net_impl_NativeSocketImpl createSocket:param1:] in ca_weblite_codename1_net_impl_NativeSocketImpl.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** ARCHIVE FAILED **
The following build commands failed:
Ld /var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build9106977163875219348xxx/dist/build/Build/Intermediates.noindex/ArchiveIntermediates/Main/InstallationBuildProductsLocation/Applications/Main.app/Main normal arm64
(1 failure)
Process return code is 65
Failed xcodebuild step
The problem is as follows.
I am trying to add two simple .obj files to my project. I have added a header file and I can see that obj is valid as Ttime structure, which is a part of obj is working. However, whenever I try to execute any function I get this error:
Undefined symbols for architecture x86_64:
"_printRES", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error Screenshot
I am trying to use the code Nauty and Traces http://pallini.di.uniroma1.it/. But when I complied an example, say nautyex8.c (provided by the package), the following error showed up:
Undefined symbols for architecture x86_64:
"_alloc_error", referenced from:
_main in nautyex8-54d9da.o
"_densenauty", referenced from:
_main in nautyex8-54d9da.o
"_dispatch_graph", referenced from:
_main.options in nautyex8-54d9da.o
"_nauty_check", referenced from:
_main in nautyex8-54d9da.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using Mac OS X Yosemite (10.10.5) and Xcode (version 7.1). I believe that there is no error in the codes because they are widely used so I guess the problem comes from my system settings.
Thank you so much!
I've just opened a pull request to make brew install nauty work on OS X: https://github.com/Homebrew/homebrew-core/pull/48701
Until then, here's how you would build nautyex8.c on OS X, as of Nauty/Traces 2.6r12.
Step 1 is to download the code and build the library:
wget http://pallini.di.uniroma1.it/nauty26r12.tar.gz
tar zxvf nauty26r12.tar.gz
cd nauty26r12
./configure
make
ls -l nauty.a
Step 2 is to compile nautyex8.c and link it against the library you just built:
gcc -O3 nautyex8.c nauty.a
./a.out
You probably forgot to put that "nauty.a" at the end of your compiler command line. If I do that too, I get:
gcc -O3 nautyex8.c
Undefined symbols for architecture x86_64:
"_alloc_error", referenced from:
_main in nautyex8-05f086.o
"_densenauty", referenced from:
_main in nautyex8-05f086.o
"_dispatch_graph", referenced from:
_main.options in nautyex8-05f086.o
"_nauty_check", referenced from:
_main in nautyex8-05f086.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
which exactly matches the symptom you described.
Probably a noob question but I can't find an answer to this. I've downloaded and installed Gstreamer for Mac from http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-init.html
I copied the code for example 4.1, to initialize GStreamer, from
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-init.html into a file called eg41.c
and used the terminal command gcc eg41.c -I/Library/Frameworks/GStreamer.framework/Headers
. The output was:
Undefined symbols for architecture x86_64:
"_gst_init", referenced from: _main in eg41-9814a5.o
"_gst_version", referenced from: _main in eg41-9814a5.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas?