www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linker error, doing something wrong?

reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
Trying to compile the following:

https://github.com/DmitryOlshansky/photon/blob/master/tests/curl_download.d

with:
ldc2 curl_download.d -L-lcurl

get:

   "__D6photon12__ModuleInfoZ", referenced from:
       __D13curl_download12__ModuleInfoZ in curl_download.o
   "__D6photon5macos4core2goFDFZvZv", referenced from:
       __D13curl_download4mainFZ13spawnDownloadMFAyaQdZv in 
curl_download.o
   "__D6photon5macos4core9startloopFZv", referenced from:
       __Dmain in curl_download.o
   "__D6photon9runFibersFZv", referenced from:
       __Dmain in curl_download.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
Error: /usr/bin/cc failed with status: 1

Am I missing something?

--
Dmitry Olshansky
https://olshansky.me
Jul 09 2023
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 7/9/23 10:01 AM, Dmitry Olshansky wrote:
 Trying to compile the following:
 
 https://github.com/DmitryOlshansky/photon/blob/master/tests/curl_download.d
 
 with:
 ldc2 curl_download.d -L-lcurl
 
 get:
 
    "__D6photon12__ModuleInfoZ", referenced from:
        __D13curl_download12__ModuleInfoZ in curl_download.o
    "__D6photon5macos4core2goFDFZvZv", referenced from:
        __D13curl_download4mainFZ13spawnDownloadMFAyaQdZv in
curl_download.o
    "__D6photon5macos4core9startloopFZv", referenced from:
        __Dmain in curl_download.o
    "__D6photon9runFibersFZv", referenced from:
        __Dmain in curl_download.o
 ld: symbol(s) not found for architecture arm64
 clang: error: linker command failed with exit code 1 (use -v to see 
 invocation)
 Error: /usr/bin/cc failed with status: 1
 
 Am I missing something?
You need to link the library that contains photon. -Steve
Jul 09 2023