# build error when embedding Julia codes into C program

**URL:** <https://discourse.julialang.org/t/build-error-when-embedding-julia-codes-into-c-program/16030>\
**Category:** New to Julia\
**Created:** [October 8, 2018, 3:29pm UTC](https://discourse.julialang.org/t/build-error-when-embedding-julia-codes-into-c-program/16030 "2018-10-08T15:29:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ifsheldon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ifsheldon/32/5668_2.png) [@ifsheldon](https://discourse.julialang.org/u/ifsheldon)\
**Post date:** [October 8, 2018, 3:29pm UTC](https://discourse.julialang.org/t/build-error-when-embedding-julia-codes-into-c-program/16030/1 "2018-10-08T15:29:30Z")

</div>

When I wanted to use Julia in a C program using Clion and MinGW\_w64 compiler, an error occurred. I’ve written the cmakelists.txt of my project to include headers of Julia. The codes written are :  
`
set(INC_DIR C:/Julia/lang/Julia-1.0.0/include/julia)
include_directories(${INC_DIR})
`  
And the version of Julia installed is 1.0.

The error messages are:  
`
Scanning dependencies of target ClionProjects
[11%] Building C object CMakeFiles/ClionProjects.dir/greenhand/draft.obj
In file included from C:/Julia/lang/Julia-1.0.0/include/julia/julia.h:67,
from D:\Onedrive\Study\Code\C\ClionProjects\greenhand\draft.c:2:
C:/Julia/lang/Julia-1.0.0/include/julia/atomics.h:9:4: error: #error Julia can only be built for architectures above Pentium 4. Pass -march=pentium4, or set MARCH=pentium4 and ensure that -march is not passed separately with an older architecture.
error Julia can only be built for architectures above Pentium 4. Pass -march=pentium4, or set MARCH=pentium4 and ensure that -march is not passed separately with an older architecture.
^ ~~~~
mingw32-make.exe[3]: *** [CMakeFiles\ClionProjects.dir\build.make:161: CMakeFiles/ClionProjects.dir/greenhand/draft.obj] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:72: CMakeFiles/ClionProjects.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:84: CMakeFiles/ClionProjects.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:117: ClionProjects] Error 2
`  
It is kind of wired that it suggested that the architecture of my computer is too old because I am using an 8th-gen Intel CPU.  
It seems that there’s no solution on Google. And I’ve asked for help on Chinese Julia discourse, but no one can figure it out.  
I hope someone can help me out. Thanks!
