Search Issue Tracker

Fixed in 2021.1

Fixed in 2019.4, 2020.1, 2020.2



Found in




Issue ID




[Lumin] Building for Lumin ignores raw .C or .CPP plugin files



How to reproduce:
1. Open attached project ("")
2. Open "NativeCode.cpp" with Code Editor (Assets->Plugins->NativeCode)
3. Uncomment 2nd line ("If this line is uncommented This should not compile")
4. Open Build Settings (File->Build Settings...)
5. Switch to Standalone Platform, Tick Development Build and Build the project
6. Open a Console window and Observe error (Check notes)
7. Switch to Lumin Platform and Build the project
8. Open a Console window and Observe error (Check notes)

Expected result: Errors are the same, raw .C or .CPP files are included
Actual result: Errors differ, raw .C or .CPP files are not included

Reproducible with: 2019.3.6f1, 2020.1.0a4, 2020.2.0a4
Could not test with: 2017.4.38f1, 2018.4.19f1 (No Lumin or IL2CPP support)

- Error on Standalone platform:
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: NativeCode.cpp
F:\UnityP\New folder\case_1218580-NativeCodeTest\Temp\StagingArea\Data\il2cppOutput\NativeCode.cpp(2): error C2065: 'If': undeclared identifier
F:\UnityP\New folder\case_1218580-NativeCodeTest\Temp\StagingArea\Data\il2cppOutput\NativeCode.cpp(2): error C2143: syntax error: missing ';' before 'this'
- Error on Lumin platform
linker stderr :F:/UnityP/New folder/case_1218580-NativeCodeTest/Library/il2cpp_cache/il2cpp_cache/0792C9C6CA29A3061844315E0D8A454E.o: In function `NativeCodeWrapper_AddTwoNumbers_m9B1F0A7455261CC22A581378A3684571B0AFBA84':
F:\UnityP\New folder\case_1218580-NativeCodeTest\Temp\StagingArea\Data\il2cppOutput\Assembly-CSharp-firstpass.cpp:(.text.NativeCodeWrapper_AddTwoNumbers_m9B1F0A7455261CC22A581378A3684571B0AFBA84+0x6c): undefined reference to `AddTwoNumbers'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

  1. Response avatar

    Resolution Note (fix version 2021.1):

    Fixed with 2021.1.0a2.727, backported to 2020.2.0b14, 2020.1.16f1, 2019.4.16f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.