Hello Martin,<br><br> Thanks for your attention and support.<br> The include error was my mistake in exploring the code.<br> The conflict with FMDB and GMSH is present. Now i am trying to use namespace to isolated the problem changing the code of GMSH. When happen some good news i'll return here.<br>
<br> I think the better question to the Forum is: Someone used in same project FMDB and GMSH? Using API, and not system call?<br><br>Best regards,<br>Bruno Correia<br><br><br><br><pre>Hi Bruno,
check two things:
1) iofwd.h, line 25: make sure that whatever you put there has this form:
#include "my_file.h" // The # at the beginning is important.
and not
include "my_file.h" or include<my_file.h>
Use < > for STL headers.
2) if iofwd is a header created by you, make sure you used include guards.
The first two lines and the last line of your file should say something like
#ifndef IOFWD_H // first line
#define IOFWD_H // second line
... your code ....
#endif // last line of the file.
Best regards,
Martin Vymazal
</pre><br><div class="gmail_quote">2013/1/17 Bruno Correia da Silva <span dir="ltr"><<a href="mailto:bcs2@cin.ufpe.br" target="_blank">bcs2@cin.ufpe.br</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Martin,<br><br> Thanks for your support.<br> I did what you explained about add "MEdge.h" and "MFace.h". After this, i change again my CMAKELIST.txt.<br> I'm using UNIX makefile compiler and default native compilers.<br>
For better explained: I'm using the FMDB library.<br><br>My CMAKELIST now is:<br>"<br><font><b>set (APPLICATIONS /home/padmec/applications)<br> ## FMDB<br>set (FMDB_INCLUDE "${APPLICATIONS}/FMDB-2011/</b></font><font><b>include" CACHE PATH "Directory where FMDB header files can be found")<br>
set (FMDB_LIB "${APPLICATIONS}/FMDB-2011/</b></font><font><b>lib" CACHE PATH "Directory where the FMDB library can be found")<br>include_directories(${FMDB_</b></font><font><b>INCLUDE})<br>link_directories(${FMDB_LIB})<br>
link_libraries(FMDB-O)<br>
<br>#GMSH<br>SET( GMSH_SRC "/home/padmec/Desktop/gmsh/</b></font><font><b>gmsh" CACHE STRING "GMSH SRC" )<br>SET( GMSH_INC<br> "${GMSH_SRC}/Common"<br> "${GMSH_SRC}/Geo"<br> "${GMSH_SRC}/Plugin"<br>
"${GMSH_SRC}/Solver"<br> "${GMSH_SRC}/Numeric"<br> "${GMSH_SRC}/build/Common" )<br>INCLUDE_DIRECTORIES( ${GMSH_INC} )<br><br>SET( GMSH_LIB "${GMSH_SRC}/lib" )<br><br>add_executable(Remeshing__Proj ${SRCS} ${HDRS})<br>
TARGET_LINK_LIBRARIES(Remeshing__Proj Gmsh )<br></b>"<br>And show me this errors:<br>"<b><br>/home/padmec/applications/FMDB-2011/include/iofwd.h: At global scope:<br>/home/padmec/applications/FMDB-2011/include/iofwd.h:25:1: error: ‘include’ does not name a type<br>
In file included from /home/padmec/Desktop/gmsh/gmsh/Numeric/Numeric.h:12:0,<br> from /home/padmec/Desktop/gmsh/gmsh/Geo/GFace.h:19,<br> from /home/padmec/Desktop/gmsh/gmsh/Geo/GModel.h:16,<br>
from /home/padmec/Downloads/Remeshing__project/src/Remover.cpp:10:<br>/home/padmec/applications/FMDB-2011/include/SPoint3.h: In function ‘SPoint3 operator+(const SPoint3&, const SPoint3&)’:<br>/home/padmec/applications/FMDB-2011/include/SPoint3.h:85:16: error: redefinition of ‘SPoint3 operator+(const SPoint3&, const SPoint3&)’<br>
/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:49:16: error: ‘SPoint3 operator+(const SPoint3&, const SPoint3&)’ previously defined here<br>/home/padmec/applications/FMDB-2011/include/SPoint3.h: In function ‘SPoint3 operator-(const SPoint3&, const SPoint3&)’:<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:88:16: error: redefinition of ‘SPoint3 operator-(const SPoint3&, const SPoint3&)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:52:16: error: ‘SPoint3 operator-(const SPoint3&, const SPoint3&)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h: At global scope:<br>/home/padmec/applications/FMDB-2011/include/SPoint3.h:91:13: error: redefinition of ‘void SPoint3::setPosition(double, double, double)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:55:13: error: ‘void SPoint3::setPosition(double, double, double)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:94:13: error: redefinition of ‘void SPoint3::getPosition(double*, double*, double*) const’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:58:13: error: ‘void SPoint3::getPosition(double*, double*, double*) const’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:97:13: error: redefinition of ‘void SPoint3::position(double*) const’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:61:13: error: ‘void SPoint3::position(double*) const’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:100:15: error: redefinition of ‘double SPoint3::x() const’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:64:15: error: ‘double SPoint3::x() const’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:103:15: error: redefinition of ‘double SPoint3::y() const’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:67:15: error: ‘double SPoint3::y() const’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:106:15: error: redefinition of ‘double SPoint3::z() const’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:70:15: error: ‘double SPoint3::z() const’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:109:18: error: redefinition of ‘SPoint3& SPoint3::operator=(const SPoint3&)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:73:18: error: ‘SPoint3& SPoint3::operator=(const SPoint3&)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:112:13: error: redefinition of ‘void SPoint3::operator+=(const SPoint3&)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:76:13: error: ‘void SPoint3::operator+=(const SPoint3&)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:115:13: error: redefinition of ‘void SPoint3::operator-=(const SPoint3&)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:79:13: error: ‘void SPoint3::operator-=(const SPoint3&)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:118:13: error: redefinition of ‘void SPoint3::operator*=(double)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:82:13: error: ‘void SPoint3::operator*=(double)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:121:16: error: redefinition of ‘SPoint3 SPoint3::operator*(double)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:88:16: error: ‘SPoint3 SPoint3::operator*(double)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:124:16: error: redefinition of ‘double& SPoint3::operator[](int)’<br>/home/padmec/Desktop/gmsh/gmsh/Geo/SPoint3.h:91:16: error: ‘double& SPoint3::operator[](int)’ previously defined here<br>
/home/padmec/applications/FMDB-2011/include/SPoint3.h:127:15: error: redefinition of ‘double SPoint3::operator[](int) const’<br>....<br>In file included from /home/padmec/Desktop/gmsh/gmsh/Numeric/Numeric.h:13:0,<br> from /home/padmec/Desktop/gmsh/gmsh/Geo/GFace.h:19,<br>
from /home/padmec/Desktop/gmsh/gmsh/Geo/GModel.h:16,<br> from /home/padmec/Downloads/Remeshing__project/src/Remover.cpp:10:<br>/home/padmec/applications/FMDB-2011/include/SVector3.h:27:7: error: redefinition of ‘class SVector3’<br>
/home/padmec/Desktop/gmsh/gmsh/Geo/SVector3.h:15:7: error: previous definition of ‘class SVector3’<br>/home/padmec/applications/FMDB-2011/include/SVector3.h:96:16: error: redefinition of ‘double& SVector3::operator[](int)’<br>
/home/padmec/Desktop/gmsh/gmsh/Geo/SVector3.h:40:11: error: ‘double& SVector3::operator[](int)’ previously defined here<br>/home/padmec/applications/FMDB-2011/include/SVector3.h:99:15: error: redefinition of ‘double SVector3::operator[](int) const’<br>
/home/padmec/Desktop/gmsh/gmsh/Geo/SVector3.h:41:10: error: ‘double SVector3::operator[](int) const’ previously defined here<br>/home/padmec/applications/FMDB-2011/include/SVector3.h:102:16: error: redefinition of ‘double& SVector3::operator()(int)’<br>
/home/padmec/Desktop/gmsh/gmsh/Geo/SVector3.h:42:11: error: ‘double& SVector3::operator()(int)’ previously defined here<br>/home/padmec/applications/FMDB-2011/include/SVector3.h:105:15: error: redefinition of ‘double SVector3::operator()(int) const’<br>
/home/padmec/Desktop/gmsh/gmsh/Geo/SVector3.h:43:10: error: ‘double SVector3::operator()(int) const’ previously defined here</b></font><br>"<br>Anyone used FMDB and GMSH in a same project? Anyone saw similar errors?<br>
<br>Thanks,<br>Best Regards<br>Bruno Correia<br><br>--------------------<br>
<pre>Hi Bruno,
try to add
#include "MEdge.h"
#include "MFace.h"
at the beginning of your code to remove the errors you see. I'm not a cmake
expert either, but I think that the recommended practice is to use
target_link_libraries(TARGET_NAME lib1 lib2 ...) and not link_directories.
Best regards,
Martin Vymazal </pre><div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">2013/1/3 Bruno Correia da Silva <span dir="ltr"><<a href="mailto:bcs2@cin.ufpe.br" target="_blank">bcs2@cin.ufpe.br</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry,<br>
<br>
I'm using ubuntu 12.04.<br>
<br>
att.<br>
Bruno Correia<br>
<br>
2013/1/3 Bruno Correia da Silva <<a href="mailto:bcs2@cin.ufpe.br" target="_blank">bcs2@cin.ufpe.br</a>>:<br>
<div><div>> Hey guys,<br>
><br>
> I'm newbie in CMake and linux and i'm still have problems to put<br>
> gmsh in my project to make a call from source code.<br>
><br>
> When I add this line in my in my root project path, in file CMakeLists.txt:<br>
> "<br>
> #GMSH<br>
> SET (GMSH_LIB_PATH "/home/padmec/gmsh/lib")<br>
> link_directories(${GMSH_LIB_PATH})<br>
> link_libraries(Gmsh)<br>
> SET (GMSH_INCLUDE_PATH "/home/padmec/gmsh/include/gmsh")<br>
> include_directories(${GMSH_INCLUDE_PATH})<br>
> "<br>
><br>
> And when i only add this lines in my cpp file:<br>
> "<br>
> #include "Gmsh.h"<br>
> #include "GModel.h"<br>
> #include "MElement.h"<br>
> #include "MVertex.h"<br>
> #include <iostream><br>
><br>
> "<br>
> Show me this error.<br>
> "<br>
><br>
> In file included from<br>
> /home/padmec/Downloads/Remeshing__project/src/Remover.cpp:11:0:<br>
> /home/padmec/gmsh/include/gmsh/MElement.h: At global scope:<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:123:11: error: ‘MEdge’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:126:34: error: ‘MEdge’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:126:42: error: ISO C<br>
> forbids declaration of ‘edge’ with no type [-fpermissive]<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:143:11: error: ‘MFace’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:146:34: error: ‘MFace’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:146:42: error: ISO C<br>
> forbids declaration of ‘face’ with no type [-fpermissive]<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:364:11: error: ‘MEdge’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:369:10: error: ‘MEdge’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:382:11: error: ‘MFace’ does<br>
> not name a type<br>
> /home/padmec/gmsh/include/gmsh/MElement.h:387:10: error: ‘MFace’ does<br>
> not name a type<br>
> make[2]: Leaving directory `/home/padmec/Downloads/Remeshing__project'<br>
><br>
> "<br>
> Let's go to the asking:<br>
> First, someone saw this error before?<br>
> Second, someplace has a explicit way to add gmsh in a project using CMake?<br>
> I saw tutorial folders in gmsh source code, but doesn't help so much.<br>
><br>
> Best regards<br>
> att.<br>
> Bruno Correia<br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>