Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Cryptic Errors in Code for 3D Graphics Library
2017 年 02 月 12 日
02:50:20
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

After adding the Camera and DrawableObject classes, I get the following errors when using 86Duino Coding 213. Before I added these features the program compiled fine in Coding 213 (but not 300, since DJGPP 6.1.0 is much pickier about conversions between types).

Arduino: Coding 213 (Windows NT (unknown)), Board: "86Duino ONE"

In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_pair.h:59:0,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_algobase.h:64,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\vector:60,
from VR_86Duino.h:14,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:166:28: error: macro "swap" requires 3 arguments, but only 2 given
swap(_Tp& __a, _Tp& __b)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:185:42: error: macro "swap" requires 3 arguments, but only 2 given
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:191:25: error: macro "swap" requires 3 arguments, but only 2 given
swap(__a[__n], __b[__n]);
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\vector:60:0,
from VR_86Duino.h:14,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_algobase.h:103:26: error: macro "swap" requires 3 arguments, but only 2 given
swap(*__a, *__b);
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\vector:61:0,
from VR_86Duino.h:14,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\allocator.h:171:21: error: macro "swap" requires 3 arguments, but only 2 given
swap(__one, __two);
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\vector:64:0,
from VR_86Duino.h:14,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_vector.h:103:36: error: macro "swap" requires 3 arguments, but only 2 given
std::swap(_M_start, __x._M_start);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_vector.h:104:38: error: macro "swap" requires 3 arguments, but only 2 given
std::swap(_M_finish, __x._M_finish);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_vector.h:105:54: error: macro "swap" requires 3 arguments, but only 2 given
std::swap(_M_end_of_storage, __x._M_end_of_storage);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_vector.h:1194:23: error: macro "swap" requires 3 arguments, but only 1 given
swap(vector& __x)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_vector.h:1559:60: error: macro "swap" passed 4 arguments, but takes just 3
swap(vector& __x, vector& __y)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_vector.h:1560:19: error: macro "swap" requires 3 arguments, but only 1 given
{ __x.swap(__y); }
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\vector:65:0,
from VR_86Duino.h:14,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_bvector.h:846:21: error: macro "swap" requires 3 arguments, but only 1 given
swap(vector& __x)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_bvector.h:848:61: error: macro "swap" requires 3 arguments, but only 2 given
std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_bvector.h:849:63: error: macro "swap" requires 3 arguments, but only 2 given
std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_bvector.h:851:32: error: macro "swap" requires 3 arguments, but only 2 given
__x._M_impl._M_end_of_storage);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_bvector.h:861:38: error: macro "swap" requires 3 arguments, but only 2 given
swap(reference __x, reference __y) _GLIBCXX_NOEXCEPT
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_pair.h:59:0,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_algobase.h:64,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\vector:60,
from VR_86Duino.h:14,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:166:5: error: variable or field 'swap' declared void
swap(_Tp& __a, _Tp& __b)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:175:11: error: expected primary-expression before '__tmp'
_Tp __tmp = _GLIBCXX_MOVE(__a);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:175:11: error: expected '}' before '__tmp'
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:176:7: error: '__a' does not name a type
__a = _GLIBCXX_MOVE(__b);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:177:7: error: '__b' does not name a type
__b = _GLIBCXX_MOVE(__tmp);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:185:5: error: variable or field 'swap' declared void
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:7: error: expected primary-expression before 'for'
for (size_t __n = 0; __n < _Nm; ++__n)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:7: error: expected '}' before 'for'
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:28: error: '__n' does not name a type
for (size_t __n = 0; __n < _Nm; ++__n)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:39: error: expected unqualified-id before '++' token
for (size_t __n = 0; __n Preferences.

Below is my code.

I'm not sure whether the issue is my own code or some error having to do with compatibility of the libraries used. I did a check, and could not figure out what was wrong.

2017 年 02 月 12 日
02:58:30
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

I tried to post the code but apparently it is too big since it doesn't catch all the code I copied. How do I attach files in this forum?

Thanks,
George

2017 年 02 月 13 日
09:25:17
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline

Maybe you can use some web to share code like gist(https://gist.github.com/).

cucubutter

2017 年 02 月 14 日
05:08:20
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

OK, I did what you suggested and below is the link. Laugh

source code

2017 年 02 月 16 日
11:56:36
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline

Hi George

I using 86Duino Coding 213 to compile the following code, 86Duino Coding 213 give error that is same as compile your code. I think UTFT.h and move.h all define "swap" so occur conflict.

#include "UTFT.h"
#include "vector"

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

cucubutter

2017 年 02 月 16 日
21:01:31
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

OK, I updated to replace the std::vector implementation with a dynamic memory implementation. I get the following errors.

Arduino: Coding 213 (Windows NT (unknown)), Board: "86Duino ONE"

In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\typeindex:35:0,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
VR_86Duino.cpp: In member function 'void Camera::DrawScene(UTFT)':
VR_86Duino.cpp:247:9: error: 'type_index' is not a member of 'std'
if (std::type_index(object_type) == std::type_index(point_type))
^
VR_86Duino.cpp:247:41: error: 'type_index' is not a member of 'std'
if (std::type_index(object_type) == std::type_index(point_type))
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Apart from the C++11 support issues I need to make a constructor for class Camera that initializes ObjectsInWorld and ObjectsInWorldSize so I don't wind up operating on null values (which will lead to trouble). Once I do that, then I will need to figure out how to either use an alternative implementation for checking type that does not involve type_index, or bypass the IDE and compile directly using the -std=c++11 option.

2017 年 02 月 20 日
16:17:45
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline

I don't know which method is better.
If you want to add compiler flag in IDE, you can edit 86Duino_Coding_Dir\hardware\86duino\x86\platform.txt and add -std=c++11 behind in compiler.cpp.flags.

2017 年 02 月 20 日
20:51:21
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

I did that, but then the compiler wouldn't recognize type_index. So I switched to a simpler implementation using typeid only, and had no more issues with the type checking. However, now the compiler is complaining that there are multiple functions with the same name (at least, that is what I think is going on). Here are the errors.

Arduino: Coding 213 (Windows NT (unknown)), Board: "86Duino ONE"

In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_pair.h:59:0,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_algobase.h:64,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\char_traits.h:39,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\string:40,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:166:28: error: macro "swap" requires 3 arguments, but only 2 given
swap(_Tp& __a, _Tp& __b)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:185:42: error: macro "swap" requires 3 arguments, but only 2 given
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:191:25: error: macro "swap" requires 3 arguments, but only 2 given
swap(__a[__n], __b[__n]);
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\char_traits.h:39:0,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\string:40,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_algobase.h:103:26: error: macro "swap" requires 3 arguments, but only 2 given
swap(*__a, *__b);
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\string:41:0,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\allocator.h:171:21: error: macro "swap" requires 3 arguments, but only 2 given
swap(__one, __two);
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\string:52:0,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\basic_string.h:1809:29: error: macro "swap" requires 3 arguments, but only 1 given
swap(basic_string& __s);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\basic_string.h:2737:47: error: macro "swap" passed 6 arguments, but takes just 3
basic_string& __rhs)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\basic_string.h:2738:23: error: macro "swap" requires 3 arguments, but only 1 given
{ __lhs.swap(__rhs); }
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\string:53:0,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\basic_string.tcc:519:27: error: macro "swap" requires 3 arguments, but only 1 given
swap(basic_string& __s)
^
In file included from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_pair.h:59:0,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\stl_algobase.h:64,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\char_traits.h:39,
from c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\string:40,
from VR_86Duino.h:15,
from VR_86Duino.cpp:10:
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:166:5: error: variable or field 'swap' declared void
swap(_Tp& __a, _Tp& __b)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:175:11: error: expected primary-expression before '__tmp'
_Tp __tmp = _GLIBCXX_MOVE(__a);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:175:11: error: expected '}' before '__tmp'
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:176:7: error: '__a' does not name a type
__a = _GLIBCXX_MOVE(__b);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:177:7: error: '__b' does not name a type
__b = _GLIBCXX_MOVE(__tmp);
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:185:5: error: variable or field 'swap' declared void
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:7: error: expected primary-expression before 'for'
for (size_t __n = 0; __n < _Nm; ++__n)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:7: error: expected '}' before 'for'
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:28: error: '__n' does not name a type
for (size_t __n = 0; __n < _Nm; ++__n)
^
c:\users\cpy\documents\son-george\hardware\tools\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.2\include\c++\bits\move.h:190:39: error: expected unqualified-id before '++' token
for (size_t __n = 0; __n Preferences.

There seems to be some conflict between string and UTFT. I may need to see the source code of UTFT, and change the conflicting names to non-conflicting ones. The updated source code is on github.

Thank you,
George

2017 年 02 月 21 日
16:38:12
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline

Hi George

The error same as before. Because UTFT.h and move.h all define "swap". I recommend that move UTFT.h to all headers behind.

origin (VR_Demo.ino):

#include "VR_86Duino.h"
#include <UTFT.h>
#include <typeinfo>
#include <string>

after move (VR_Demo.ino):

#include "VR_86Duino.h"
#include <typeinfo>
#include <string>
#include <UTFT.h>

cucubutter

2017 年 02 月 25 日
06:01:59
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline
10

I don't understand what you are trying to say, since the #include statements you listed after "VR_86Duino.h" were for whatever reason partially wiped upon posting to the forum. I did some research on how to fix conflicting libraries and found two possibilities: either I can rename whatever offending function was in the UTFT library (unfortunately I could not find the "swap" function in that file, so it is probably in one of its included libraries), or I can create a wrapper library to alter the names of the offending functions (which is a very tedious process but still should work).

2017 年 03 月 02 日
14:19:44
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline
11

I edit the post, i hope it will be useful for you.

cucubutter

Forum Timezone: Asia/Taipei

Most Users Ever Online: 229

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Dinosaur: 27

leutenecker: 13

mrZagg: 10

hippy: 9

UIdahoCIT: 8

smeezekitty: 8

Ekkehard: 8

lukeross: 8

tomka: 8

blaxxun: 7

Member Stats:

Guest Posters: 11

Members: 1488

Moderators: 14

Admins: 5

Forum Stats:

Groups: 2

Forums: 11

Topics: 248

Posts: 1114

Newest Members: fungus, MixThors, Shcookius, modtra, alan1974, Sergeyfup, mitunsclusa, Dennissot, bb4000, Ovendaanalolymn

Moderators: Glaux: 70, uaa: 11, guigra: 17, Android_Lin: 228, bcarroll: 12, cucubutter: 84, recycled-air: 12, stevemork: 16, zerozaber: 52, pongraczi: 26, jejump: 14, George Andrews III: 56, poto: 11, garpastym: 20

Administrators: eveshih: 1, anthony: 31, viky6: 0, roboard: 135, hcl: 1