News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Problem building ttmath library in 64 bit Windows.

Started by Zachary1234, October 23, 2018, 03:55:35 AM

Previous topic - Next topic

stahta01

#15
Add the search path to the include folder!

Edit1: Or you can use my project that has the search path already added; note you have to extract the project to the correct location!

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234

I have done this and I am still getting my four errors.  Is there anything else that I can do?


-------------- Build: Release in Numbers (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2 -m64 -IC:\Users\User\Desktop\ttmath-0.9.3\ttmath -c C:\Users\User\Desktop\ttmath-0.9.3\samples\big.cpp -o obj\Release\ttmath-0.9.3\samples\big.o
g++.exe -Wall -fexceptions -O2 -m64 -IC:\Users\User\Desktop\ttmath-0.9.3\ttmath -c C:\Users\User\Desktop\ttmath-0.9.3\samples\big2.cpp -o obj\Release\ttmath-0.9.3\samples\big2.o
g++.exe -Wall -fexceptions -O2 -m64 -IC:\Users\User\Desktop\ttmath-0.9.3\ttmath -c C:\Users\User\Desktop\ttmath-0.9.3\samples\int.cpp -o obj\Release\ttmath-0.9.3\samples\int.o
g++.exe -Wall -fexceptions -O2 -m64 -IC:\Users\User\Desktop\ttmath-0.9.3\ttmath -c C:\Users\User\Desktop\ttmath-0.9.3\samples\parser.cpp -o obj\Release\ttmath-0.9.3\samples\parser.o
C:\Users\User\Desktop\ttmath-0.9.3\samples\parser.cpp:1:27: fatal error: ttmath/ttmath.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))

C:\Users\User\Desktop\ttmath-0.9.3\samples\big2.cpp:1:27: fatal error: ttmath/ttmath.h: No such file or directory
C:\Users\User\Desktop\ttmath-0.9.3\samples\big.cpp:1:27: fatal error: ttmath/ttmath.h: No such file or directory
C:\Users\User\Desktop\ttmath-0.9.3\samples\int.cpp:1:27: fatal error: ttmath/ttmath.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
4 error(s), 0 warning(s) (0 minute(s), 0 second(s))

compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
4 error(s), 0 warning(s) (0 minute(s), 0 second(s))

compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
4 error(s), 0 warning(s) (0 minute(s), 0 second(s))


stahta01

Enter the correct path.
-IC:\Users\User\Desktop\ttmath-0.9.3\ttmath Wrong
-IC:\Users\User\Desktop\ttmath-0.9.3            Right

Quote
Project -> Build Options
Make sure project is selected in left hand pane
Tab: Search Directory
Sub-Tab: Compiler
Click on Add button
Click on folder open icon
Enter path of "C:\Users\User\Desktop\ttmath-0.9.3" without double quotes in text box next to "Folder:"
Click on OK
Click "Yes" to keep this relative

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234

I have done this and am still getting the following errors:
Is there a simple solution to what is going on?

stahta01

Quote from: Zachary1234 on October 30, 2018, 05:20:21 AM
I have done this and am still getting the following errors:
Is there a simple solution to what is going on?

You failed to edit the program header file correctly.
I have no idea how little you know; I thought you would either know what a patch file meant or ask what it meant.

- means remove this line
+ means add this line

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234

#20
I have made the following changes, commenting out and replacing:

- typedef unsigned long uint;
+ typedef uint64_t uint;

- typedef signed long sint;
- #endif
+ typedef int64_t sint;
+ #endif

Are these the only removes and add changes, in these places,
inside ttmathtypes.h, that I need to make?

I am still getting three little errors left in ttmathtypes.h,
on lines 181, 202 and 236.

stahta01

Quote from: Zachary1234 on October 30, 2018, 05:35:02 AM
I have made the following changes, commenting out and replacing:

- typedef unsigned long uint;
+ typedef uint64_t uint;

- typedef signed long sint;
- #endif
+ typedef int64_t sint;
+ #endif

Are these the only removes and add changes, in these places,
inside ttmathtypes.h, that I need to make?

I am still getting three little errors left in ttmathtypes.h,
on lines 181, 202 and 236.


I have no idea what you did so; I can not help you undo it.

I will attach the edited file because I am afraid you have no idea what to do to edit it.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234

That's fine, and the file that you just uploaded does coincide.

I am now getting those 3 errors inside the file

ttmathmisc.h

at three function declarations on lines 181,202 and 236.

What should I do about them?

stahta01

Quote from: Zachary1234 on October 30, 2018, 05:51:31 AM
That's fine, and the file that you just uploaded does coincide.

I am now getting those 3 errors inside the file

ttmathmisc.h

at three function declarations on lines 181,202 and 236.

What should I do about them?

POST THE ERRORS IN CODE TAGS OR GO AWAY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234


-------------- Build: Release in Numbers (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2 -m64 -I..\ttmath-0.9.3 -c C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h -o ..\ttmath-0.9.3\ttmath\ttmathmisc.h.gch
g++.exe -Wall -fexceptions -O2 -m64 -I..\ttmath-0.9.3 -c C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathobjects.h -o ..\ttmath-0.9.3\ttmath\ttmathobjects.h.gch
C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h:181:8: error: 'uint' does not name a type
static uint CharToDigit(uint c)
        ^
C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h:202:8: error: 'sint' does not name a type
static sint CharToDigit(uint c, uint base)
        ^
C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h:236:8: error: 'uint' does not name a type
static uint DigitToChar(uint digit)
        ^
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))


stahta01

STOP USING PRECOMPILED HEADERS; you do not know enough to use them right.

Find and delete this file "ttmathobjects.h.gch" The gch is the file extension GCC uses for Precompiled Headers (PCH).

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

I give up I have never spent this much time with a newbie who can not learn to use code tags.
Do you just ignore the links I post?

Goodbye.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234

I don't mean to be a pain, it's just that I'm trying to build this library from source in 64 bit mode,
and for reasons I havn't been sure about I'm trying to eliminate the remaining build errors.
I'm just not familar with hour this particular code base, the ttmath library, is coded.

The file ttmathobjects.h.gch does not exist to be deleted, which brings me up to date with you.


-------------- Build: Release in Numbers (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2 -m64 -I..\ttmath-0.9.3 -c C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h -o ..\ttmath-0.9.3\ttmath\ttmathmisc.h.gch
g++.exe -Wall -fexceptions -O2 -m64 -I..\ttmath-0.9.3 -c C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathobjects.h -o ..\ttmath-0.9.3\ttmath\ttmathobjects.h.gch
C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h:181:8: error: 'uint' does not name a type
static uint CharToDigit(uint c)
        ^
C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h:202:8: error: 'sint' does not name a type
static sint CharToDigit(uint c, uint base)
        ^
C:\Users\User\Desktop\ttmath-0.9.3\ttmath\ttmathmisc.h:236:8: error: 'uint' does not name a type
static uint DigitToChar(uint digit)
        ^
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))


stahta01

STOP TRYING TO COMPILE THE HEADERS.

Remove them from the project if that is the only way you know to stop trying to compile them.

READ THIS LINK OR I WILL ASK YOU TO BE BANNED FROM THIS WEBSITE.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Zachary1234

Okay then.  Only including the 5 classes inside samples, I am still left with:


-------------- Build: Release in Numbers (compiler: GNU GCC Compiler)---------------

g++.exe  -o bin\Release\Numbers.exe obj\Release\ttmath-0.9.3\samples\big.o obj\Release\ttmath-0.9.3\samples\big2.o obj\Release\ttmath-0.9.3\samples\int.o obj\Release\ttmath-0.9.3\samples\parser.o obj\Release\ttmath-0.9.3\samples\uint.o obj\Release\Numbers\main.o  -s -m64 
obj\Release\ttmath-0.9.3\samples\big2.o:big2.cpp:(.text+0x10): multiple definition of `SimpleCalculating(ttmath::Big<1ull, 2ull> const&, ttmath::Big<1ull, 2ull> const&)'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text+0x10): first defined here
obj\Release\ttmath-0.9.3\samples\big2.o:big2.cpp:(.text+0x290): multiple definition of `CalculatingWithCarry(ttmath::Big<1ull, 2ull> const&, ttmath::Big<1ull, 2ull> const&)'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text+0x290): first defined here
obj\Release\ttmath-0.9.3\samples\big2.o:big2.cpp:(.text.startup+0x0): multiple definition of `main'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text.startup+0x0): first defined here
obj\Release\ttmath-0.9.3\samples\int.o:int.cpp:(.text.startup+0x0): multiple definition of `main'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text.startup+0x0): first defined here
obj\Release\ttmath-0.9.3\samples\parser.o:parser.cpp:(.text.startup+0x0): multiple definition of `main'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text.startup+0x0): first defined here
obj\Release\ttmath-0.9.3\samples\uint.o:uint.cpp:(.text.startup+0x0): multiple definition of `main'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text.startup+0x0): first defined here
obj\Release\Numbers\main.o:main.cpp:(.text.startup+0x0): multiple definition of `main'
obj\Release\ttmath-0.9.3\samples\big.o:big.cpp:(.text.startup+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
5 error(s), 0 warning(s) (0 minute(s), 1 second(s))