# Compiling v4

**URL:** <https://forum.dynare.org/t/compiling-v4/737>\
**Category:** Dynare v4 (legacy)\
**Created:** [1 July 2008 19:11 UTC](https://forum.dynare.org/t/compiling-v4/737 "2008-07-01T19:11:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![atanas](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@atanas](https://forum.dynare.org/u/atanas)\
**Post date:** [1 July 2008 19:11 UTC](https://forum.dynare.org/t/compiling-v4/737/1 "2008-07-01T19:11:13Z")

</div>

Hi,

I’m trying to compile the .dll files of v4 but I get the following error message:

* * *

Warning: You are using gcc version “4.2.3”. The earliest gcc version supported  
with mex is “4.0.0”. The latest version tested for use with mex is “4.2.0”.  
To download a different version of gcc, visit [gcc.gnu.org](http://gcc.gnu.org)  
-\> gcc -c -I/opt/matlab/extern/include -DMATLAB\_MEX\_FILE -ansi -D\_GNU\_SOURCE -fexceptions -fPIC -pthread -m32 -D\_FILE\_OFFSET\_BITS=64 -DMX\_COMPAT\_32 -O -DNDEBUG mjdgges/mjdgges.c -o …/2007b/mjdgges.o

-\> gcc -c -I/opt/matlab/extern/include -DMATLAB\_MEX\_FILE -ansi -D\_GNU\_SOURCE -fexceptions -fPIC -pthread -m32 -D\_FILE\_OFFSET\_BITS=64 -DMX\_COMPAT\_32 -O -DNDEBUG /opt/matlab/extern/src/mexversion.c -o …/2007b/mexversion.o

-\> gcc -O -pthread -shared -m32 -Wl,–version-script,/opt/matlab/extern/lib/glnx86/mexFunction.map -Wl,–no-undefined -o …/2007b/mjdgges.mexglx …/2007b/mjdgges.o …/2007b/mexversion.o -lmwlapack -Wl,-rpath-link,/opt/matlab/bin/glnx86 -L/opt/matlab/bin/glnx86 -lmx -lmex -lmat -lm -lm -lstdc++

/usr/bin/ld: cannot find -lstdc++  
collect2: ld returned 1 exit status

```
mex: link of '../2007b/mjdgges.mexglx' failed.

```

??? Error using ==\> mex at 208  
Unable to complete successfully.

Error in ==\> build\_matlab at 67  
eval( COMPILE\_COMMAND ’ mjdgges/mjdgges.c ’ LAPACK\_PATH ]);

* * *

My system is Ubuntu 8.04 and Matlab version is 7.5.  
Could anyone help?

atanas

---

<div class="post-metadata">

**Author:** ![atanas](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@atanas](https://forum.dynare.org/u/atanas)\
**Post date:** [2 July 2008 18:15 UTC](https://forum.dynare.org/t/compiling-v4/737/2 "2008-07-02T18:15:26Z")

</div>

Problem solved. I got the above posted error message since the command `user@host~/$ dynare_v4/preprocessor/ make ` in was not correctly executed. Sorry for my previous precipitous post.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [24 July 2017 13:36 UTC](https://forum.dynare.org/t/compiling-v4/737/3 "2017-07-24T13:36:59Z")

</div>

Closed on 24 July 2017 13:36 UTC


