# Comple code error

**URL:** <https://discourse.mc-stan.org/t/comple-code-error/30816>\
**Category:** Interfaces\
**Tags:** rstan\
**Created:** [March 21, 2023, 10:05am UTC](https://discourse.mc-stan.org/t/comple-code-error/30816 "2023-03-21T10:05:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshul\_Hirani](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/harshul_hirani/32/16105_2.png) [@Harshul\_Hirani](https://discourse.mc-stan.org/u/Harshul_Hirani)\
**Post date:** [March 21, 2023, 10:05am UTC](https://discourse.mc-stan.org/t/comple-code-error/30816/1 "2023-03-21T10:05:21Z")

</div>

Short summary of the problem  
I get the following error when trying to run the line:

```plaintext
fit <- stan(file = 'ToyExample.stan', data = toy_dat, init=0)

```

Error in compileCode(f, code, language = language, verbose = verbose) :  
C:\RBuildTools\4.2\x86\_64-w64-mingw32.static.posix\bin/ld.exe: file2240585e2d0d.o:file2240585e2d0d.cpp:(.text$\_ZN3tbb8internal26task\_scheduler\_observer\_v3D0Ev[\_ZN3tbb8internal26task\_scheduler\_observer\_v3D0Ev]+0x1d): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:\RBuildTools\4.2\x86_64-w64-mingw32.static.posix\bin/ld.exe: file2240585e2d0d.o:file2240585e2d0d.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD1Ev[_ZN3tbb10interface623task_scheduler_observerD1Ev]+0x1d): undefined reference to `tbb::internal::task\_scheduler\_observer\_v3::observe(bool)'C:\RBuildTools\4.2\x86\_64-w64-mingw32.static.posix\bin/ld.exe: file2240585e2d0d.o:file2240585e2d0d.cpp:(.text$\_ZN3tbb10interface623task\_scheduler\_observerD1Ev[\_ZN3tbb10interface623task\_scheduler\_observerD1Ev]+0x3a): undefined reference to `tbb::internal::task\_scheduler\_observer\_v3::observe(bool)'C:\RBuildTools\4.2\x86\_64-w64-mingw32.static.posix\bin/ld.exe: file2240585e2d0d.o:file2240585e2d0d.c

Error in sink(type = “output”) : invalid connection

Operating System: windows 11  
Interface Version: i think, R 4.2.2  
Compiler/Toolkit: unsure  
(I apologise in advance - not the most tech savy guy)

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [March 21, 2023, 11:54am UTC](https://discourse.mc-stan.org/t/comple-code-error/30816/2 "2023-03-21T11:54:04Z")

</div>

See the [Getting Started Guide](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows#r-42)
