UPDATE: I've gone through and added some apparently missing dependecies of <cwchar> in the files mentioned in the build log. Now I'm down to what appears to be a problem with my cwchar header itself, where it's missing a bunch of declarations. Here's the new build log:
C:\Windows\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ ncrv3 - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/Michael/Documents/temp/ncrv3'
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/main.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/main.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\postypes.h:40:0,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40,
from C:/Users/Michael/Documents/temp/ncrv3/main.cpp:4:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:177:11: error: '::wcscat' has not been declared
using ::wcscat;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:178:11: error: '::wcscmp' has not been declared
using ::wcscmp;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:179:11: error: '::wcscoll' has not been declared
using ::wcscoll;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:180:11: error: '::wcscpy' has not been declared
using ::wcscpy;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:181:11: error: '::wcscspn' has not been declared
using ::wcscspn;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:183:11: error: '::wcslen' has not been declared
using ::wcslen;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:184:11: error: '::wcsncat' has not been declared
using ::wcsncat;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:185:11: error: '::wcsncmp' has not been declared
using ::wcsncmp;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:186:11: error: '::wcsncpy' has not been declared
using ::wcsncpy;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:188:11: error: '::wcsspn' has not been declared
using ::wcsspn;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:193:11: error: '::wcstok' has not been declared
using ::wcstok;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:196:11: error: '::wcsxfrm' has not been declared
using ::wcsxfrm;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:204:11: error: '::wcschr' has not been declared
using ::wcschr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:205:11: error: '::wcspbrk' has not been declared
using ::wcspbrk;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:206:11: error: '::wcsrchr' has not been declared
using ::wcsrchr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:207:11: error: '::wcsstr' has not been declared
using ::wcsstr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcschr(wchar_t*, wchar_t)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:213:55: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:212:3: note: initializing argument 1 of 'wchar_t* std::wcschr(wchar_t*, wchar_t)'
wcschr(wchar_t* __p, wchar_t __c)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:217:58: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:216:3: note: initializing argument 1 of 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)'
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:221:56: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:220:3: note: initializing argument 1 of 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)'
wcsrchr(wchar_t* __p, wchar_t __c)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:225:57: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:224:3: note: initializing argument 1 of 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)'
wcsstr(wchar_t* __s1, const wchar_t* __s2)
^
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40:0,
from C:/Users/Michael/Documents/temp/ncrv3/main.cpp:4:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h: In static member function 'static std::size_t std::char_traits<wchar_t>::length(const char_type*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:358:26: error: 'wcslen' was not declared in this scope
{ return wcslen(__s); }
^
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
mingw32-make.exe: *** [All] Error 2
ncrv3.mk:105: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/Michael/Documents/temp/ncrv3'
Makefile:4: recipe for target 'All' failed
====1 errors, 4 warnings====
OLD:
I want to include the Box2d (2.3.0) library in my command-line project, which I'm working on in CodeLite 9.2.8. There's nothing in Box2d's documentation about codelite support.
Because there's no relevant setup instructions, I tried taking the entire library (Box2D-Master/Box2D/Box2D) and placing it in my project folder, to dynamically link it. Before I even #include "Box2D/Box2D.h", I get 8 warnings leading to one error in the build. What am I doing wrong?
It looks like some declarations are missing, but I have the entire Box2D library here.
There are also some invalid conversions between const wchar* and wchar*.
In my compiler settings, I HAVE enabled c++11 support with -std=c++11. Here is my entire build log.
C:\Windows\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ ncrv3 - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/Michael/Documents/temp/ncrv3'
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Dynamics/b2Body.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Dynamics_b2Body.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Dynamics/b2World.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Dynamics_b2World.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Dynamics/b2WorldCallbacks.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Dynamics_b2WorldCallbacks.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Collision/b2BroadPhase.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Collision_b2BroadPhase.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\postypes.h:40:0,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\random:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\stl_algo.h:66,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\algorithm:62,
from ./Box2D/Collision/b2BroadPhase.h:25,
from ./Box2D/Dynamics/b2ContactManager.h:22,
from ./Box2D/Dynamics/b2World.h:25,
from C:/Users/Michael/Documents/temp/ncrv3/Box2D/Dynamics/b2World.cpp:19:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:177:11: error: '::wcscat' has not been declared
using ::wcscat;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:178:11: error: '::wcscmp' has not been declared
using ::wcscmp;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:179:11: error: '::wcscoll' has not been declared
using ::wcscoll;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:180:11: error: '::wcscpy' has not been declared
using ::wcscpy;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:181:11: error: '::wcscspn' has not been declared
using ::wcscspn;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:183:11: error: '::wcslen' has not been declared
using ::wcslen;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:184:11: error: '::wcsncat' has not been declared
using ::wcsncat;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:185:11: error: '::wcsncmp' has not been declared
using ::wcsncmp;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:186:11: error: '::wcsncpy' has not been declared
using ::wcsncpy;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:188:11: error: '::wcsspn' has not been declared
using ::wcsspn;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:193:11: error: '::wcstok' has not been declared
using ::wcstok;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:196:11: error: '::wcsxfrm' has not been declared
using ::wcsxfrm;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:204:11: error: '::wcschr' has not been declared
using ::wcschr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:205:11: error: '::wcspbrk' has not been declared
using ::wcspbrk;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:206:11: error: '::wcsrchr' has not been declared
using ::wcsrchr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:207:11: error: '::wcsstr' has not been declared
using ::wcsstr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcschr(wchar_t*, wchar_t)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:213:55: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:212:3: note: initializing argument 1 of 'wchar_t* std::wcschr(wchar_t*, wchar_t)'
wcschr(wchar_t* __p, wchar_t __c)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:217:58: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:216:3: note: initializing argument 1 of 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)'
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:221:56: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:220:3: note: initializing argument 1 of 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)'
wcsrchr(wchar_t* __p, wchar_t __c)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:225:57: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:224:3: note: initializing argument 1 of 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)'
wcsstr(wchar_t* __s1, const wchar_t* __s2)
^
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\postypes.h:40:0,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\random:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\stl_algo.h:66,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\algorithm:62,
from ./Box2D/Collision/b2BroadPhase.h:25,
from C:/Users/Michael/Documents/temp/ncrv3/Box2D/Collision/b2BroadPhase.cpp:19:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:177:11: error: '::wcscat' has not been declared
using ::wcscat;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:178:11: error: '::wcscmp' has not been declared
using ::wcscmp;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:179:11: error: '::wcscoll' has not been declared
using ::wcscoll;
^
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40:0,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\random:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\stl_algo.h:66,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\algorithm:62,
from ./Box2D/Collision/b2BroadPhase.h:25,
from ./Box2D/Dynamics/b2ContactManager.h:22,
from ./Box2D/Dynamics/b2World.h:25,
from C:/Users/Michael/Documents/temp/ncrv3/Box2D/Dynamics/b2World.cpp:19:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h: In static member function 'static std::size_t std::char_traits<wchar_t>::length(const char_type*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:358:26: error: 'wcslen' was not declared in this scope
{ return wcslen(__s); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:180:11: error: '::wcscpy' has not been declared
using ::wcscpy;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:181:11: error: '::wcscspn' has not been declared
using ::wcscspn;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:183:11: error: '::wcslen' has not been declared
using ::wcslen;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:184:11: error: '::wcsncat' has not been declared
using ::wcsncat;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:185:11: error: '::wcsncmp' has not been declared
using ::wcsncmp;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:186:11: error: '::wcsncpy' has not been declared
using ::wcsncpy;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:188:11: error: '::wcsspn' has not been declared
using ::wcsspn;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:193:11: error: '::wcstok' has not been declared
using ::wcstok;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:196:11: error: '::wcsxfrm' has not been declared
using ::wcsxfrm;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:204:11: error: '::wcschr' has not been declared
using ::wcschr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:205:11: error: '::wcspbrk' has not been declared
using ::wcspbrk;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:206:11: error: '::wcsrchr' has not been declared
using ::wcsrchr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:207:11: error: '::wcsstr' has not been declared
using ::wcsstr;
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcschr(wchar_t*, wchar_t)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:213:55: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:212:3: note: initializing argument 1 of 'wchar_t* std::wcschr(wchar_t*, wchar_t)'
wcschr(wchar_t* __p, wchar_t __c)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:217:58: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:216:3: note: initializing argument 1 of 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)'
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:221:56: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:220:3: note: initializing argument 1 of 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)'
wcsrchr(wchar_t* __p, wchar_t __c)
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:225:57: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:224:3: note: initializing argument 1 of 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)'
wcsstr(wchar_t* __s1, const wchar_t* __s2)
^
In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40:0,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\random:40,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\stl_algo.h:66,
from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\algorithm:62,
from ./Box2D/Collision/b2BroadPhase.h:25,
from C:/Users/Michael/Documents/temp/ncrv3/Box2D/Collision/b2BroadPhase.cpp:19:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h: In static member function 'static std::size_t std::char_traits<wchar_t>::length(const char_type*)':
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:358:26: error: 'wcslen' was not declared in this scope
{ return wcslen(__s); }
^
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Collision/b2CollideCircle.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Collision_b2CollideCircle.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Collision/b2CollideEdge.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Collision_b2CollideEdge.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
C:/MinGW/bin/g++.exe -c "C:/Users/Michael/Documents/temp/ncrv3/Box2D/Collision/b2CollidePolygon.cpp" -g -O0 -Wall -std=c++11 -DSFML_STATIC -o ./Debug/Box2D_Collision_b2CollidePolygon.cpp.o -I. -IC:\Users\Michael\Documents\SFML\SFML-2.4.1\include
mingw32-make.exe[1]: *** [Debug/Box2D_Collision_b2BroadPhase.cpp.o] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
ncrv3.mk:190: recipe for target 'Debug/Box2D_Collision_b2BroadPhase.cpp.o' failed
ncrv3.mk:174: recipe for target 'Debug/Box2D_Dynamics_b2World.cpp.o' failed
mingw32-make.exe[1]: *** [Debug/Box2D_Dynamics_b2World.cpp.o] Error 1
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory 'C:/Users/Michael/Documents/temp/ncrv3'
Makefile:4: recipe for target 'All' failed
====1 errors, 8 warnings====
I managed to solve my problem, but it's more of a workaround than an actual fix. All functionality is restored by switching from -std=c++11 to -std=gnu++11. So if you have a similar problem, try switching.
Related
Im trying to build p7 logger on my windows 10 for using with project that builds with mingw 11.2.0 x64 under QT 6.3.0. Build works with VS2015 14.0.25431.01, but it's soo many linker errors while trying to use the build in project. Actualy it looks like no one method from lib hasn't defined reference:
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0x73): undefined reference to `__imp__invalid_parameter_noinfo'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xe1): undefined reference to `__imp__invalid_parameter_noinfo'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0x127): undefined reference to `__imp__invalid_parameter_noinfo'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0x82e): undefined reference to `?Get_ArgV#CProc##SAPEAPEA_WPEB_WPEAH#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0x350): undefined reference to `_vsnwprintf'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0x863): undefined reference to `?Get_ArgV#CProc##SAPEAPEA_WPEAH#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xdfd): undefined reference to `wprintf'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xe0f): undefined reference to `?Free_ArgV#CProc##SAXPEAPEA_W#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xe2a): undefined reference to `?Free_ArgV#CProc##SAXPEAPEA_W#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xe66): undefined reference to `_RTC_CheckStackVars'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xf28): undefined reference to `?Get_Process_Time#CProc##SAIPEAI0#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xf92): undefined reference to `?Lock#CShared##SA?AW4eLock#1#PEB_WAEAPEAXI#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0xfad): undefined reference to `?Read#CShared##SAIPEB_WPEAEG#Z'
C:\dev\qt\projects\SnakemanSignature\libs\libP7Client_v5.6\Libs/p7.lib(p7.dir/Debug/Client.obj):(.text$mn+0x1006): undefined reference to `?UnLink#CShared##SAIPEB_W#Z'
There are 1361 error's like that.
I think problem in using different compilators for lib and project.
Tryna build p7 with mingw32-make, but it requires some <strsafe.h>, got header from here: There is no strsafe.h in MinGW? What to use instead?
and stored it in mingw's include folder.
Aaand here we go again, huh! All brand new errors:
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\Common.h:39:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:33,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'wchar_t* PStrCpy(wchar_t*, size_t, const wchar_t*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:47:57: error: 'wcscpy_s' was not declared in this scope
wcscpy_s((wchar_t*)i_pDst, i_szDst, (wchar_t*)i_pSrc);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'wchar_t* PWStrCpy(tWCHAR*, size_t, const tWCHAR*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:59:57: error: 'wcscpy_s' was not declared in this scope
wcscpy_s((wchar_t*)i_pDst, i_szDst, (wchar_t*)i_pSrc);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'wchar_t* PStrNCpy(wchar_t*, size_t, const wchar_t*, size_t)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:72:74: error: 'wcsncpy_s' was not declared in this scope
wcsncpy_s((wchar_t*)i_pDst, i_szDst, (wchar_t*)i_pSrc, i_pSrcMaxCount);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'void PUStrCpy(tWCHAR*, tUINT32, const wchar_t*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:124:52: error: 'wcscpy_s' was not declared in this scope
wcscpy_s((wchar_t *)i_pDst, i_dwMax_Len, i_pSrc);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'tINT32 PSPrint(wchar_t*, size_t, const wchar_t*, ...)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:140:54: error: '_TRUNCATE' was not declared in this scope
l_iReturn = _vsnwprintf_s(o_pBuffer, i_szBuffer, _TRUNCATE, i_pFormat, l_pVA);
^~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:140:81: error: '_vsnwprintf_s' was not declared in this scope
l_iReturn = _vsnwprintf_s(o_pBuffer, i_szBuffer, _TRUNCATE, i_pFormat, l_pVA);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'tINT32 PSPrint(tACHAR*, size_t, const tACHAR*, ...)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:159:53: error: '_TRUNCATE' was not declared in this scope
l_iReturn = _vsnprintf_s(o_pBuffer, i_szBuffer, _TRUNCATE, i_pFormat, l_pVA);
^~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:159:80: error: '_vsnprintf_s' was not declared in this scope
l_iReturn = _vsnprintf_s(o_pBuffer, i_szBuffer, _TRUNCATE, i_pFormat, l_pVA);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h: In function 'int PVsnprintf(wchar_t*, size_t, const wchar_t*, va_list)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:180:49: error: '_TRUNCATE' was not declared in this scope
return _vsnwprintf_s(o_pBuffer, i_szBuffer, _TRUNCATE, i_pFormat, i_pArgs);
^~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PString.h:180:78: error: '_vsnwprintf_s' was not declared in this scope
return _vsnwprintf_s(o_pBuffer, i_szBuffer, _TRUNCATE, i_pFormat, i_pArgs);
^
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\Common.h:44:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:33,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PThreadShell.h: In static member function 'static tBOOL CThShell::Create(CThShell::tpThreadProc, void*, void**, const wchar_t*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PThreadShell.h:45:39: warning: unused parameter 'i_pName' [-Wunused-parameter]
const tXCHAR *i_pName
^~~~~~~
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\Common.h:47:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:33,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h: In static member function 'static tBOOL CShared::Create(CShared::sShared**, const wchar_t*, const tUINT8*, tUINT16)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:108:18: error: 'ERROR_ALREADY_EXISTS' was not declared in this scope
|| (ERROR_ALREADY_EXISTS == GetLastError())
^~~~~~~~~~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:130:18: error: 'ERROR_ALREADY_EXISTS' was not declared in this scope
|| (ERROR_ALREADY_EXISTS == GetLastError())
^~~~~~~~~~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:152:9: error: '__try' was not declared in this scope
__try
^~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:157:39: error: 'GetExceptionCode' was not declared in this scope
__except ( GetExceptionCode() == EXCEPTION_IN_PAGE_ERROR
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:160:18: error: '__except' was not declared in this scope
)
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h: In static member function 'static tBOOL CShared::Read(const wchar_t*, tUINT8*, tUINT16)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:258:9: error: '__try' was not declared in this scope
__try
^~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:263:40: error: 'GetExceptionCode' was not declared in this scope
__except ( (GetExceptionCode() == EXCEPTION_IN_PAGE_ERROR)
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:266:18: error: '__except' was not declared in this scope
)
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h: In static member function 'static tBOOL CShared::Write(const wchar_t*, const tUINT8*, tUINT16)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:355:9: error: '__try' was not declared in this scope
__try
^~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:360:40: error: 'GetExceptionCode' was not declared in this scope
__except ( (GetExceptionCode() == EXCEPTION_IN_PAGE_ERROR)
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:363:18: error: '__except' was not declared in this scope
)
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h: In static member function 'static CShared::eLock CShared::UnLock(void*&)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:463:17: warning: unused variable 'l_hMutex' [-Wunused-variable]
HANDLE l_hMutex = NULL;
^~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h: In static member function 'static tBOOL CShared::Create_Name(wchar_t*, size_t, CShared::eType, const wchar_t*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:583:23: error: 'swprintf_s' was not declared in this scope
);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PShared.h:594:23: error: 'swprintf_s' was not declared in this scope
);
^
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\Common.h:52:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:33,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PFileSystem.h: In static member function 'static tBOOL CFSYS::Get_TextResource(const wchar_t*, const wchar_t*, wchar_t*, size_t)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PFileSystem.h:430:19: error: 'swprintf_s' was not declared in this scope
);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PFileSystem.h:438:99: error: 'wcsncpy_s' was not declared in this scope
wcsncpy_s(o_pBuffer, i_szBuffer, l_pValue, (l_dwSize > i_szBuffer) ? i_szBuffer : l_dwSize);
^
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\Common.h:54:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:33,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h: At global scope:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h:297:12: error: '__forceinline' does not name a type
static __forceinline tUINT32 Get_Processor()
^~~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h: In static member function 'static tBOOL CProc::Get_Process_Name(tWCHAR*, tINT32)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h:216:68: error: 'wcscpy_s' was not declared in this scope
wcscpy_s((wchar_t*)o_pName, i_iMax_Len, l_pProcess_Name);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h: In static member function 'static tBOOL CProc::Get_Process_Name(tACHAR*, tINT32)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h:238:32: error: 'rsize_t' was not declared in this scope
strcpy_s(o_pName, (rsize_t)i_iMax_Len, "Unknown:Error");
^~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PProcess.h:238:67: error: 'strcpy_s' was not declared in this scope
strcpy_s(o_pName, (rsize_t)i_iMax_Len, "Unknown:Error");
^
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\Common.h:56:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:33,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In constructor 'CJournal::CJournal()':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:93:110: error: 'wcscpy_s' was not declared in this scope
wcscpy_s(m_pTypes_Description[IJournal::eLEVEL_TRACE], FJOURNAL_DESCRIPTION_MAX_LENGTH, L"INFO : ");
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'virtual tBOOL CJournal::Initialize(const wchar_t*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:170:28: error: 'swprintf_s' was not declared in this scope
);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'virtual tBOOL CJournal::Log(IJournal::eLevel, IJournal::hModule, const char*, const char*, tUINT32, const wchar_t*, ...)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:313:34: error: 'swprintf_s' was not declared in this scope
);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:338:34: error: 'swprintf_s' was not declared in this scope
);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:254:33: warning: unused parameter 'i_hModule' [-Wunused-parameter]
IJournal::hModule i_hModule,
^~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:255:33: warning: unused parameter 'i_pFile' [-Wunused-parameter]
const char *i_pFile,
^~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'virtual tBOOL CJournal::Register_Thread(const wchar_t*, tUINT32)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:443:41: warning: unused parameter 'i_pName' [-Wunused-parameter]
tBOOL Register_Thread(const tXCHAR *i_pName, tUINT32 i_dwThreadId)
^~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:443:58: warning: unused parameter 'i_dwThreadId' [-Wunused-parameter]
tBOOL Register_Thread(const tXCHAR *i_pName, tUINT32 i_dwThreadId)
^~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'virtual tBOOL CJournal::Unregister_Thread(tUINT32)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:449:37: warning: unused parameter 'i_dwThreadId' [-Wunused-parameter]
tBOOL Unregister_Thread(tUINT32 i_dwThreadId)
^~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'virtual tBOOL CJournal::Register_Module(const wchar_t*, void**)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:455:41: warning: unused parameter 'i_pName' [-Wunused-parameter]
tBOOL Register_Module(const tXCHAR *i_pName, IJournal::hModule *o_hModule)
^~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'DWORD CJournal::Copy_Bufer(BOOL)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:543:115: error: 'memcpy_s' was not declared in this scope
memcpy_s(m_pWrite_Buffer, FJOURNAL_FILE_BUFFER_LENGTH * sizeof(wchar_t), m_pJournal_Buffer, l_dwResult);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h: In member function 'BOOL CJournal::Remove_Old_Journals(wchar_t*, DWORD, const wchar_t*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:613:108: error: 'swprintf_s' was not declared in this scope
swprintf_s(m_pJournal_Buffer, FJOURNAL_FILE_BUFFER_LENGTH, L"%s\\*.%s", i_pFolder, i_pExtension);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:624:79: error: 'wcscpy_s' was not declared in this scope
wcscpy_s(l_pFileName, MAX_PATH, l_tFind_Info.cFileName);
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PJournal.h:648:56: error: 'wcscpy_s' was not declared in this scope
wcscpy_s(l_pFileName, MAX_PATH, L"9999");
^
In file included from C:/dev/qt/pkg/libP7Client_v5.6/Shared/UDP_NB.h:22:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:35,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h: At global scope:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h:42:9: error: 'addrinfoW' does not name a type
typedef addrinfoW tADDR_INFO;
^~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h: In function 'tBOOL PEnumIpsHlp(const char*, CBList<sockaddr_storage*>*)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h:134:62: error: 'getaddrinfo' was not declared in this scope
if (0 == getaddrinfo(i_pHost, l_pPort, &l_tHint, &l_pInfo))
^
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h:163:29: error: 'freeaddrinfo' was not declared in this scope
freeaddrinfo(l_pInfo);
^
In file included from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:37:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSystem.h: In static member function 'static tBOOL CSys::Get_Host_Name(tACHAR*, size_t)':
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSystem.h:55:56: error: 'strcpy_s' was not declared in this scope
strcpy_s(o_pName, i_szName, "Unknown:Error");
^
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp: In member function 'eClient_Status CClBaical::Init_Sockets(wchar_t**, tINT32)':
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:260:9: error: 'tADDR_INFO' was not declared in this scope
tADDR_INFO *l_pInfo = NULL;
^~~~~~~~~~
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:260:21: error: 'l_pInfo' was not declared in this scope
tADDR_INFO *l_pInfo = NULL;
^~~~~~~
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:261:21: error: 'l_pNext' was not declared in this scope
tADDR_INFO *l_pNext = NULL;
^~~~~~~
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:262:21: error: expected ';' before 'l_tHint'
tADDR_INFO l_tHint;
^~~~~~~
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:264:17: error: 'l_tHint' was not declared in this scope
memset(&l_tHint, 0, sizeof(l_tHint));
^~~~~~~
In file included from C:/dev/qt/pkg/libP7Client_v5.6/Shared/UDP_NB.h:22:0,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\CommonClient.h:35,
from C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:24:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h:57:76: error: 'GetAddrInfoW' was not declared in this scope
o_Res)
^
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:297:18: note: in expansion of macro 'GET_ADDR_INFO'
if (0 == GET_ADDR_INFO(l_pAddr, l_pPort, &l_tHint, &l_pInfo))
^~~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h:59:52: error: 'FreeAddrInfoW' was not declared in this scope
#define FREE_ADDR_INFO(i_Info) FreeAddrInfoW(i_Info)
^
C:\dev\qt\pkg\libP7Client_v5.6\Sources\ClBaical.cpp:330:13: note: in expansion of macro 'FREE_ADDR_INFO'
FREE_ADDR_INFO(l_pInfo);
^~~~~~~~~~~~~~
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h: At global scope:
C:/dev/qt/pkg/libP7Client_v5.6/Shared/Platforms/Windows_x86/PSocket.h:176:14: warning: 'tBOOL PEnumIps(CBList<sockaddr_storage*>*)' defined but not used [-Wunused-function]
static tBOOL PEnumIps(CBList<sockaddr_storage*> *io_pList)
^~~~~~~~
Sources\CMakeFiles\p7.dir\build.make:90: recipe for target 'Sources/CMakeFiles/p7.dir/ClBaical.cpp.obj' failed
mingw32-make[2]: *** [Sources/CMakeFiles/p7.dir/ClBaical.cpp.obj] Error 1
CMakeFiles\Makefile2:132: recipe for target 'Sources/CMakeFiles/p7.dir/all' failed
mingw32-make[1]: *** [Sources/CMakeFiles/p7.dir/all] Error 2
Makefile:134: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I'm stuck at this point. With another strsafe headers from msvc's folders errors in unresolved references to header files occur again and I don't know how to solve this problem. P7 documentation has instructions only about VS building. How to build the library for use in my project?
Hello and thank you for your help in advance (I'm a bit of a newbie). I am on ubuntu 18.
I am trying to install an older version of some software called HepMC (need older version for project) and I had no problem installing the slightly newer version. When I try to build from source I get an error on the make command. I've seen this "all-recurive failed" error all over the web, but the solutions I've seen for other people have seemed to be very software specific and have not helped me.
I am not really sure how to interpret this error and I haven't been able to find a good answer. Any tips or suspicions on what might be going on here would be greatly appreciated. Been bashing my head against this for awhile
Before running make I did
autoreconf -i configure.ac
./configure
and this ran with no errors or warnings.
Here's the snippet where the error seems to begin, I'll attach the full printout from "make" down below.
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:408:80: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^
../HepMC/GenEvent.h:459:71: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenEvent.h:459:71: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:459:80: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^
CommonIO.cc: In member function ‘HepMC::HeavyIon* HepMC::CommonIO::read_heavy_ion(std::istream*)’:
CommonIO.cc:318:9: warning: converting ‘false’ to pointer type ‘HepMC::HeavyIon*’ [-Wconversion-null]
return false;
^~~~~
CommonIO.cc:328:26: warning: converting ‘false’ to pointer type ‘HepMC::HeavyIon*’ [-Wconversion-null]
if( nh == 0 ) return false;
^~~~~
CommonIO.cc: In member function ‘HepMC::PdfInfo* HepMC::CommonIO::read_pdf_info(std::istream*)’:
CommonIO.cc:344:9: warning: converting ‘false’ to pointer type ‘HepMC::PdfInfo*’ [-Wconversion-null]
return false;
^~~~~
CommonIO.cc:356:27: warning: converting ‘false’ to pointer type ‘HepMC::PdfInfo*’ [-Wconversion-null]
if( id1 == 0 ) return false;
^~~~~
CommonIO.cc: In member function ‘HepMC::GenVertex* HepMC::CommonIO::read_vertex(std::istream*, HepMC::TempParticleMap&)’:
CommonIO.cc:374:9: warning: converting ‘false’ to pointer type ‘HepMC::GenVertex*’ [-Wconversion-null]
return false;
^~~~~
CommonIO.cc: In member function ‘HepMC::GenParticle* HepMC::CommonIO::read_particle(std::istream*, HepMC::TempParticleMap&)’:
CommonIO.cc:411:9: warning: converting ‘false’ to pointer type ‘HepMC::GenParticle*’ [-Wconversion-null]
return false;
^~~~~
Makefile:478: recipe for target 'CommonIO.lo' failed
make[1]: *** [CommonIO.lo] Error 1
make[1]: Leaving directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/src'
Makefile:397: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
and here's the full return of make
make
Making all in HepMC
make[1]: Entering directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/HepMC'
make all-am
make[2]: Entering directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/HepMC'
make[2]: Leaving directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/HepMC'
make[1]: Leaving directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/HepMC'
Making all in src
make[1]: Entering directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/src'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../HepMC -I.. -I.. -ansi -pedantic -Wall -g -O2 -MT CommonIO.lo -MD -MP -MF .deps/CommonIO.Tpo -c -o CommonIO.lo CommonIO.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../HepMC -I.. -I.. -ansi -pedantic -Wall -g -O2 -MT CommonIO.lo -MD -MP -MF .deps/CommonIO.Tpo -c CommonIO.cc -fPIC -DPIC -o .libs/CommonIO.o
In file included from ../HepMC/GenEvent.h:123:0,
from ../HepMC/CommonIO.h:15,
from CommonIO.cc:11:
../HepMC/GenVertex.h:173:71: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenVertex.h:173:71: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/GenEvent.h:123:0,
from ../HepMC/CommonIO.h:15,
from CommonIO.cc:11:
../HepMC/GenVertex.h:173:80: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^
../HepMC/GenVertex.h:237:69: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenVertex.h:237:69: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/GenEvent.h:123:0,
from ../HepMC/CommonIO.h:15,
from CommonIO.cc:11:
../HepMC/GenVertex.h:237:78: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
^
../HepMC/GenVertex.h:307:64: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,GenParticle*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenVertex.h:307:64: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/GenEvent.h:123:0,
from ../HepMC/CommonIO.h:15,
from CommonIO.cc:11:
../HepMC/GenVertex.h:307:73: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,GenParticle*,ptrdiff_t>{
^
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:289:69: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenEvent.h:289:69: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:289:78: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
^
../HepMC/GenEvent.h:341:69: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenEvent.h:341:69: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:341:78: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
^
../HepMC/GenEvent.h:408:71: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenEvent.h:408:71: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:408:80: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^
../HepMC/GenEvent.h:459:71: error: ‘ptrdiff_t’ was not declared in this scope
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^~~~~~~~~
../HepMC/GenEvent.h:459:71: note: suggested alternatives:
In file included from /usr/include/c++/7/string:38:0,
from CommonIO.cc:8:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
typedef __PTRDIFF_TYPE__ ptrdiff_t;
^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:232:28: note: ‘std::ptrdiff_t’
In file included from ../HepMC/CommonIO.h:15:0,
from CommonIO.cc:11:
../HepMC/GenEvent.h:459:80: error: template argument 3 is invalid
public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
^
CommonIO.cc: In member function ‘HepMC::HeavyIon* HepMC::CommonIO::read_heavy_ion(std::istream*)’:
CommonIO.cc:318:9: warning: converting ‘false’ to pointer type ‘HepMC::HeavyIon*’ [-Wconversion-null]
return false;
^~~~~
CommonIO.cc:328:26: warning: converting ‘false’ to pointer type ‘HepMC::HeavyIon*’ [-Wconversion-null]
if( nh == 0 ) return false;
^~~~~
CommonIO.cc: In member function ‘HepMC::PdfInfo* HepMC::CommonIO::read_pdf_info(std::istream*)’:
CommonIO.cc:344:9: warning: converting ‘false’ to pointer type ‘HepMC::PdfInfo*’ [-Wconversion-null]
return false;
^~~~~
CommonIO.cc:356:27: warning: converting ‘false’ to pointer type ‘HepMC::PdfInfo*’ [-Wconversion-null]
if( id1 == 0 ) return false;
^~~~~
CommonIO.cc: In member function ‘HepMC::GenVertex* HepMC::CommonIO::read_vertex(std::istream*, HepMC::TempParticleMap&)’:
CommonIO.cc:374:9: warning: converting ‘false’ to pointer type ‘HepMC::GenVertex*’ [-Wconversion-null]
return false;
^~~~~
CommonIO.cc: In member function ‘HepMC::GenParticle* HepMC::CommonIO::read_particle(std::istream*, HepMC::TempParticleMap&)’:
CommonIO.cc:411:9: warning: converting ‘false’ to pointer type ‘HepMC::GenParticle*’ [-Wconversion-null]
return false;
^~~~~
Makefile:478: recipe for target 'CommonIO.lo' failed
make[1]: *** [CommonIO.lo] Error 1
make[1]: Leaving directory '/home/maxfieg/Desktop/FelixResearch/junk/hep_build2/HepMC2.04/src'
Makefile:397: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I am trying to build a simple network using torch. But when I try to build the project it returns some error messages like error: ‘ReLU’ is not a member of ‘torch::nn’
My network definitions is as follows:
#pragma once
#include <torch/torch.h>
class ConvNetImpl : public torch::nn::Module {
public:
explicit ConvNetImpl(int64_t num_classes = 10);
torch::Tensor forward(torch::Tensor x);
private:
torch::nn::Sequential layer1{
torch::nn::Conv2d(torch::nn::Conv2dOptions(1, 16, 5).stride(1).padding(2)),
torch::nn::BatchNorm2d(16),
torch::nn::ReLU(),
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
};
torch::nn::Sequential layer2{
torch::nn::Conv2d(torch::nn::Conv2dOptions(16, 32, 5).stride(1).padding(2)),
torch::nn::BatchNorm2d(32),
torch::nn::ReLU(),
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
};
torch::nn::Linear fc;
};
TORCH_MODULE(ConvNet);
When I try to build with: cmake --build . --config Release
It returns me this message:
[ 33%] Building CXX object CMakeFiles/freespace_torch.dir/src/convnet.cpp.o
In file included from /home/fugurcal/freespace_torch/src/convnet.cpp:2:0:
/home/fugurcal/freespace_torch/include/convnet.h:13:20: error: ‘BatchNorm2d’ is not a member of ‘torch::nn’
torch::nn::BatchNorm2d(16),
^~~~~~~~~~~
/home/fugurcal/freespace_torch/include/convnet.h:13:20: note: suggested alternative: ‘BatchNorm’
torch::nn::BatchNorm2d(16),
^~~~~~~~~~~
BatchNorm
/home/fugurcal/freespace_torch/include/convnet.h:14:20: error: ‘ReLU’ is not a member of ‘torch::nn’
torch::nn::ReLU(),
^~~~
/home/fugurcal/freespace_torch/include/convnet.h:15:20: error: ‘MaxPool2d’ is not a member of ‘torch::nn’
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
^~~~~~~~~
/home/fugurcal/freespace_torch/include/convnet.h:15:41: error: ‘MaxPool2dOptions’ is not a member of ‘torch::nn’
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
^~~~~~~~~~~~~~~~
/home/fugurcal/freespace_torch/include/convnet.h:15:41: note: suggested alternative: ‘Conv2dOptions’
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
^~~~~~~~~~~~~~~~
Conv2dOptions
/home/fugurcal/freespace_torch/include/convnet.h:16:5: error: could not convert ‘{torch::nn::Conv2d((* &(& torch::nn::ConvOptions<2>(1, 16, torch::ExpandingArray<2, long int>(5)).torch::nn::ConvOptions<2>::stride(torch::ExpandingArray<2, long int>(1)))->torch::nn::ConvOptions<2>::padding(torch::ExpandingArray<2, long int>(2)))), <expression error>, <expression error>, <expression error>}’ from ‘<brace-enclosed initializer list>’ to ‘torch::nn::Sequential’
};
^
/home/fugurcal/freespace_torch/include/convnet.h:20:20: error: ‘BatchNorm2d’ is not a member of ‘torch::nn’
torch::nn::BatchNorm2d(32),
^~~~~~~~~~~
/home/fugurcal/freespace_torch/include/convnet.h:20:20: note: suggested alternative: ‘BatchNorm’
torch::nn::BatchNorm2d(32),
^~~~~~~~~~~
BatchNorm
/home/fugurcal/freespace_torch/include/convnet.h:21:20: error: ‘ReLU’ is not a member of ‘torch::nn’
torch::nn::ReLU(),
^~~~
/home/fugurcal/freespace_torch/include/convnet.h:22:20: error: ‘MaxPool2d’ is not a member of ‘torch::nn’
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
^~~~~~~~~
/home/fugurcal/freespace_torch/include/convnet.h:22:41: error: ‘MaxPool2dOptions’ is not a member of ‘torch::nn’
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
^~~~~~~~~~~~~~~~
/home/fugurcal/freespace_torch/include/convnet.h:22:41: note: suggested alternative: ‘Conv2dOptions’
torch::nn::MaxPool2d(torch::nn::MaxPool2dOptions(2).stride(2))
^~~~~~~~~~~~~~~~
Conv2dOptions
/home/fugurcal/freespace_torch/include/convnet.h:23:5: error: could not convert ‘{torch::nn::Conv2d((* &(& torch::nn::ConvOptions<2>(16, 32, torch::ExpandingArray<2, long int>(5)).torch::nn::ConvOptions<2>::stride(torch::ExpandingArray<2, long int>(1)))->torch::nn::ConvOptions<2>::padding(torch::ExpandingArray<2, long int>(2)))), <expression error>, <expression error>, <expression error>}’ from ‘<brace-enclosed initializer list>’ to ‘torch::nn::Sequential’
};
^
CMakeFiles/freespace_torch.dir/build.make:62: recipe for target 'CMakeFiles/freespace_torch.dir/src/convnet.cpp.o' failed
make[2]: *** [CMakeFiles/freespace_torch.dir/src/convnet.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/freespace_torch.dir/all' failed
make[1]: *** [CMakeFiles/freespace_torch.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I know mentioned methods are member of torch::nn. How can I resolve this issue?
Issue solved. While making "cmake -DCMAKE_PREFIX_PATH=/absolute/path/to/libtorch .." my libtorch directory was "/home/user/folder/libtorch". After changing the libtorch directory to "/home/user/libtorch" issue solved.
I'm trying to build an R package which wraps around OpenPano (https://github.com/ppwwyyxx/OpenPano) in order to perform image stitching directly from R.
The package works fine on Linux already. I'm now trying to make sure it also builds on Windows. When I do this, it shows me these compilation issues. Can someone assist in trying to fix these, I have no idea where they come from.
The R package is available at https://github.com/bnosac/image/tree/master/image.OpenPano and contains the following make elements in the R Makevars file:
CXX_STD=CXX11
PKG_LIBS = -ljpeg $(SHLIB_OPENMP_CFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_CPPFLAGS = -I. -isystem third-party -DDEBUG -Wnon-virtual-dtor
SOURCES = lib/polygon.cc lib/debugutils.cc lib/color.cc lib/config.cc lib/timer.cc lib/imgproc.cc lib/kdtree.cc lib/imgio.cc lib/planedrawer.cc lib/matrix.cc lib/utils.cc feature/dist.cc feature/orientation.cc feature/sift.cc feature/gaussian.cc feature/feature.cc feature/dog.cc feature/matcher.cc feature/extrema.cc feature/brief.cc stitch/homography.cc stitch/warp.cc stitch/camera_estimator.cc stitch/debug.cc stitch/multiband.cc stitch/transform_estimate.cc stitch/cylstitcher.cc stitch/stitcherbase.cc stitch/camera.cc stitch/stitcher.cc stitch/blender.cc stitch/stitcher_image.cc stitch/incremental_bundle_adjuster.cc third-party/lodepng/lodepng.cc
SOURCES += rcpp-openpano.cpp
SOURCES += RcppExports.cpp
OBJ = $(SOURCES:.cc=.o)
OBJECTS = $(OBJ:.cpp=.o)
This is the compiling information from the R package on Windows
* installing *source* package 'image.OpenPano' ...
** libs
*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++ -std=gnu++11 -I"D:/RCompile/recent/R-3.4.4/include" -DNDEBUG -I. -isystem third-party --std=gnu++11 -DDEBUG -Wnon-virtual-dtor -I"d:/RCompile/CRANpkg/lib/3.4/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.4/RcppEigen/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -fopenmp -O2 -Wall -mtune=core2 -c lib/polygon.cc -o lib/polygon.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++ -std=gnu++11 -I"D:/RCompile/recent/R-3.4.4/include" -DNDEBUG -I. -isystem third-party --std=gnu++11 -DDEBUG -Wnon-virtual-dtor -I"d:/RCompile/CRANpkg/lib/3.4/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.4/RcppEigen/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -fopenmp -O2 -Wall -mtune=core2 -c lib/debugutils.cc -o lib/debugutils.o
In file included from D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/x86intrin.h:29:0,
from D:/Compiler/gcc-4.9.3/mingw_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bits/opt_random.h:33,
from D:/Compiler/gcc-4.9.3/mingw_32/i686-w64-mingw32/include/c++/random:50,
from D:/Compiler/gcc-4.9.3/mingw_32/i686-w64-mingw32/include/c++/bits/stl_algo.h:66,
from D:/Compiler/gcc-4.9.3/mingw_32/i686-w64-mingw32/include/c++/algorithm:62,
from d:/RCompile/CRANpkg/lib/3.4/Rcpp/include/RcppCommon.h:72,
from d:/RCompile/CRANpkg/lib/3.4/Rcpp/include/Rcpp.h:27,
from lib/debugutils.cc:62:
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_cvtsi32_si64(int)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:64:54: error: can't convert between vector values of different size
return (__m64) __builtin_ia32_vec_init_v2si (__i, 0);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function 'int _mm_cvtsi64_si32(__m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:107:53: error: cannot convert '__m64 {aka int}' to '__vector(2) int' for argument '1' to 'int __builtin_ia32_vec_ext_v2si(__vector(2) int, int)'
return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_packs_pi16(__m64, __m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:146:69: error: cannot convert '__v4hi {aka short int}' to '__vector(4) short int' for argument '1' to '__vector(8) char __builtin_ia32_packsswb(__vector(4) short int, __vector(4) short int)'
return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_packs_pi32(__m64, __m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:161:69: error: cannot convert '__m64 {aka int}' to '__vector(2) int' for argument '1' to '__vector(4) short int __builtin_ia32_packssdw(__vector(2) int, __vector(2) int)'
return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_packs_pu16(__m64, __m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:176:69: error: cannot convert '__v4hi {aka short int}' to '__vector(4) short int' for argument '1' to '__vector(8) char __builtin_ia32_packuswb(__vector(4) short int, __vector(4) short int)'
return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_unpackhi_pi8(__m64, __m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:190:70: error: cannot convert '__v8qi {aka char}' to '__vector(8) char' for argument '1' to '__vector(8) char __builtin_ia32_punpckhbw(__vector(8) char, __vector(8) char)'
return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_unpackhi_pi16(__m64, __m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:204:70: error: cannot convert '__v4hi {aka short int}' to '__vector(4) short int' for argument '1' to '__vector(4) short int __builtin_ia32_punpckhwd(__vector(4) short int, __vector(4) short int)'
return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2);
^
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h: In function '__m64 _mm_unpackhi_pi32(__m64, __m64)':
D:/Compiler/gcc-4.9.3/mingw_32/lib/gcc/i686-w64-mingw32/4.9.3/include/mmintrin.h:218:70: error: cannot convert '__m64 {aka int}' to '__vector(2) int' for argument '1' to '__vector(2) int __builtin_ia32_punpckhdq(__vector(2) int, __vector(2) int)'
return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2);
^
........
In file included from d:/RCompile/CRANpkg/lib/3.4/Rcpp/include/Rcpp.h:66:0,
from lib/debugutils.cc:62:
d:/RCompile/CRANpkg/lib/3.4/Rcpp/include/Rcpp/Module.h: At global scope:
d:/RCompile/CRANpkg/lib/3.4/Rcpp/include/Rcpp/Module.h:448:34: warning: 'moduleSym' defined but not used [-Wunused-variable]
static VARIABLE_IS_NOT_USED SEXP moduleSym = NULL;
^
make: *** [lib/debugutils.o] Error 1
Warning: running command 'make -f "Makevars" -f "D:/RCompile/recent/R-3.4.4/etc/i386/Makeconf" -f "D:/RCompile/recent/R-3.4.4/etc/i386/Makevars.site" -f "D:/RCompile/recent/R-3.4.4/share/make/winshlib.mk" CXX='$(CXX11) $(CXX11STD)' CXXFLAGS='$(CXX11FLAGS)' CXXPICFLAGS='$(CXX11PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX11LDFLAGS)' SHLIB_LD='$(SHLIB_CXX11LD)' SHLIB="image.OpenPano.dll" ' had status 2
ERROR: compilation failed for package 'image.OpenPano'
* removing 'd:/RCompile/CRANguest/R-release/lib/image.OpenPano'
In R CMD INSTALL
I have successfully generated the .py and .cpp files needed using:
swig -c++ -python sf_c_api.i
but now I'm trying to make the shared object (.so) and I'm getting swamped with errors.
g++ -Wall -g -fPIC -I/usr/include/python2.6 -c atob.c fish.c maby_swap.c pwd_file.c pwd.c setup_fish.c shs.c sf_c_api.cpp sha1.cpp sf_c_api_wrap.cpp
Can anyone make heads or tails of this g++ output?
In file included from /usr/include/python2.6/Python.h:8,
from sf_c_api_wrap.cpp:149:
/usr/include/python2.6/pyconfig.h:1038:1: warning: "_XOPEN_SOURCE" redefined
<built-in>: warning: this is the location of the previous definition
In file included from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/postypes.h:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/string:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/stdexcept:39,
from sf_c_api_wrap.cpp:3024:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:143: error: ‘::btowc’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:148: error: ‘::fwide’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:149: error: ‘::fwprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:150: error: ‘::fwscanf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:153: error: ‘::mbrlen’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:154: error: ‘::mbrtowc’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:155: error: ‘::mbsinit’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:156: error: ‘::mbsrtowcs’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:159: error: ‘::swprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:160: error: ‘::swscanf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:162: error: ‘::vfwprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:166: error: ‘::vswprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:170: error: ‘::vwprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:174: error: ‘::wcrtomb’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:185: error: ‘::wcsrtombs’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:195: error: ‘::wctob’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:196: error: ‘::wmemcmp’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:197: error: ‘::wmemcpy’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:198: error: ‘::wmemmove’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:199: error: ‘::wmemset’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:200: error: ‘::wprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:201: error: ‘::wscanf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:205: error: ‘::wcsstr’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:206: error: ‘::wmemchr’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar: In function ‘wchar_t* std::wcsstr(wchar_t*, const wchar_t*)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:223: error: invalid conversion from ‘const wchar_t*’ to ‘wchar_t*’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:223: error: initializing argument 1 of ‘wchar_t* std::wcsstr(wchar_t*, const wchar_t*)’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar: In function ‘wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:227: error: invalid conversion from ‘const wchar_t*’ to ‘wchar_t*’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:227: error: initializing argument 1 of ‘wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)’
In file included from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/string:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/stdexcept:39,
from sf_c_api_wrap.cpp:3024:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static int std::char_traits<wchar_t>::compare(const wchar_t*, const wchar_t*, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:330: error: ‘wmemcmp’ was not declared in this scope/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static const wchar_t* std::char_traits<wchar_t>::find(const wchar_t*, size_t, const wchar_t&)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:338: error: initializing argument 1 of ‘wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::move(wchar_t*, const wchar_t*, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:342: error: ‘wmemmove’ was not declared in this scope
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::copy(wchar_t*, const wchar_t*, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:346: error: ‘wmemcpy’ was not declared in this scope
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::assign(wchar_t*, size_t, wchar_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:350: error: ‘wmemset’ was not declared in this scope
/../include/c++/4.4.4/bits/char_traits.h:338: error: invalid conversion from ‘const wchar_t*’ to ‘wchar_t*’
I found a solution.
The problem is that under solaris:
If -D_XOPEN_SOURCE_EXTENDED=1, g++ cannot compile even an empty body
that #includes <iostream>. If it's undefined, then gcc cannot compile
C code.
[source]
and from /usr/include/python2.6/pyconfig.h:
/* Define to activate Unix95-and-earlier features */
#define _XOPEN_SOURCE_EXTENDED 1
Removing the XOPEN definitions fixed my problem.