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?
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.
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.
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 (https://www.ttmath.org/forum)
Tim S.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
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
$ ls ttmath-0.9.3
bin/ CHANGELOG COPYRIGHT README samples/ ttmath/ ttmath.cbp ttmath.zip
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
I have done this and am still getting the following errors:
Is there a simple solution to what is going on?
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.
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?
-------------- 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))
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.
I simply need to be able to compile a third party library, in 64 bint windows, without any errors.ttmath is a template header-only library you DO NOT and you CAN NOT compile it (as a DLL/library). You simply include the headers to the application and you are done!