Function reference accross modules => link error: unresolved external

Robert M. Münch robert.muench at saphirion.com
Wed May 8 16:56:17 UTC 2019


On 2019-05-08 16:20:22 +0000, Robert M. Münch said:

> Sometimes a simple thing should be obvious but...
> 
> // a.d
> module a;
> 
> int otherFunc();
> 
> main(){
> 	otherFunc();
> }
> 
> 
> 
> // myapp.d
> import a;
> int otherFunc(){
> 	return(1);
> }
> 
> Gives me an "unresolved external symbol" for otherFunc() in myapp.d
> 
> So, the compiler can see the reference but not the linker. I'm just 
> compiling myapp.d and don't explicitly compile a.d but IMO that 
> shouldn't make any difference.
> 
> Any idea what needs to be done?

Correction: I compile the module file too (using DUB).

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list