# Hi, Im a curious beginner, and Im struggling to compile my first program.

**URL:** <https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184>\
**Category:** Users\
**Created:** [October 19, 2026, 1:27pm UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184 "2026-10-19T13:27:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardieMejia](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/ardiemejia/32/862_2.png) [@ardieMejia](https://chapel.discourse.group/u/ardieMejia)\
**Post date:** [October 19, 2026, 1:27pm UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184/1 "2026-10-19T13:27:33Z")

</div>

As per the title, even after changing env variables CHPL\_LLVM to either system or bundled. Im still getting either the errors "/usr/bin/ld: cannot find -lstdc++: No such file or directory" OR "error: Make Binary - Linking"

---

<div class="post-metadata">

**Author:** ![jabraham](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/jabraham/32/430_2.png) [@jabraham](https://chapel.discourse.group/u/jabraham)\
**Post date:** [October 19, 2026, 3:47pm UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184/2 "2026-10-19T15:47:05Z")

</div>

Is this an issue when trying to use an installed Chapel? Or an issue building Chapel itself. I am assuming the former.

Can you send the output of `printchplenv --all` and `printchplenv --verify-verbose`, as well as `chpl examples/hello.chpl --print-commands`

-Jade

---

<div class="post-metadata">

**Author:** ![ardieMejia](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/ardiemejia/32/862_2.png) [@ardieMejia](https://chapel.discourse.group/u/ardieMejia)\
**Post date:** [October 20, 2026, 6:14am UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184/3 "2026-10-20T06:14:57Z")

</div>

Thanks for taking the time to reply:  
I actually installed using sudo apt install, since I was only curious, there would be no need for source build

## Output of $CHPL\_HOME/util/printchplenv --all

machine info: Linux ardie-ThinkPad-T440 5.15.0-194-generic #204-Ubuntu SMP Wed Sep 2 13:09:23 UTC 2026 x86\_64  
CHPL\_HOME: /usr/share/chapel/2.10 \*  
script location: /usr/share/chapel/2.10/util/chplenv  
CHPL\_HOST\_PLATFORM: linux64 +  
CHPL\_HOST\_COMPILER: gnu  
CHPL\_HOST\_CC: gcc  
CHPL\_HOST\_CXX: g++  
CHPL\_HOST\_ARCH: x86\_64  
CHPL\_TARGET\_PLATFORM: linux64 +  
CHPL\_TARGET\_COMPILER: llvm +  
CHPL\_TARGET\_CC: /usr/lib/llvm-15/bin/clang  
CHPL\_TARGET\_CXX: /usr/lib/llvm-15/bin/clang++  
CHPL\_TARGET\_LD: /usr/lib/llvm-15/bin/clang++  
CHPL\_TARGET\_ARCH: x86\_64  
CHPL\_TARGET\_CPU: native +  
CHPL\_LOCALE\_MODEL: flat +  
CHPL\_COMM: none +  
CHPL\_TASKS: qthreads +  
CHPL\_LAUNCHER: none  
CHPL\_TIMERS: generic  
CHPL\_UNWIND: system +  
CHPL\_HOST\_MEM: jemalloc +  
CHPL\_HOST\_JEMALLOC: bundled  
CHPL\_TARGET\_MEM: jemalloc +  
CHPL\_TARGET\_JEMALLOC: bundled  
CHPL\_ATOMICS: cstdlib +  
CHPL\_GMP: system +  
CHPL\_HWLOC: system +  
CHPL\_RE2: bundled +  
CHPL\_LLVM: system +  
CHPL\_LLVM\_SUPPORT: system  
CHPL\_LLVM\_CONFIG: llvm-config-15  
CHPL\_LLVM\_VERSION: 15  
CHPL\_AUX\_FILESYS: none  
CHPL\_LIB\_PIC: none +  
CHPL\_SANITIZE: none +  
CHPL\_SANITIZE\_EXE: none +

machine info: Linux ardie-ThinkPad-T440 5.15.0-194-generic #204-Ubuntu SMP Wed Sep 2 13:09:23 UTC 2026 x86\_64  
CHPL\_HOME: /usr/share/chapel/2.10 \*  
script location: /usr/share/chapel/2.10/util/chplenv  
CHPL\_HOST\_PLATFORM: linux64 +  
CHPL\_HOST\_COMPILER: gnu  
CHPL\_HOST\_CC: gcc  
CHPL\_HOST\_CXX: g++  
CHPL\_HOST\_ARCH: x86\_64  
CHPL\_TARGET\_PLATFORM: linux64 +  
CHPL\_TARGET\_COMPILER: llvm +  
CHPL\_TARGET\_CC: /usr/lib/llvm-15/bin/clang  
CHPL\_TARGET\_CXX: /usr/lib/llvm-15/bin/clang++  
CHPL\_TARGET\_LD: /usr/lib/llvm-15/bin/clang++  
CHPL\_TARGET\_ARCH: x86\_64  
CHPL\_TARGET\_CPU: native +  
CHPL\_LOCALE\_MODEL: flat +  
CHPL\_COMM: none +  
CHPL\_TASKS: qthreads +  
CHPL\_LAUNCHER: none  
CHPL\_TIMERS: generic  
CHPL\_UNWIND: system +  
CHPL\_HOST\_MEM: jemalloc +  
CHPL\_HOST\_JEMALLOC: bundled  
CHPL\_TARGET\_MEM: jemalloc +  
CHPL\_TARGET\_JEMALLOC: bundled  
CHPL\_ATOMICS: cstdlib +  
CHPL\_GMP: system +  
CHPL\_HWLOC: system +  
CHPL\_RE2: bundled +  
CHPL\_LLVM: system +  
CHPL\_LLVM\_SUPPORT: system  
CHPL\_LLVM\_CONFIG: llvm-config-15  
CHPL\_LLVM\_VERSION: 15  
CHPL\_AUX\_FILESYS: none  
CHPL\_LIB\_PIC: none +  
CHPL\_SANITIZE: none +

## Output of printchplenv --verify-verbose:

machine info: Linux ardie-ThinkPad-T440 5.15.0-194-generic #204-Ubuntu SMP Wed Sep 2 13:09:23 UTC 2026 x86\_64  
CHPL\_HOME: /usr/share/chapel/2.10 \*  
script location: /usr/share/chapel/2.10/util/chplenv  
CHPL\_TARGET\_PLATFORM: linux64 +  
CHPL\_TARGET\_COMPILER: llvm +  
CHPL\_TARGET\_ARCH: x86\_64  
CHPL\_TARGET\_CPU: native +  
CHPL\_LOCALE\_MODEL: flat +  
CHPL\_COMM: none +  
CHPL\_TASKS: qthreads +  
CHPL\_LAUNCHER: none  
CHPL\_TIMERS: generic  
CHPL\_UNWIND: system +  
CHPL\_TARGET\_MEM: jemalloc +  
CHPL\_ATOMICS: cstdlib +  
CHPL\_GMP: system +  
CHPL\_HWLOC: system +  
CHPL\_RE2: bundled +  
CHPL\_LLVM: system +  
CHPL\_AUX\_FILESYS: none  
Running verification pass TestHostCompile  
Trying to compile with 'g++ /tmp/tmpgb8dsjvt/tmpzf13kk3b.cpp -o /tmp/tmpgb8dsjvt/a.out'  
Trying to run with '/tmp/tmpgb8dsjvt/a.out'  
Running verification pass TestTargetCompileCC  
Trying to compile with '/usr/lib/llvm-15/bin/clang /tmp/tmpjemk97hg/tmpg4\_yld\_s.c -o /tmp/tmpjemk97hg/a.out'  
Trying to run with '/tmp/tmpjemk97hg/a.out'  
Running verification pass TestTargetCompileCXX  
Trying to compile with '/usr/lib/llvm-15/bin/clang++ /tmp/tmplp2o8zu8/tmpeyrlggny.cpp -o /tmp/tmplp2o8zu8/a.out'

Error: Verification failed: Failed to compile program: /tmp/tmplp2o8zu8/tmpeyrlggny.cpp:2:10: fatal error: 'iostream' file not found  
#include  
^ ~~~~~~~~~  
1 error generated.

## Output of chpl hello-world.chpl --print-comand:

invoking driver compilation phase

chpl --driver-compilation-phase --driver-tmp-dir /tmp/chpl-ardie.deleteme-EsnEF6 hello-world.chpl --print-commands  
-I/usr/share/chapel/2.10/modules/standard -I/usr/share/chapel/2.10/modules/packages -I/usr/lib/chapel/2.10/runtime/include/localeModels/flat -I/usr/lib/chapel/2.10/runtime/include/localeModels -I/usr/lib/chapel/2.10/runtime/include/comm/none -I/usr/lib/chapel/2.10/runtime/include/comm -I/usr/lib/chapel/2.10/runtime/include/tasks/qthreads -I/usr/lib/chapel/2.10/runtime/include -I/usr/lib/chapel/2.10/runtime/include/qio -I/usr/lib/chapel/2.10/runtime/include/atomics/cstdlib -I/usr/lib/chapel/2.10/runtime/include/mem/jemalloc -I/usr/lib/chapel/2.10/third-party/utf8-decoder -DCHPL\_JEMALLOC\_PREFIX=chpl\_je\_ -I/usr/lib/chapel/2.10/third-party/qthread/install/linux64-x86\_64-none-llvm-none-flat-jemalloc-system/include -I/usr/lib/chapel/2.10/third-party/jemalloc/install/target/linux64-x86\_64-none-llvm-none/include -I/usr/lib/chapel/2.10/third-party/re2/install/linux64-x86\_64-none-llvm-none/include -iquote. -I/tmp/chpl-ardie.deleteme-EsnEF6 -Werror=pointer-arith -Werror=write-strings -Werror=missing-declarations -Werror=missing-prototypes -Werror=strict-prototypes -Werror=missing-format-attribute -Wno-unused-function -Wno-strict-aliasing -fno-math-errno -I/usr/share/chapel/2.10/modules/internal -DCHPL\_GEN\_CODE -pthread -I/usr/include/x86\_64-linux-gnu -include sys\_basic.h -include wctype.h -include ctype.h -include chpl-prginfo.h -include llvm/chapel\_libc\_wrapper.h

invoking driver makeBinary phase

chpl --driver-makebinary-phase --driver-tmp-dir /tmp/chpl-ardie.deleteme-EsnEF6 hello-world.chpl --print-commands  
-I/usr/share/chapel/2.10/modules/standard -I/usr/share/chapel/2.10/modules/packages -I/usr/lib/chapel/2.10/runtime/include/localeModels/flat -I/usr/lib/chapel/2.10/runtime/include/localeModels -I/usr/lib/chapel/2.10/runtime/include/comm/none -I/usr/lib/chapel/2.10/runtime/include/comm -I/usr/lib/chapel/2.10/runtime/include/tasks/qthreads -I/usr/lib/chapel/2.10/runtime/include -I/usr/lib/chapel/2.10/runtime/include/qio -I/usr/lib/chapel/2.10/runtime/include/atomics/cstdlib -I/usr/lib/chapel/2.10/runtime/include/mem/jemalloc -I/usr/lib/chapel/2.10/third-party/utf8-decoder -DCHPL\_JEMALLOC\_PREFIX=chpl\_je\_ -I/usr/lib/chapel/2.10/third-party/qthread/install/linux64-x86\_64-none-llvm-none-flat-jemalloc-system/include -I/usr/lib/chapel/2.10/third-party/jemalloc/install/target/linux64-x86\_64-none-llvm-none/include -I/usr/lib/chapel/2.10/third-party/re2/install/linux64-x86\_64-none-llvm-none/include -iquote. -I/tmp/chpl-ardie.deleteme-EsnEF6 -Werror=pointer-arith -Werror=write-strings -Werror=missing-declarations -Werror=missing-prototypes -Werror=strict-prototypes -Werror=missing-format-attribute -Wno-unused-function -Wno-strict-aliasing -fno-math-errno -I/usr/share/chapel/2.10/modules/internal -DCHPL\_GEN\_CODE -pthread -I/usr/include/x86\_64-linux-gnu -include sys\_basic.h -include wctype.h -include ctype.h -include chpl-prginfo.h -include llvm/chapel\_libc\_wrapper.h

Make Binary - Linking

/usr/lib/llvm-15/bin/clang++ /tmp/chpl-ardie.deleteme-EsnEF6/chpl\_\_module.o /usr/lib/chapel/2.10/runtime/lib/linux64/llvm/x86\_64/cpu-none/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-system/mem-jemalloc/atomics-cstdlib/hwloc-system/re2-bundled/fs-none/lib\_pic-none/san-none/main.o -o /tmp/chpl-ardie.deleteme-EsnEF6/hello-world.tmp -L/usr/lib/chapel/2.10/runtime/lib/linux64/llvm/x86\_64/cpu-none/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-system/mem-jemalloc/atomics-cstdlib/hwloc-system/re2-bundled/fs-none/lib\_pic-none/san-none -lchpl-static -L/usr/lib/chapel/2.10/third-party/qthread/install/linux64-x86\_64-none-llvm-none-flat-jemalloc-system/lib -Wl,-rpath,/usr/lib/chapel/2.10/third-party/qthread/install/linux64-x86\_64-none-llvm-none-flat-jemalloc-system/lib -lqthread -L/usr/lib/chapel/2.10/third-party/jemalloc/install/target/linux64-x86\_64-none-llvm-none/lib -ljemalloc -L/usr/lib/chapel/2.10/third-party/re2/install/linux64-x86\_64-none-llvm-none/lib -lre2 -Wl,-rpath,/usr/lib/chapel/2.10/third-party/re2/install/linux64-x86\_64-none-llvm-none/lib -L/usr/lib/chapel/2.10/runtime/lib/linux64/llvm/x86\_64/cpu-none/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-system/mem-jemalloc/atomics-cstdlib/hwloc-system/re2-bundled/fs-none/lib\_pic-none/san-none -ldl -lhwloc -lunwind -lm -lpthread -lgmp

/usr/bin/ld: cannot find -lstdc++: No such file or directory  
clang: error: linker command failed with exit code 1 (use -v to see invocation)  
child process exited with code 1  
error: Make Binary - Linking  
child process exited with code 1

=========

The hello word file, is just a single writeln()

---

<div class="post-metadata">

**Author:** ![jabraham](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/jabraham/32/430_2.png) [@jabraham](https://chapel.discourse.group/u/jabraham)\
**Post date:** [October 20, 2026, 3:51pm UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184/4 "2026-10-20T15:51:32Z")

</div>

Ah ok great. Its not related to your issue here, but CHPL\_LLVM doesn't need to be changed in a linux package install.

I believe the primary problem is that `clang++` cannot properly compile C++, which means your C++ compiler is not working right and is why the Chapel install is broken. You can see that in the `printchplenv --verify-verbose` output. Try the following

```Chapel
# should be /usr/lib/llvm-15/bin/clang++, just double checking
which clang++
/usr/lib/llvm-15/bin/clang++ -v
cat > hello.cpp << EOF
#include <iostream>
int main() {
    std::cout << "Hello, World!" << std::endl; 
    return 0;
}
EOF
/usr/lib/llvm-15/bin/clang++ -v hello.cpp -o hello
./hello

```

Can you also share which OS and which OS package you are using? Based on that output, it looks like Ubuntu 22 and the Ubuntu 22 package?

-Jade

---

<div class="post-metadata">

**Author:** ![ardieMejia](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/ardiemejia/32/862_2.png) [@ardieMejia](https://chapel.discourse.group/u/ardieMejia)\
**Post date:** [October 21, 2026, 6:58am UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184/5 "2026-10-21T06:58:15Z")

</div>

Thanks Jade for your time and helpful messages.

Turns out I just needed to: `sudo apt install g++-12`

I found the Stack Overflow link [here](https://askubuntu.com/questions/1449769/clang-cannot-find-iostream) that explains it. Ubuntu 22 ships with gcc 12 which messes with clang.

Im only ever familiar with gcc, not clang++ or g++ and what makes or breaks it.

Thanks again.

---

<div class="post-metadata">

**Author:** ![jabraham](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/jabraham/32/430_2.png) [@jabraham](https://chapel.discourse.group/u/jabraham)\
**Post date:** [October 21, 2026, 2:18pm UTC](https://chapel.discourse.group/t/hi-im-a-curious-beginner-and-im-struggling-to-compile-my-first-program/52184/6 "2026-10-21T14:18:46Z")

</div>

Awesome, glad its working now! Let us know if you need any more assistance.

-Jade
