Kangaroo icon indicating copy to clipboard operation
Kangaroo copied to clipboard

Ubuntu compilation error. Help needed

Open Comarro753 opened this issue 5 years ago • 3 comments

Good day.

How to solve this problem:

 make gpu=1 ccap=20 all
cd obj &&       mkdir -p SECPK1
g++ -DWITHGPU -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/SECPK1/IntGroup.o -c SECPK1/IntGroup.cpp
SECPK1/IntGroup.cpp: In constructor 'IntGroup::IntGroup(int)':
[b]SECPK1/IntGroup.cpp:24:42: error: 'malloc' was not declared in this scope[/b]
   subp = (Int *)malloc(size * sizeof(Int));
                                          ^
SECPK1/IntGroup.cpp: In destructor 'IntGroup::~IntGroup()':
[b]SECPK1/IntGroup.cpp:28:12: error: 'free' was not declared in this scope[/b]
   free(subp);
            ^
Makefile:80: recipe for target 'obj/SECPK1/IntGroup.o' failed
make: *** [obj/SECPK1/IntGroup.o] Error 1`

???

Comarro753 avatar Jun 19 '20 22:06 Comarro753

Hi Try to add: #include <stdlib.h> in IntGourp.cpp

#include "IntGroup.h"
#include <stdlib.h>

using namespace std;

JeanLucPons avatar Jun 20 '20 05:06 JeanLucPons

Enother error:

main.cpp:335:13: error: 'exit' was not declared in this scope exit(0);

How to fix it ?

Thx!

Comarro753 avatar Jun 20 '20 09:06 Comarro753

Try #include <stdlib.h> in main.cpp

JeanLucPons avatar Jun 22 '20 08:06 JeanLucPons