I still have to comment out the #ifndef WIN32 statements in assign_scalar.cpp and assign_scalar.h to complile selfintersect.cpp from gptoolbox on a windows machine:
arch = '64'; % Computer architecture
msvc = '14'; % Version of Visual Studio
boost_version='1_67';
path_to_boost=['C:devboost_' boost_version '_0'];
cgal_version='4.12';
path_to_cgal=['C:devCGAL-' cgal_version];
eigen_version='5a0156e40feb';
path_to_eigen=['C:deveigen-eigen-' eigen_version];
path_to_libigl='C:devlibigl';
path_to_gmp=['C:devCGAL-' cgal_version 'auxiliarygmp'];
%%
MEXOPTS={'-v','-largeArrayDims','-DMEX'};
BOOST_INC=['-I' path_to_boost];
BOOST_LIB={['-L' path_to_boost 'lib' arch '-msvc-' msvc '.0'], ...
['-lboost_thread-vc' msvc '0-mt-x' arch '-' boost_version '.lib'], ...
['-lboost_system-vc' msvc '0-mt-x' arch '-' boost_version '.lib']};
CGAL_INC={['-I' path_to_cgal 'buildinclude'], ...
['-I' path_to_cgal 'include']};
CGAL_LIB={['-L' path_to_cgal 'buildlib'],...
['-lCGAL-vc' msvc '0-mt-' cgal_version '.lib'],...
['-lCGAL_Core-vc' msvc '0-mt-' cgal_version '.lib']};
CGAL_FLAGS='CXXFLAGS=$CXXFLAGS -frounding-math';
EIGEN_INC= ['-I' path_to_eigen];
GMP_INC=['-I' path_to_gmp 'include'];
GMP_LIB={['-L' path_to_gmp 'lib'], '-llibgmp-10.lib', '-llibmpfr-4.lib'};
LIBIGL_INC=['-I' path_to_libigl 'include'];
LIBIGL_FLAGS='-DIGL_SKIP';
LIBIGL_LIB={'-DIGL_SKIP'};
LIBIGL_LIBMATLAB='-DIGL_SKIP';
LIBIGL_LIBCGAL='-DIGL_SKIP';
LIBIGL_LIBCORK='-DIGL_NO_CORK';
LIBIGL_BASE={LIBIGL_INC, LIBIGL_FLAGS,LIBIGL_LIB{:}, LIBIGL_LIBMATLAB};
mex( ...
MEXOPTS{:}, ...
LIBIGL_BASE{:},EIGEN_INC, ...
BOOST_INC, BOOST_LIB{:}, ...
CGAL_INC{:},CGAL_LIB{:},CGAL_FLAGS, LIBIGL_LIBCGAL, ...
GMP_INC, GMP_LIB{:},...
'externalgptoolboxmexselfintersect.cpp');
Otherwise I get the error:
Error using mex
selfintersect.cpp
C:devCGAL-4.12includeCGAL/gmpxx.h(45): fatal error C1083: Cannot open include file: 'gmpxx.h': No such file or directory
Although the file exists «gmpxx.h» in the directory
C:devCGAL-4.12includeCGAL
?
I installed GMP and got following error while ‘make’:
In file included from smtparser.yy:22:
../../../../src/global.h:23:19: error: gmpxx.h: No such file or directory
In file included from ../../../../src/egraph/Enode.h:25,
from ../../../../src/egraph/Egraph.h:27,
from smtparser.yy:24:
../../../../src/egraph/EnodeTypes.h:210: error: ISO C++ forbids declaration of �mpq_class� with no type
../../../../src/egraph/EnodeTypes.h:210: error: expected �;� before �*� token
../../../../src/egraph/EnodeTypes.h: In constructor �TermData::TermData(Enode*)�:
../../../../src/egraph/EnodeTypes.h:198: error: class �TermData� does not have any field named �value�
../../../../src/egraph/EnodeTypes.h: At global scope:
../../../../src/egraph/EnodeTypes.h:334: error: ISO C++ forbids declaration of �mpq_class� with no type
../../../../src/egraph/EnodeTypes.h:334: error: expected �;� before �*� token
../../../../src/egraph/EnodeTypes.h: In constructor �SymbData::SymbData(char, int, const char*)�:
../../../../src/egraph/EnodeTypes.h:297: error: class �SymbData� does not have any field named �value�
../../../../src/egraph/EnodeTypes.h: In constructor �SymbData::SymbData(int, const char*)�:
../../../../src/egraph/EnodeTypes.h:316: error: �value� was not declared in this scope
../../../../src/egraph/EnodeTypes.h:316: error: expected type-specifier before �mpq_class�
../../../../src/egraph/EnodeTypes.h:316: error: expected `;’ before �mpq_class�
../../../../src/egraph/EnodeTypes.h: In destructor �SymbData::~SymbData()�:
../../../../src/egraph/EnodeTypes.h:327: error: �value� was not declared in this scope
../../../../src/egraph/EnodeTypes.h:328: error: type �<type error>� argument given to �delete�, expected pointer
In file included from ../../../../src/egraph/Egraph.h:27,
from smtparser.yy:24:
../../../../src/egraph/Enode.h: At global scope:
../../../../src/egraph/Enode.h:163: error: ISO C++ forbids declaration of �mpq_class� with no type
../../../../src/egraph/Enode.h:163: error: expected �;� before �&� token
../../../../src/egraph/Enode.h:188: error: expected �,� or �…� before �&� token
../../../../src/egraph/Enode.h:188: error: ISO C++ forbids declaration of �mpq_class� with no type
../../../../src/egraph/Enode.h: In member function �void Enode::setValue(int)�:
../../../../src/egraph/Enode.h:188: error: �struct TermData� has no member named �value�
../../../../src/egraph/Enode.h:188: error: �v� was not declared in this scope
../../../../src/egraph/Enode.h: At global scope:
../../../../src/egraph/Enode.h:188: warning: unused parameter �mpq_class�
../../../../src/egraph/Enode.h:290: error: expected initializer before �&� token
../../../../src/global.h:92: warning: �const char* logicStr(logic_t)� defined but not used
make[4]: *** [smtparser.lo] Error 1
make[4]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src/parsers/smt’
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src/parsers/smt’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src/parsers’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src’
make: *** [all-recursive] Error 1So I pasted gmpxx.h in /usr/include
using: sudo cp -r /home/harry/Desktop/gmpxx.h /usr/includenow error is:
In file included from ../../../../src/global.h:23,
from smtparser.yy:22:
/usr/include/gmpxx.h: In destructor �__gmp_alloc_cstring::~__gmp_alloc_cstring()�:
/usr/include/gmpxx.h:2096: error: �__gmp_free_func� was not declared in this scope
In file included from smtparser.yy:24:
../../../../src/egraph/Egraph.h: In member function �bool Egraph::checkEmptyExpl()�:
../../../../src/egraph/Egraph.h:286: warning: no return statement in function returning non-void
/usr/share/bison/bison.simple: In function �int smtparse()�:
/usr/share/bison/bison.simple:800: warning: deprecated conversion from string constant to �char*�
/usr/share/bison/bison.simple:925: warning: deprecated conversion from string constant to �char*�
../../../../src/global.h: At global scope:
../../../../src/global.h:92: warning: �const char* logicStr(logic_t)� defined but not used
make[4]: *** [smtparser.lo] Error 1
make[4]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src/parsers/smt’
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src/parsers/smt’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src/parsers’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/harshit/Desktop/OpenSMT/build/src’
make: *** [all-recursive] Error 1Any suggestions? or do I need to contact the developers of code?
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
1 |
|
|
24.01.2015, 21:55. Показов 5631. Ответов 18
Не могу подключить gmp к Visual Studio 2013 Express. Пробовал на 2008 тоже не получается.
__________________
0 |
|
1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
|
|
24.01.2015, 22:07 |
2 |
|
у вас похоже ошибки компиляции, а не линковки. если так, то манипуляции над .lib файлами и dllками ничего не дадут. до них дело не доходит. ошибки полностью выкладывайте. и код, если возомжно.
0 |
|
Comp123 0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
||||
|
24.01.2015, 22:09 [ТС] |
3 |
|||
|
Да я и ничего не делаю. Просто подключаю gmp и пробую компилировать пустой проект.
error C4146: применение унарного минуса к типу без знака; результат оставлен без знака
0 |
|
1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
|
|
24.01.2015, 22:16 |
4 |
|
ну вот я качнул и подцепил gmp.h
0 |
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
24.01.2015, 22:21 [ТС] |
5 |
|
В настойках стоит «Нет (/WX-)». А можете скинуть ссылку откуда вы скачали? Как я понял вы качали уже собранную версию…
0 |
|
DU 1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
||||
|
24.01.2015, 22:24 |
6 |
|||
|
еще вариант — попробуйте задийеблить ворнинги прагмами:
ссылка отсюда: в MSVS 2012 ворнинги и с дизейблом тоже все ок.
1 |
|
Comp123 0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
||||
|
24.01.2015, 22:34 [ТС] |
7 |
|||
|
Ошибка ушла, но теперь если я пытаюсь использовать gmp опять появляются ошибки
Ошибка 1 error LNK2019: ссылка на неразрешенный внешний символ __imp____gmpz_add в функции _main D:c++testtesttest.obj test
0 |
|
1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
|
|
24.01.2015, 22:38 |
8 |
|
далее, читайте инструкцию, которую вы тут указывали.
0 |
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
24.01.2015, 22:41 [ТС] |
9 |
|
Я подключаю её в Компоновщик->Ввод->Дополнительные зависимости. Дописываю туда «gmp.lib;»
0 |
|
1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
|
|
24.01.2015, 22:50 |
10 |
|
если что-то не так, указывайте что не так. даже если ошибки те же, что и в предыдущем шаге.
0 |
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
24.01.2015, 23:07 [ТС] |
11 |
|
error LNK1120: неразрешенных внешних элементов: 2 D:c++testReleasetest.exe test Добавлено через 8 минут
Потом поместил gmp.h в …VCinclude
0 |
|
1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
|
|
24.01.2015, 23:16 |
12 |
|
честно говоря хз в чем у вас там дело.
0 |
|
593 / 531 / 76 Регистрация: 22.03.2011 Сообщений: 1,585 |
|
|
25.01.2015, 02:11 |
13 |
|
Решениеашники и libgmp-3.lib пихай к исходникам, libgmp-3.dll в папку debug, сверху #include «gmp.h» и #pragma comment(lib, «libgmp-3.lib»); всё, больше ничего делать не надо
1 |
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
25.01.2015, 08:55 [ТС] |
14 |
|
OstapBender, сделал как вы писали. Удалил все файлы gmp из папки VC и добавил файлы к проекту. Ситуация осталась такая же
0 |
|
593 / 531 / 76 Регистрация: 22.03.2011 Сообщений: 1,585 |
|
|
25.01.2015, 13:14 |
15 |
|
что значит та же?
0 |
|
Comp123 0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
||||||||||||
|
25.01.2015, 15:25 [ТС] |
16 |
|||||||||||
|
OstapBender, я никакую функцию не вызываю.
И он выдаёт ошибку error C4146: применение унарного минуса к типу без знака; результат оставлен без знака Добавлено через 13 минут
и подключил библиотеку из
static GMP library and header file for Visual C++: gmp-static-vc-4.1.2.zip И всё, кажется, сработало!
Ответ: here is an mpz 15241383936
0 |
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
26.01.2015, 17:57 [ТС] |
17 |
|
Странно, вроде, все функции работают, но если я вызываю mpz_import или mpz_export у меня появляются ошибки при компиляции:
0 |
|
1499 / 1145 / 165 Регистрация: 05.12.2011 Сообщений: 2,279 |
|
|
26.01.2015, 21:25 |
18 |
|
в либе из ссылки таких функций нет. в h файле есть, а в .lib файлах — нет. почему — хз.
1 |
|
0 / 0 / 0 Регистрация: 31.10.2014 Сообщений: 17 |
|
|
27.01.2015, 05:19 [ТС] |
19 |
|
Хорошо, буду пробовать опять свою сборку подключать. Спасибо!
0 |
|
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
27.01.2015, 05:19 |
|
19 |


Сообщение было отмечено Comp123 как решение