I am working on providing PhoneGap functionality in a UIWebView in MonoTouch. I have tested the functionality in Objective C and the static library works correctly there. However, when I try and link the PhoneGap static library into my MonoTouch application I get a long list of undefined symbols.
I have included all the header files for the PhoneGap library and I have also ensured that 'Compile for thumb' is unchecked when compiling the PhoneGap library. So I am not sure what I am missing and the error messages don't mean much to me. I will quote them here (it is a LONG list!), but hopefully someone here can enlighten me to what the linker is trying to tell me!
Here is the long list...
Undefined symbols:
"_ABPersonSetImageData", referenced from:
-[Contact setFromContactDict:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonAddressStateKey", referenced from:
_kABPersonAddressStateKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonAddressStateKey$non_lazy_ptr)
"_kABPersonPhoneHomeFAXLabel", referenced from:
_kABPersonPhoneHomeFAXLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonPhoneHomeFAXLabel$non_lazy_ptr)
"_kABPersonEmailProperty", referenced from:
_kABPersonEmailProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonEmailProperty$non_lazy_ptr)
"_kABPersonNoteProperty", referenced from:
_kABPersonNoteProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonNoteProperty$non_lazy_ptr)
"_kABWorkLabel", referenced from:
_kABWorkLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABWorkLabel$non_lazy_ptr)
"_kCLLocationAccuracyThreeKilometers", referenced from:
_kCLLocationAccuracyThreeKilometers$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kCLLocationAccuracyThreeKilometers$non_lazy_ptr)
"_OBJC_CLASS_$_CLLocationManager", referenced from:
objc-class-ref-to-CLLocationManager in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonInstantMessageServiceICQ", referenced from:
_kABPersonInstantMessageServiceICQ$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonInstantMessageServiceICQ$non_lazy_ptr)
"_kABPersonInstantMessageServiceMSN", referenced from:
_kABPersonInstantMessageServiceMSN$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonInstantMessageServiceMSN$non_lazy_ptr)
"_kABPersonInstantMessageServiceKey", referenced from:
_kABPersonInstantMessageServiceKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonInstantMessageServiceKey$non_lazy_ptr)
"_kCLLocationAccuracyNearestTenMeters", referenced from:
_kCLLocationAccuracyNearestTenMeters$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kCLLocationAccuracyNearestTenMeters$non_lazy_ptr)
"_kCLLocationAccuracyKilometer", referenced from:
_kCLLocationAccuracyKilometer$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kCLLocationAccuracyKilometer$non_lazy_ptr)
"_UTTypeCopyPreferredTagWithClass", referenced from:
-[File getMimeTypeFromPath:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABPersonCreate", referenced from:
-[Contact init] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
-[File getMimeTypeFromPath:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonPhoneProperty", referenced from:
_kABPersonPhoneProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonPhoneProperty$non_lazy_ptr)
"_kABPersonInstantMessageUsernameKey", referenced from:
_kABPersonInstantMessageUsernameKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonInstantMessageUsernameKey$non_lazy_ptr)
"_kABOtherLabel", referenced from:
_kABOtherLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABOtherLabel$non_lazy_ptr)
"_kABPersonBirthdayProperty", referenced from:
_kABPersonBirthdayProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonBirthdayProperty$non_lazy_ptr)
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
_MPMoviePlayerPlaybackDidFinishNotification$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _MPMoviePlayerPlaybackDidFinishNotification$non_lazy_ptr)
"_ABMultiValueRemoveValueAndLabelAtIndex", referenced from:
-[Contact setMultiValueStrings:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contact setMultiValueDictionary:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABRecordRemoveValue", referenced from:
-[Contact removeProperty:inRecord:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABAddressBookCreate", referenced from:
-[Contacts newContact:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contacts displayContact:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contacts search:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contacts save:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contacts remove:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABMultiValueCopyValueAtIndex", referenced from:
-[Contact setMultiValueStrings:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contact setMultiValueDictionary:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contact extractMultiValue:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contact extractAddresses] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contact extractIms] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
objc-class-ref-to-AVAudioPlayer in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABHomeLabel", referenced from:
_kABHomeLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABHomeLabel$non_lazy_ptr)
"_kABPersonInstantMessageProperty", referenced from:
_kABPersonInstantMessageProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonInstantMessageProperty$non_lazy_ptr)
"_kABPersonAddressZIPKey", referenced from:
_kABPersonAddressZIPKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonAddressZIPKey$non_lazy_ptr)
"_ABPersonRemoveImageData", referenced from:
-[Contact setFromContactDict:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
-[Contact setFromContactDict:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonAddressProperty", referenced from:
_kABPersonAddressProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonAddressProperty$non_lazy_ptr)
"_OBJC_CLASS_$_MPMoviePlayerController", referenced from:
objc-class-ref-to-MPMoviePlayerController in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonInstantMessageServiceYahoo", referenced from:
_kABPersonInstantMessageServiceYahoo$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
(maybe you meant: _kABPersonInstantMessageServiceYahoo$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
Process exited with code 1
Hope this makes sense to someone here, because it is greek to me! ;)
Thanks
I found the problem; I was missing several framework entries that were required by the PhoneGap library. Specifically, these framework entries needed to be added to the gcc_flags:
-framework corelocation
-framework mediaplayer
-framework messageui
-framework mobilecoreservices
-framework quartzcore
-framework systemconfiguration
-framework audiotoolbox
-framework avfoundation
-framework addressbook
-framework foundation
-framework coregraphics
-framework addressbookui
Related
I am currently Solana through a tutorial. After creating the project, adding dependencies and writing my program, I am supposed to run the following command to create a build of my Rust code that is suitable to deploy to Solana
cargo build-bpf --manifest-path=Cargo.toml --bpf-out-dir=dist/program
Upon running this command I get this error:
error: linking with `\\?\C:\Users\Andrew\.local\share\solana\install\releases\1.9.6\solana-release\bin\sdk\bpf\dependencies\bpf-tools\llvm\bin\ld.lld` failed: exit code: 1
|
= note: "\\\\?\\C:\\Users\\Andrew\\.local\\share\\solana\\install\\releases\\1.9.6\\solana-release\\bin\\sdk\\bpf\\dependencies\\bpf-tools\\llvm\\bin\\ld.lld" "--version-script=C:\\Users\\Andrew\\AppData\\Local\\Temp\\rustcfP4dWA\\list" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.1.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.10.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.11.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.12.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.13.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.14.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.15.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.2.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.3.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.4.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.5.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.6.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.7.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.8.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.9.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.uld0kociqtl6etw.rcgu.o" "--as-needed" "-L" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps" "-L" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\release\\deps" "-L" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib" "-Bstatic" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsolana_program-b2b13310817f5248.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libserde_bytes-aef9648808d9c831.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblake3-9c296c099c94bc54.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libconstant_time_eq-5c8fe6fb88b82dcc.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libarrayvec-5f41e504062ba5bd.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libdigest-9f0b3cc7612e1076.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsubtle-a1562280b43e07dc.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblock_buffer-a147e55a99bb097c.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libcrypto_common-b64c25475c677681.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libarrayref-62e325660dcbcdad.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsolana_frozen_abi-39b4f96965d78918.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbs58-4ba0e4b26a8bc639.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbv-bb7083cc9f8ca62c.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbytemuck-9d74d8b3a4e69402.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\liblazy_static-40cf5ca4fb226fc4.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsha3-bbd73384f96d675f.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libkeccak-2002a05ba274f01b.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsha2-a86070b99a0022c7.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libopaque_debug-2cfb1a43922e8fa5.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libdigest-ea1685ff6f232064.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblock_buffer-167db070cc2bcdb1.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblock_padding-aae0a410e0661616.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libgeneric_array-a6d784931f2d5898.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libtypenum-5b6a5cc6c27f3e89.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\liblog-c21ec511aa92c880.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libcfg_if-ff438ac9b30946a3.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libnum_traits-de22efb352be6c17.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbincode-3947f1bf19062b27.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libserde-04054e8a9cafe1ca.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libthiserror-10d222c05f59092d.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libborsh-4c2a80a409a40648.rlib" "--start-group" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libstd-09f30ec6d9bcf4bb.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libpanic_abort-0129f2b71ae47d8c.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libstd_detect-291be22324585073.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libhashbrown-b89a97989cce08e1.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\librustc_std_workspace_alloc-0d0f29f2be0139d5.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libunwind-43e4d5094e6a98d9.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libcfg_if-f7de57aa039b1991.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\liblibc-f568e648f8426533.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\liballoc-ca33e91228706d40.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\librustc_std_workspace_core-2e1fdcf37081a104.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libcore-38e5758490a5e05e.rlib" "--end-group" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libcompiler_builtins-98c1293c09977ba1.rlib" "-Bdynamic" "--script" "C:\\Users\\Andrew\\AppData\\Local\\Temp\\rustcfP4dWA\\rustc-bpfel-linkfile.ld" "-znoexecstack" "-L" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib" "-o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.so" "--gc-sections" "-shared" "--entry=entrypoint" "-O1"
= note: ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_1 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(borsh::de::BorshDeserialize::try_from_slice::h47523afb23741a51)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_2 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_3 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_4 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol abort; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_5 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_5 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_6 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_7 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_8 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_9 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol abort; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_5 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_10 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_11 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_12 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol abort; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_13 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol sol_log_; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_14 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
error: could not compile `crowd_funding` due to previous error
My current Solana version is version 1.9.6 and my current rustc version is 1.58.1.
My Cargo.toml file:
[package]
name = "crowd_funding"
version = "0.1.0"
edition = "2021"
[dependencies]
solana-program = "1.7.14"
borsh = "0.9.1"
borsh-derive = "0.9.1"
[features]
no-entrypoint = []
[dev-dependencies]
solana-program-test = "1.7.14"
solana-sdk = "1.7.14"
[lib]
crate-type = ["cdylib", "lib"]
Xargo.toml file:
[target.bpfel-unknown-unknown.dependencies.std]
features = []
Please what can I do to rectify this problem?
I solved the error. /you can't build solana program on a windows environnement.
You need to use a WSL ubuntu subsystem.
First the error messages:
$ stack build
Linking /Users/yuzhao/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.4 ...
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
_hs_iconv in libHSbase-4.11.1.0.a(iconv.o)
(maybe you meant: _base_GHCziIOziEncodingziIconv_iconvEncoding13_info, _base_GHCziIOziEncodingziIconv_iconvEncoding1_info , _base_GHCziIOziEncodingziIconv_iconvEncoding3_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding4_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding7_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding4_info , _base_GHCziIOziEncodingziIconv_iconvEncoding7_info , _base_GHCziIOziEncodingziIconv_iconvEncoding6_info , _base_GHCziIOziEncodingziIconv_iconvEncoding5_closure , _hs_iconv_open , _base_GHCziIOziEncodingziIconv_iconvEncoding9_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding15_info , _base_GHCziIOziEncodingziIconv_iconvEncoding_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding14_bytes , _hs_iconv_close , _base_GHCziIOziEncodingziIconv_iconvEncoding12_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding12_info , _base_GHCziIOziEncodingziIconv_iconvEncoding2_info , _base_GHCziIOziEncodingziIconv_iconvEncoding11_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding2_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding6_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding9_info , _base_GHCziIOziEncodingziIconv_iconvEncoding15_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding_info , _base_GHCziIOziEncodingziIconv_iconvEncoding8_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding8_info , _base_GHCziIOziEncodingziIconv_iconvEncoding13_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding10_bytes , _base_GHCziIOziEncodingziIconv_iconvEncoding1_closure , _hs_iconv , _base_GHCziIOziEncodingziIconv_iconvEncoding11_info )
"_iconv_open", referenced from:
_hs_iconv_open in libHSbase-4.11.1.0.a(iconv.o)
(maybe you meant: _hs_iconv_open)
"_iconv_close", referenced from:
_hs_iconv_close in libHSbase-4.11.1.0.a(iconv.o)
(maybe you meant: _hs_iconv_close)
"_locale_charset", referenced from:
_localeEncoding in libHSbase-4.11.1.0.a(PrelIOUtils.o)
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
-- While building simple Setup.hs using:
/Users/yuzhao/.nix-profile/bin/ghc -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.2.0.1 /Users/yuzhao/.stack/setup-exe-src/setup-mPHDZzAJ.hs /Users/yuzhao/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -o /Users/yuzhao/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.4
Process exited with code: ExitFailure 1
I am using nix and I've found many other solutions to this error messages using Homebrew, not nix.
Also, according to stack docs, stack setup give me the same error messages.
Any ideas how to fix this?
I am trying to run stack build and get the following errors:
bartosz $ stack setup
The GHC located at /Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/bin/ghc failed to compile a sanity check. Please see:
http://docs.haskellstack.org/en/stable/install_and_upgrade/
for more information. Exception was:
Received ExitFailure 1 when running
Raw command: /Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/bin/ghc /private/var/folders/rj/vrrtj8094qb8gf4ky_r_mxq80000gn/T/stack-sanity-check4255/Main.hs -no-user-package-db
Run from: /private/var/folders/rj/vrrtj8094qb8gf4ky_r_mxq80000gn/T/stack-sanity-check4255/
Standard output:
[1 of 1] Compiling Main ( /private/var/folders/rj/vrrtj8094qb8gf4ky_r_mxq80000gn/T/stack-sanity-check4255/Main.hs, /private/var/folders/rj/vrrtj8094qb8gf4ky_r_mxq80000gn/T/stack-sanity-check4255/Main.o )
Linking /private/var/folders/rj/vrrtj8094qb8gf4ky_r_mxq80000gn/T/stack-sanity-check4255/Main ...
Standard error:
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
_hs_iconv in libHSbase-4.11.1.0.a(iconv.o)
(maybe you meant: _base_GHCziIOziEncodingziIconv_iconvEncoding1_closure, _base_GHCziIOziEncodingziIconv_iconvEncoding1_info , _base_GHCziIOziEncodingziIconv_iconvEncoding4_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding15_info , _base_GHCziIOziEncodingziIconv_iconvEncoding4_info , _base_GHCziIOziEncodingziIconv_iconvEncoding7_info , _base_GHCziIOziEncodingziIconv_iconvEncoding6_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding6_info , _base_GHCziIOziEncodingziIconv_iconvEncoding8_info , _hs_iconv_open , _base_GHCziIOziEncodingziIconv_iconvEncoding12_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding9_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding9_info , _base_GHCziIOziEncodingziIconv_iconvEncoding12_info , _base_GHCziIOziEncodingziIconv_iconvEncoding13_info , _base_GHCziIOziEncodingziIconv_iconvEncoding11_info , _base_GHCziIOziEncodingziIconv_iconvEncoding_info , _base_GHCziIOziEncodingziIconv_iconvEncoding7_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding13_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding2_info , _base_GHCziIOziEncodingziIconv_iconvEncoding11_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding14_bytes , _base_GHCziIOziEncodingziIconv_iconvEncoding15_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding2_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding3_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding8_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding10_bytes , _hs_iconv_close , _hs_iconv , _base_GHCziIOziEncodingziIconv_iconvEncoding5_closure )
"_iconv_open", referenced from:
_hs_iconv_open in libHSbase-4.11.1.0.a(iconv.o)
(maybe you meant: _hs_iconv_open)
"_iconv_close", referenced from:
_hs_iconv_close in libHSbase-4.11.1.0.a(iconv.o)
(maybe you meant: _hs_iconv_close)
"_locale_charset", referenced from:
_localeEncoding in libHSbase-4.11.1.0.a(PrelIOUtils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
Here is the output from stack path:
stack-root: /Users/evanzamir/.stack
project-root: /Users/evanzamir/Code/Haskell/bartosz
config-location: /Users/evanzamir/Code/Haskell/bartosz/stack.yaml
bin-path: /Users/evanzamir/.stack/snapshots/x86_64-osx/lts-12.17/8.4.4/bin:/Users/evanzamir/.stack/compiler-tools/x86_64-osx/ghc-8.4.4/bin:/Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin/stack:/usr/local/smlnj-110.77/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/evanzamir/.rvm/gems/ruby-1.9.3-p327/bin:/Users/evanzamir/.rvm/gems/ruby-1.9.3-p327#global/bin:/Users/evanzamir/.rvm/rubies/ruby-1.9.3-p327/bin:/Users/evanzamir/.rvm/bin:/usr/local/smlnj-110.77/bin:/opt/local/bin:/opt/local/sbin:/usr/local/share/npm/bin/jitsu :/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/local/sbin:/usr/local/share/npm/bin
programs: /Users/evanzamir/.stack/programs/x86_64-osx
compiler-exe: /Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/bin/ghc
compiler-bin: /Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/bin
compiler-tools-bin: /Users/evanzamir/.stack/compiler-tools/x86_64-osx/ghc-8.4.4/bin
local-bin: /Users/evanzamir/.local/bin
extra-include-dirs:
extra-library-dirs:
snapshot-pkg-db: /Users/evanzamir/.stack/snapshots/x86_64-osx/lts-12.17/8.4.4/pkgdb
local-pkg-db: /Users/evanzamir/Code/Haskell/bartosz/.stack-work/install/x86_64-osx/lts-12.17/8.4.4/pkgdb
global-pkg-db: /Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/lib/ghc-8.4.4/package.conf.d
ghc-package-path: /Users/evanzamir/Code/Haskell/bartosz/.stack-work/install/x86_64-osx/lts-12.17/8.4.4/pkgdb:/Users/evanzamir/.stack/snapshots/x86_64-osx/lts-12.17/8.4.4/pkgdb:/Users/evanzamir/.stack/programs/x86_64-osx/ghc-8.4.4/lib/ghc-8.4.4/package.conf.d
snapshot-install-root: /Users/evanzamir/.stack/snapshots/x86_64-osx/lts-12.17/8.4.4
local-install-root: /Users/evanzamir/Code/Haskell/bartosz/.stack-work/install/x86_64-osx/lts-12.17/8.4.4
snapshot-doc-root: /Users/evanzamir/.stack/snapshots/x86_64-osx/lts-12.17/8.4.4/doc
local-doc-root: /Users/evanzamir/Code/Haskell/bartosz/.stack-work/install/x86_64-osx/lts-12.17/8.4.4/doc
dist-dir: .stack-work/dist/x86_64-osx/Cabal-2.2.0.1
local-hpc-root: /Users/evanzamir/Code/Haskell/bartosz/.stack-work/install/x86_64-osx/lts-12.17/8.4.4/hpc
local-bin-path: /Users/evanzamir/.local/bin
ghc-paths: /Users/evanzamir/.stack/programs/x86_64-osx
Been trying to figure this out all day. I'm on OS X Mojave 14.1. I've tried installing stack using the script, Brew, directly from the binary, and even the Haskell Platform installer, and all are giving me errors.
I have an issue with linking libmongocxx in my project.
I am using CMAKE to link the library and I am running Ubuntu 17.10.
Here is my CMakeLists.txt :
cmake_minimum_required(VERSION 3.9)
project(web_service_cpp)
SET(CMAKE_CXX_STANDARD 14)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
find_package(Boost REQUIRED)
find_package(Hana REQUIRED)
find_package(libmongocxx REQUIRED)
find_package(libbsoncxx REQUIRED)
add_library(libmongocxx INTERFACE IMPORTED)
set_property(TARGET libmongocxx PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${libmongocxx_INCLUDE_DIR})
add_library(boost INTERFACE IMPORTED)
set_property(TARGET boost PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
include_directories(${LIBMONGOCXX_INCLUDE_DIR})
include_directories(${LIBBSONCXX_INCLUDE_DIR})
include_directories("/usr/local/include/mongocxx/v_noabi")
include_directories("/usr/local/include/bsoncxx/v_noabi")
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
include_directories("/usr/local/lib")
include_directories("${PROJECT_SOURCE_DIR}")
set(SOURCE_FILES src/main.cpp
src/cMqttService.cpp
src/cMongoDB.cpp
src/cRepository.cpp)
set(HEADER_FILES include/cRepository.h
include/cMqttService.h
include/cMongoDB.h
include/main.h)
add_executable(web_service_cpp
${HEADER_FILES}
${SOURCE_FILES})
target_link_libraries(web_service_cpp ${LIBMONGOCXX_LIBRARIES})
target_link_libraries(web_service_cpp ${LIBBSONXX_LiBRARIES})
I find it weird that I am getting this error since it use to work on macOS :
[ 20%] Building CXX object
CMakeFiles/web_service_cpp.dir/src/main.cpp.o
[ 40%] Building CXX object CMakeFiles/web_service_cpp.dir/src/cMqttService.cpp.o
[ 60%] Building CXX object CMakeFiles/web_service_cpp.dir/src/cMongoDB.cpp.o
[ 80%] Building CXX object CMakeFiles/web_service_cpp.dir/src/cRepository.cpp.o
[100%] Linking CXX executable bin/bin/web_service_cpp
CMakeFiles/web_service_cpp.dir/src/cMqttService.cpp.o: In function `cMqttService::initCommunication()':
cMqttService.cpp:(.text+0x1da): undefined reference to `mqtt::async_client::async_client(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, mqtt::iclient_persistence*)'
cMqttService.cpp:(.text+0x225): undefined reference to `mqtt::connect_options::connect_options()'
cMqttService.cpp:(.text+0x266): undefined reference to `mqtt::connect_options::connect_options(mqtt::connect_options const&)'
cMqttService.cpp:(.text+0x286): undefined reference to `mqtt::async_client::connect(mqtt::connect_options)'
cMqttService.cpp:(.text+0x3ca): undefined reference to `mqtt::async_client::publish(std::shared_ptr)'
cMqttService.cpp:(.text+0x464): undefined reference to `mqtt::async_client::publish(mqtt::buffer_ref, void const*, unsigned long, int, bool)'
cMqttService.cpp:(.text+0x4ea): undefined reference to `mqtt::async_client::~async_client()'
cMqttService.cpp:(.text+0x63f): undefined reference to `mqtt::async_client::~async_client()'
CMakeFiles/web_service_cpp.dir/src/cMqttService.cpp.o: In function `mqtt::async_client::disconnect()':
cMqttService.cpp:(.text._ZN4mqtt12async_client10disconnectEv[_ZN4mqtt12async_client10disconnectEv]+0x36): undefined reference to `mqtt::disconnect_options::disconnect_options()'
CMakeFiles/web_service_cpp.dir/src/cMqttService.cpp.o: In function `void __gnu_cxx::new_allocator::construct, mqtt::buffer_ref, int&, bool&>(mqtt::message*, mqtt::buffer_ref&&, mqtt::buffer_ref&&, int&, bool&)':
cMqttService.cpp:(.text._ZN9__gnu_cxx13new_allocatorIN4mqtt7messageEE9constructIS2_JNS1_10buffer_refIcEES6_RiRbEEEvPT_DpOT0_[_ZN9__gnu_cxx13new_allocatorIN4mqtt7messageEE9constructIS2_JNS1_10buffer_refIcEES6_RiRbEEEvPT_DpOT0_]+0xdc): undefined reference to `mqtt::message::message(mqtt::buffer_ref, mqtt::buffer_ref, int, bool)'
CMakeFiles/web_service_cpp.dir/src/cMongoDB.cpp.o: In function `cMongoDB::cMongoDB(std::__cxx11::basic_string, std::allocator >, short)':
cMongoDB.cpp:(.text+0x63): undefined reference to `mongocxx::v_noabi::instance::instance()'
cMongoDB.cpp:(.text+0x7c): undefined reference to `mongocxx::v_noabi::uri::k_default_uri[abi:cxx11]'
cMongoDB.cpp:(.text+0x96): undefined reference to `mongocxx::v_noabi::uri::uri(bsoncxx::v_noabi::string::view_or_value)'
cMongoDB.cpp:(.text+0xb8): undefined reference to `mongocxx::v_noabi::client::client()'
cMongoDB.cpp:(.text+0x190): undefined reference to `mongocxx::v_noabi::uri::uri(bsoncxx::v_noabi::string::view_or_value)'
cMongoDB.cpp:(.text+0x1ad): undefined reference to `mongocxx::v_noabi::uri::operator=(mongocxx::v_noabi::uri&&)'
cMongoDB.cpp:(.text+0x1bc): undefined reference to `mongocxx::v_noabi::uri::~uri()'
cMongoDB.cpp:(.text+0x215): undefined reference to `mongocxx::v_noabi::client::client(mongocxx::v_noabi::uri const&, mongocxx::v_noabi::options::client const&)'
cMongoDB.cpp:(.text+0x232): undefined reference to `mongocxx::v_noabi::client::operator=(mongocxx::v_noabi::client&&)'
cMongoDB.cpp:(.text+0x241): undefined reference to `mongocxx::v_noabi::client::~client()'
cMongoDB.cpp:(.text+0x2e3): undefined reference to `mongocxx::v_noabi::client::~client()'
cMongoDB.cpp:(.text+0x2f6): undefined reference to `mongocxx::v_noabi::uri::~uri()'
cMongoDB.cpp:(.text+0x309): undefined reference to `mongocxx::v_noabi::instance::~instance()'
collect2: error: ld returned 1 exit status
CMakeFiles/web_service_cpp.dir/build.make:172: recipe for target 'bin/bin/web_service_cpp' failed
make[2]: *** [bin/bin/web_service_cpp] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/web_service_cpp.dir/all' failed
make[1]: *** [CMakeFiles/web_service_cpp.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I am open to suggestions!
Thank you for your help in advance.
I found the solution to my problem. It is caused by all those hard coded strings that I used back on macOS.
cmake_minimum_required(VERSION 3.9)
project(web_service_cpp)
SET(CMAKE_CXX_STANDARD 14)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
find_package(Boost REQUIRED)
find_package(Hana REQUIRED)
find_package(OpenSSL REQUIRED)
find_library(paho-mqttpp3 NAMES libpaho-mqttpp3.so REQUIRED)
find_library(paho-mqtt3a NAMES libpaho-mqtt3a.so REQUIRED)
find_package(libmongocxx REQUIRED)
find_package(libbsoncxx REQUIRED)
add_library(libmongocxx INTERFACE IMPORTED)
add_library(libbsoncxx INTERFACE IMPORTED)
set_property(TARGET libmongocxx PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${LIBMONGOCXX_INCLUDE_DIRS})
set_property(TARGET libbsoncxx PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${LIBBSONCXX_INCLUDE_DIRS})
add_library(boost INTERFACE IMPORTED)
set_property(TARGET boost PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
add_library(pahottpp STATIC IMPORTED)
set_target_properties(pahottpp PROPERTIES IMPORTED_LOCATION ${paho-mqttpp3})
add_library(pahomqtt3a SHARED IMPORTED)
set_property(TARGET pahomqtt3a PROPERTY IMPORTED_LOCATION ${paho-mqtt3a})
include_directories(${LIBMONGOCXX_INCLUDE_DIRS} ${LIBBSONCXX_INCLUDE_DIRS})
link_directories(${LIBMONGOCXX_INCLUDE_DIRS})
link_directories(${LIBBSONCXX_INCLUDE_DIR})
include_directories("${PROJECT_SOURCE_DIR}")
set(SOURCE_FILES src/main.cpp
src/cMqttService.cpp
src/cMongoDB.cpp
src/cRepository.cpp)
set(HEADER_FILES include/cRepository.h
include/cMqttService.h
include/cMongoDB.h
include/main.h)
add_executable(web_service_cpp
${HEADER_FILES}
${SOURCE_FILES})
target_link_libraries(web_service_cpp ${LIBMONGOCXX_LIBRARIES} ${lIBBSONCXX_LIBRARIES} pahottpp pahomqtt3a)
I'm trying to write an OpenGL program to manipulate the camera. However the code isn't compiling.
All of my source code can be found here.
The error is:
1>------ Rebuild All started: Project: Lab4, Configuration: Debug Win32 ------
1>Build started 2/14/2011 7:17:54 PM.
1>_PrepareForClean:
1> Deleting file "Debug\Lab4.lastbuildstate".
1>InitializeBuildStatus:
1> Touching "Debug\Lab4.unsuccessfulbuild".
1>ClCompile:
1> camera.cpp
1>camera.obj : error LNK2019: unresolved external symbol "public: void __thiscalllVector3::normalize(void)" (?normalize#Vector3##QAEXXZ) referenced in function "public: void __thiscall Camera::set(class Point3,class Point3,class Vector3)" (?set#Camera##QAEXVPoint3##0VVector3###Z)
1>camera.obj : error LNK2019: unresolved external symbol "public: class Vector3 __thiscall Vector3::cross(class Vector3)" (?cross#Vector3##QAE?AV1#V1##Z) referenced in function "public: void __thiscall Camera::set(class Point3,class Point3,class Vector3)" (?set#Camera##QAEXVPoint3##0VVector3###Z)
1>camera.obj : error LNK2019: unresolved external symbol "public: float __thiscall Vector3::dot(class Vector3)" (?dot#Vector3##QAEMV1##Z) referenced in function "private: void __thiscall Camera::setModelviewMatrix(void)" (?setModelviewMatrix#Camera##AAEXXZ)
1>C:\Users\Andrew Davis\Documents\Visual Studio 2010\Projects\Lab4\Debug\Lab4.exe : fatal error LNK1120: 3 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.08
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have this in my linker already:
opengl32.lib
glu32.lib
glut32.lib
freeglut.lib
Any suggestions? Thanks in advance!
You have to provide a body for the following functions, even if it's empty.
Vector3::normalize(), Vector3::cross(), Vector3::dot() . For instance
void normalize(){ //do something}
You are calling them, so you get an unresolved linker error because there is no implementation.
This is not a problem with OpenGL or it's libraries. It looks like if camera.cpp uses some different class, but its implementation is either not build or not linked.
EDIT: Just took the look at your code
How about implementing Vector3::normalize(), Vector3::cross() and Vector3::dot()? Lines 86, 107 and 108 in the Pastebin.