Author Topic: Problem building ttmath library in 64 bit Windows.  (Read 12808 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #15 on: October 30, 2018, 04:53:52 am »
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.
« Last Edit: October 30, 2018, 04:56:46 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #16 on: October 30, 2018, 05:04:09 am »
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))
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #17 on: October 30, 2018, 05:06:09 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #18 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #19 on: October 30, 2018, 05:22:48 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #20 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.
« Last Edit: October 30, 2018, 05:38:38 am by Zachary1234 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #21 on: October 30, 2018, 05:42:39 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #22 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #23 on: October 30, 2018, 05:52:29 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #24 on: October 30, 2018, 05:54:54 am »

-------------- 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))
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #25 on: October 30, 2018, 05:58:34 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #26 on: October 30, 2018, 06:01:08 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #27 on: October 30, 2018, 06:02:39 am »
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))
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #28 on: October 30, 2018, 06:05:37 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #29 on: October 30, 2018, 06:07:58 am »
Okay then.  Only including the 5 classes inside samples, I am still left with:

Code
-------------- 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))