How to import existing OpenSsl project into Xcode - c++

I would like to modify the existing Openssl project. So I downloaded the source code of openssl from GitHub https://github.com/openssl/openssl
and follow the instruction http://openssl.6102.n7.nabble.com/Easy-inclusion-of-OpenSSL-into-iOS-projects-agileinfoways-com-td48905.html on how to include Openssl into Xcode.
However, when i tried to build one of the file (enc.c) from OpenSsl project, it run into 6 errors and 7 warning.
/usr/local/opt/openssl/include/openssl/ecdsa.h
/usr/local/opt/openssl/include/openssl/ecdsa.h:295:14: Parameter
'flags' not found in the function declaration
/usr/local/opt/openssl/include/openssl/ecdsa.h:301:14: Parameter
'ecdsa_method' not found in the function declaration
/usr/local/opt/openssl/include/openssl/ecdsa.h:302:14: Parameter 'name' not found in the function declaration
/Users/maggie/Documents/aes/openssl-master/apps/apps.h
/Users/maggie/Documents/aes/openssl-master/apps/apps.h:421:1: Unknown type name '__owur'
/Users/maggie/Documents/aes/openssl-master/apps/apps.h:421:8: Expected identifier or '('
/Users/maggie/Documents/aes/openssl-master/apps/apps.h:432:1: Unknown type name '__owur'
/Users/maggie/Documents/aes/openssl-master/apps/apps.h:432:8: Expected identifier or '('
/Users/maggie/Documents/aes/openssl-master/apps/progs.h
/Users/maggie/Documents/aes/openssl-master/apps/progs.h:25:1: Type specifier missing, defaults to 'int'
/Users/maggie/Documents/aes/openssl-master/apps/enc.c
/Users/maggie/Documents/aes/openssl-master/apps/enc.c:542:47: Expected ')'
/Users/maggie/Documents/aes/openssl-master/apps/enc.c:543:47: Expected ')'
/Users/maggie/Documents/aes/openssl-master/apps/enc.c:427:33: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int'
/Users/maggie/Documents/aes/openssl-master/apps/enc.c:597:28: Implicit declaration of function 'OPENSSL_hexchar2int' is invalid in C99
/Users/maggie/Documents/aes/openssl-master/apps/enc.c:582:9: Implicit conversion loses integer precision: 'unsigned long' to 'int'
Source code of enc.c is here
Does anyone ever encounter this problem?
Thanks.

Related

What the underlying reason C code will compile using mingw32 in Linux but Visual Studio C has problems

So Im wondering why C code compiled for me with mingw32 (this program here fo reference https://github.com/newsoft/adduser) with no issues or mentions of errors (other than some case-sensitivity in naming of the headers i mean)
Though, when I tried in Visual Studio 2019 I get the following "errors" that need to be cleaned up.
Error C2440 '=': cannot convert from 'const wchar_t [15]' to 'LPWSTR' adduser-test2 C:\Users\Administrator\source\repos\adduser-test\adduser-test2\adduser-test2.cpp 39
Error C2440 '=': cannot convert from 'const wchar_t [6]' to 'LPWSTR' adduser-test2 C:\Users\Administrator\source\repos\adduser-test\adduser-test2\adduser-test2.cpp 38
Is it some sort of strict compiler settings for "safer code"? Or is one compiler actually just able to convert a const wchar_t could convert to a pointer to a wchar_t if necessary

error C2440: 'type cast' : cannot convert from 'unsigned int (__thiscall IEngineVGui::* )(unsigned int)' to 'void *'

So i'm trying to port my friends code that was compiled with GCC to Visual C++.
Your problem lies here:
(void*) &IEngineVGui::GetPanel
The type of &IEngineVGui::GetPanel is int (IEngineVGui::*) (int), which is a member function pointer.
You are trying to convert it to a "regular" pointer type, which is sadly not possible because they are handled completely differently. So MSVC is acting correctly by giving you an error. If your code compiled fine on GCC, it was most likely due to a bug and/or a non-standard extension in that particular version.

reSIProcate on WinRT

I'm getting stuck with building reSIProcate on WinRT. I got a syntax error in reTurnClient project( method getSocketDescriptor, in TurnTlsSocket.hxx)
This is error line code:
virtual unsigned int getSocketDescriptor() { return mSocket.lowest_layer().native(); }
This is error log:
5>e:\work\sigma\qilex-windows\resiprocate-resiprocate-1.10.1\return\client\TurnTlsSocket.hxx(23): error C2440: 'return': cannot convert from 'Windows::Networking::Sockets::StreamSocket ^' to 'unsigned int' (compiling source file TurnTlsSocket.cxx)
5> e:\work\sigma\qilex-windows\resiprocate-resiprocate-1.10.1\return\client\TurnTlsSocket.hxx(23): note: No user-defined-conversion operator available, or (compiling source file TurnTlsSocket.cxx)
5> e:\work\sigma\qilex-windows\resiprocate-resiprocate-1.10.1\return\client\TurnTlsSocket.hxx(23): note: There is no context in which this conversion is possible (compiling source file TurnTlsSocket.cxx)
I know It's type conflict error, but haven't got any clue to start fixing.

Boost includes wreaks havoc - but it's not Boost's fault

I am introducing Boost into my project and as soon as I include Boost headers (#include <boost/property_tree/ptree.hpp>) in a particular file I get errors in the boost headers.
Here is a short snippet of the errors:
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(28): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(28): error C2143: syntax error : missing ',' before 'sizeof'
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(26): error C3747: missing default template parameter : parameter 2
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(40): error C2974: 'boost::mpl::if_' : invalid template argument for 'T2', type expected
1> c:\boost\include\boost-1_57\boost\mpl\if.hpp(56) : see declaration of 'boost::mpl::if_'
1> c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(44) : see reference to class template instantiation 'boost::mpl::eval_if<C,__formal>' being compiled
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(40): error C2974: 'boost::mpl::if_' : invalid template argument for 'T3', type expected
1> c:\boost\include\boost-1_57\boost\mpl\if.hpp(56) : see declaration of 'boost::mpl::if_'
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(50): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(50): error C2143: syntax error : missing ',' before 'sizeof'
1>c:\boost\include\boost-1_57\boost\mpl\eval_if.hpp(62): error C2974: 'boost::mpl::if_c' : invalid template argument for 'T1', type expected
I immediately thought about namespace collision and I removed all using namespace std, but this didn't solve the problem. I have used Boost threads in another location and it worked as expected (but that code is now inactive and not being built).
Any hints?
--- Some notes
Running in VS2013
Code without using namespace std builds and works
The only thing I can think of is there is an error in one of your header files that is being included before a boost header. I have seen that make it look like the error is in the header included after. One thing you might be able to do to help find the problem is to include all system and boost headers first and then include your own headers.

Can't compile this code [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What is an undefined reference/unresolved external symbol error and how do I fix it?
I have troubles with compiling this code http://pastebin.com/a7AMbYPv.
Here are the errors I get:
C:\Dev-Cpp\include\main.cpp In function 'int write_jpeg_file(char*)':
109 25 C:\Dev-Cpp\include\main.cpp [Error] invalid conversion from 'int' to 'J_COLOR_SPACE' [-fpermissive]
C:\Dev-Cpp\include\main.cpp In function 'int main()':
130 21 C:\Dev-Cpp\include\main.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
130 48 C:\Dev-Cpp\include\main.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\NIVER\Desktop\Makefile.win [Error] [../../../Dev-Cpp/include/main.o] Error 1 (if this is the only error: please check your library includes)
Any help would be appreciated.
In your code you have reference to functions that you do not implement them (jpeg_std_error, ...), so you must provide their implementation to the linker. this is usually done with adding a .lib or .a or something like that to list of inputs of your linker. please look where you get the sample and get its implementation of those functions (either a source C/C++) files or get its compiled library (in form .lib or .a) and add them to the linker with flags that specified for your linker and every thing will work as expected