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

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Problem building ttmath library in 64 bit Windows.
« on: October 23, 2018, 03:55:35 am »
I am running 64 bit Windows 10 Home edition.  I am using the 64 bit TDM C++ compiler.
I am running Code::Blocks 17.12.

I am trying to compile a 64 bit .dll file for the ttmath library.

I have imported all source files and all headers.  There are no further dependencies.
Code::Blocks seems to insist on importing any header and source directories
into separate folders named Sources and Headers.

So now, for reasons I cannot repair, it seems that certain #include statements
fail to find certain .h files.  Can someone reply to me, telling me how
to get this to compile (build) the .dll while detecting the .h files,
which are in fact present?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Problem building ttmath library in 64 bit Windows.
« Reply #2 on: October 23, 2018, 10:29:01 am »
Quote
It does not need to be compiled first because the whole library is written as the C++ templates.
Have you read this in the main ttmath page?
This means that the library is header only, so there isn't anything you can put in a dll.
You just include it in your executable project, set the correct search path for the compiler (project -> build options -> search path -> compiler) and you're done.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #3 on: October 29, 2018, 06:05:51 am »
-I have tried doing this too, but the only thing that it gives me is the same four errors;
that apparently four files in the samples directory can't find ttmath.h,
a situation that I don't know how to rectify.  I'm getting the same error
messages as in the attached images.  What do I do to fix things from here?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Problem building ttmath library in 64 bit Windows.
« Reply #4 on: October 29, 2018, 08:44:57 am »
You just include it in your executable project, set the correct search path for the compiler (project -> build options -> search path -> compiler) and you're done.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Problem building ttmath library in 64 bit Windows.
« Reply #5 on: October 29, 2018, 10:58:54 am »
I have done this, and am know getting reams of errors.  I believe they are all preprocessing ones.

Nonetheless, I have seem to come as close as either just 4 error messages, failing to detect four .h files,
or reams of (I've no idea).  Is there yet a way to surmount these problems?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #6 on: October 29, 2018, 12:39:28 pm »
I have done this, and am know getting reams of errors.  I believe they are all preprocessing ones.

Nonetheless, I have seem to come as close as either just 4 error messages, failing to detect four .h files,
or reams of (I've no idea).  Is there yet a way to surmount these problems?

Once you learn how to post a CB build log, you should find a website to help you learn how to program.
This website is not an how to program website.

Edit: TTMATH_NOASM define stops it from trying to use the assembly code that is giving errors.
Edit2: I am guessing the 64 bit build is not compatible with MinGW GCC; likely need Linux or maybe Cygwin GCC for 64 bit builds.

Tim S.
« Last Edit: October 29, 2018, 05:59:56 pm 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

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #7 on: October 29, 2018, 08:43:37 pm »
Once you learn how to post a CB build log, you should find a website to help you learn how to program.
This website is not an how to program website.

Edit: TTMATH_NOASM define stops it from trying to use the assembly code that is giving errors.
Edit2: I am guessing the 64 bit build is not compatible with MinGW GCC; likely need Linux or maybe Cygwin GCC for 64 bit builds.

Tim S.

You might try reading or posting on https://www.ttmath.org/forum

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

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #8 on: October 29, 2018, 08:45:31 pm »
Once you learn how to post a CB build log, you should find a website to help you learn how to program.
This website is not an how to program website.

Edit: TTMATH_NOASM define stops it from trying to use the assembly code that is giving errors.
Edit2: I am guessing the 64 bit build is not compatible with MinGW GCC; likely need Linux or maybe Cygwin GCC for 64 bit builds.

Tim S.

You might try reading or posting on https://www.ttmath.org/forum

Tim S.

Read at least this post https://www.ttmath.org/forum/can_t_build_samples_in_samples_directory._using_windows_10_and_mingw64

Edit: On rereading that post does not help very much.

Edit2: Link to code fix for svn trunk https://www.ttmath.org/forum/patch_for_building_64_bit_using_windows_mingw64_gcc

Tim S.
« Last Edit: October 29, 2018, 09:26:33 pm 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 #9 on: October 30, 2018, 01:22:42 am »
-I am back to the point in my original post, where 4 of my includes inside the samples
directory cannot find ttmath.h

-I have used the Windows path variable, as well as the Code::Blocks
build options search directories, still to no success.

-I am using version 0.9.3 of ttmath.

-What is the one little thing I clearly need to fix so that
these #include statements can pick up ttmath.h ?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
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 #11 on: October 30, 2018, 02:12:17 am »
Is this particular build log attachment of any further explanatory use?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #12 on: October 30, 2018, 02:28:30 am »
So, do you want to add the project search path so the project can find the header?

If you do not know how, state that!

Edit: You should only try to build one sample C++ file per target/project till you get that one to work.

Tim S.
« Last Edit: October 30, 2018, 02:32:40 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

Online stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Problem building ttmath library in 64 bit Windows.
« Reply #13 on: October 30, 2018, 03:03:35 am »
Remember to fix the ttmath library code!

Edit: Attached my test project as an zip file.

Code
Index: ttmath/ttmathtypes.h 
============================================================ =======
--- ttmath/ttmathtypes.h (revision 1132)
+++ ttmath/ttmathtypes.h (working copy)
@@ -235,13 +235,13 @@
/*!
on 64bit platforms one word (uint, sint) will be equal 64bits
*/
- typedef unsigned long uint;
+ typedef uint64_t uint;

/*!
on 64bit platforms one word (uint, sint) will be equal 64bits
*/
- typedef signed long sint;
- #endif
+ typedef int64_t sint;
+ #endif

/*!
on 64bit platforms we do not define ulint and slint

Edit2: Shows where the CB Project should be extracted
Code
$ ls ttmath-0.9.3
bin/  CHANGELOG  COPYRIGHT  README  samples/  ttmath/  ttmath.cbp  ttmath.zip

Tim S.
« Last Edit: October 30, 2018, 04:34:26 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 #14 on: October 30, 2018, 04:51:22 am »
#include "ttmathbig.h"
#include "ttmathobjects.h"

- typedef unsigned long uint;
+ typedef uint64_t uint;

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

I have made all these changes, and I am still getting the same compilation errors such
as I posted at the very beginning.  I am still getting the same 4 errors that cannot see
my 4 ttmath.h #include statements.  What can I do to repair this?


fatal error ttmath/ttmath.h: No such file or directory
« Last Edit: October 30, 2018, 04:53:20 am by Zachary1234 »