Lichtso / netLink

Socket and Networking Library using msgpack.org[C++11]
GNU General Public License v3.0
216 stars 48 forks source link

Building in MinGW 4.9.2 #8

Closed DJuego closed 9 years ago

DJuego commented 9 years ago

I have built netLink directly in Visual Studio 2013 and Sourcery_CodeBench_Lite_for_ARM_GNU_Linux without problems. The examples works flawlessly. ;-) However I have troubles with Mingw-builds (gcc 4.9.2)

The first problem was related with the IPV6 support: Socket.cpp:39:77: error: 'inet_ntop' was not declared in this scope I resolved it with #define _WIN32_WINNT 0x0602 in Socket.cpp.

The current problem says:

g++.exe -Wall -std=c++11 -DWIN32 -g -I....\inc\netLink\include -c P:\Mis-Proyectos\Cross-compilados\EV3\Control_PC_EV3\inc\netLink\src\Utf8.cpp -o obj\Debug\inc\netLink\src\Utf8.o In file included from P:\Mis-Proyectos\Cross-compilados\EV3\Control_PC_EV3\inc\netLink\src\Utf8.cpp:16:0: ....\inc\netLink\include/Utf8.h: In function 'size_t utf8::byteSize(iterator)': ....\inc\netLink\include/Utf8.h:22:44: error: there are no arguments to 'lzcnt' that depend on a template parameter, so a declaration of 'lzcnt' must be available [-fpermissive]

define countLeadingOneBits(x) __lzcnt(~(x))

                                        ^

....\inc\netLink\include/Utf8.h:142:7: note: in expansion of macro 'countLeadingOneBits' s = countLeadingOneBits(c << 24); ^ ....\inc\netLink\include/Utf8.h:22:44: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

define countLeadingOneBits(x) __lzcnt(~(x))

[...]

Lichtso commented 9 years ago

You could try replacing "#ifdef WIN32" in line 21 of Utf8.h with "#ifdef _MSC_VER". I am working on a patch, but don't have access to a windows machine right now, so I can't test it.

DJuego commented 9 years ago

Fantastic! It works! (building and running)

I had to add the "-lws2_32" flag for undefined references: ---"undefined reference to `_imp__ioctlsocket"--- and similar.

Thx!

Lichtso commented 9 years ago

I pushed the patch (updated CMakeLists.txt) too, so you will have to rerun cmake.

If we are lucky and everything works out, the following problems should be solved:

  1. Defined #define _WIN32_WINNT 0x0602 if WIN32 is defined
  2. Replaced "#ifdef WIN32" with "#ifdef _MSC_VER" (in line 21 of Utf8.h and line 18 of MsgPack.cpp) to distinguish between MinGW and VisualStudio
  3. Added "-lws2_32" to the build params (if building for Windows) in CMakeLists.txt
DJuego commented 9 years ago

Well. Exceptionally, i have not been running cmake to build the netLink library because i have a cross-compiling toolchain and i refused to investigate how to configure cmake for cross-compiling toolchains. At least for the moment... So, i added the netlink source code in my project.


However, i tried your new CMakeLists.txt with a 'fresh' netLink folder

bash-3.1$ make Scanning dependencies of target static [ 10%] Building CXX object CMakeFiles/static.dir/src/Utf8.cpp.obj [ 20%] Building CXX object CMakeFiles/static.dir/src/SocketManager.cpp.obj In file included from p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/MinGW-Builds/netL ink/include/Socket.h:18:0, from p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/MinGW-Builds/netL ink/include/MsgPackSocket.h:18, from p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/MinGW-Builds/netL ink/include/netLink.h:18, from p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/MinGW-Builds/netL ink/src/SocketManager.cpp:16: p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/MinGW-Builds/netLink/include/Core.h:26: 23: fatal error: arpa/inet.h: No such file or directory

include <arpa/inet.h>

                   ^

compilation terminated. CMakeFiles/static.dir/build.make:79: recipe for target CMakeFiles/static.dir/sr c/SocketManager.cpp.obj' failed make[2]: *** [CMakeFiles/static.dir/src/SocketManager.cpp.obj] Error 1 CMakeFiles/Makefile2:165: recipe for targetCMakeFiles/static.dir/all' failed make[1]: * [CMakeFiles/static.dir/all] Error 2 Makefile:75: recipe for target `all' failed make: * [all] Error 2 bash-3.1$

Until now, I have been a simple "reader" of CMakeLists.txt. Not a "writer". However I was playing around with CMakeLists.txt and StackOverflow...

project(NetLink)

set(OUTPUT_DIR out)
set(SOURCE_DIR src)
set(EXAMPLES_DIR ${SOURCE_DIR}/examples)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
add_definitions(-O3 -std=c++11)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    add_definitions(-stdlib=libc++)
endif()

macro(get_WIN32_WINNT version)
    if (WIN32 AND CMAKE_SYSTEM_VERSION)
        set(ver ${CMAKE_SYSTEM_VERSION})
        string(REPLACE "." "" ver ${ver})
        string(REGEX REPLACE "([0-9])" "0\\1" ver ${ver})

        set(${version} "0x${ver}")
    endif()
endmacro()

if(WIN32)   
    get_WIN32_WINNT(ver)        
    add_definitions(-DWIN32)
    add_definitions(-D_WIN32_WINNT=${ver})      
endif(WIN32)

include_directories(PUBLIC include)
aux_source_directory(${SOURCE_DIR} SOURCES)
add_library(shared SHARED  ${SOURCES} )
add_library(static STATIC  ${SOURCES} )
set_target_properties(shared PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
set_target_properties(static PROPERTIES OUTPUT_NAME ${PROJECT_NAME})

add_executable(example_tcp ${EXAMPLES_DIR}/tcp.cpp)
add_executable(example_udp ${EXAMPLES_DIR}/udp.cpp)

if(WIN32)
target_link_libraries(shared ws2_32)
#target_link_libraries(static ws2_32)
target_link_libraries(example_tcp static ws2_32)
target_link_libraries(example_udp static ws2_32)    
else(WIN32)
target_link_libraries(example_tcp static)
target_link_libraries(example_udp static)
endif(WIN32)    

and it works (building and running) with Mingw-builds (gcc 4.9.2) I test the examples and my project (linking with the netLink libraries)

After that, i test with MSVC (Visual Studio 2013) The CMakeFiles.txt i "propose" works too. There are warnings of course. For instance

cl : Command line warning D9002 : ignoring unknown option '-O3' cl : Command line warning D9002 : ignoring unknown option '-std=c++11'

but the building is successfully. I get :NetLink.lib NetLink.dll example_udp.exe example_tcp.exe

The examples works... but there are a problem with the symbol importation.

------ Build started: Project: Control_PC_EV3_msvc2013, Configuration: Debug Win32 ------ 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impaccept@12 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impbind@12 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impclosesocket@4 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impconnect@12 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impioctlsocket@12 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impgetsockname@12 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol implisten@8 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impntohl@4 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impntohs@4 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol imprecv@16 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol imprecvfrom@24 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impsend@16 referenced in function __catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impsendto@24 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impsetsockopt@20 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impsocket@12 referenced in function catch$?xsputn@Socket@netLink@@EAE_JPBE_J@Z$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impWSAStartup@8 referenced in function "void cdecl netLink::init(void)" (?init@netLink@@YAXXZ) 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impgetaddrinfo@16 referenced in function "private: class std::unique_ptr<struct addrinfo,struct netLink::Socket::AddrinfoDestructor> thiscall netLink::Socket::getSocketInfoFor(char const *,unsigned int,bool)" (?getSocketInfoFor@Socket@netLink@@AAE?AV?$unique_ptr@Uaddrinfo@@UAddrinfoDestructor@Socket@netLink@@@std@@PBDI_N@Z) 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impfreeaddrinfo@4 referenced in function "public: void thiscall netLink::Socket::AddrinfoDestructor::operator()(struct addrinfo *)const " (??RAddrinfoDestructor@Socket@netLink@@QBEXPAUaddrinfo@@@Z) 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol impinet_pton@12 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAE_JXZ$0 1>NetLink.lib(Socket.cpp.obj) : error LNK2019: unresolved external symbol _inet_ntop@16 referenced in function catch$?advanceInputBuffer@Socket@netLink@@QAEJXZ$0 1>NetLink.lib(SocketManager.cpp.obj) : error LNK2019: unresolved external symbol WSAFDIsSet@8 referenced in function "public: void thiscall netLink::SocketManager::listen(double)" (?listen@SocketManager@netLink@@QAEXN@Z) 1>NetLink.lib(SocketManager.cpp.obj) : error LNK2019: unresolved external symbol impselect@20 referenced in function "public: void thiscall netLink::SocketManager::listen(double)" (?listen@SocketManager@netLink@@QAEXN@Z) 1>P:\Mis-Proyectos\Cross-compilados\EV3\Control_PC_EV3\prj\Control_PC_EV3_msvc2013\Debug\Control_PC_EV3_msvc2013.exe : fatal error LNK1120: 22 unresolved externals

I think the explanation of this problem is here: http://www.cmake.org/Wiki/BuildingWinDLL

//** I am sorry not to not to be able to be more helpful to you. :-(

PS: A debug and release version and a install option will be interesting...

Lichtso commented 9 years ago

No, this is actually very useful information. Thanks a lot.

Here is what I did:

  1. The "unresolved external symbol" can be solved by #pragma comment(lib, "Ws2_32.lib")
  2. ignoring unknown option '-O3', '-std=c++11' are avoided by if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  3. I restructured your CMakeLists.txt a bit (not sure if it still works) but take a look your self, I pushed a new commit.

By "install option" do you have something like this in mind? http://www.cmake.org/Wiki/CMake:Install_Commands But I have to read it myself because I never used cmake this deeply.

And what would you like the DEBUG / RELEASE configurations to be like? In which way should they be different?

DJuego commented 9 years ago

Congrats!. You have managed the CMakeLists.txt for Mingw32, :-) Unfortunately, there are problems with the CMakeLists.txt for MSVC.

First. In the Configure Stage:

CMake Warning (dev) at CMakeLists.txt:27 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:31 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring done
Generating done

Second. Generate Stage without problems.

Third. -nmake-

Scanning dependencies of target shared
[ 10%] Building CXX object CMakeFiles/shared.dir/src/Utf8.cpp.obj
Utf8.cpp
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Utf8.cpp(19) : warning C
4309: 'static_cast' : truncation of constant value
[ 20%] Building CXX object CMakeFiles/shared.dir/src/SocketManager.cpp.obj
SocketManager.cpp
p:\plataformas\x32-x64\trabajo_msvc2013_x32\netlink\include\Element.h(121) : war
ning C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of
 data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\SocketManager.cpp(80) :
warning C4244: '=' : conversion from 'double' to 'long', possible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\SocketManager.cpp(81) :
warning C4244: '=' : conversion from 'double' to 'long', possible loss of data
[ 30%] Building CXX object CMakeFiles/shared.dir/src/MsgPack.cpp.obj
MsgPack.cpp
p:\plataformas\x32-x64\trabajo_msvc2013_x32\netlink\include\Element.h(121) : war
ning C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of
 data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(228) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(232) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(257) : warni
ng C4244: 'initializing' : conversion from 'int64_t' to 'unsigned int', possible
 loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(316) : warni
ng C4244: 'initializing' : conversion from 'int64_t' to 'uint32_t', possible los
s of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(408) : warni
ng C4244: 'initializing' : conversion from 'int64_t' to 'uint32_t', possible los
s of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(425) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(497) : warni
ng C4244: 'argument' : conversion from 'int64_t' to 'unsigned int', possible los
s of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(512) : warni
ng C4244: '=' : conversion from 'uint64_t' to 'uint8_t', possible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(515) : warni
ng C4244: 'argument' : conversion from 'uint64_t' to 'uint8_t', possible loss of
 data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(518) : warni
ng C4244: 'argument' : conversion from 'uint64_t' to 'uint16_t', possible loss o
f data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(521) : warni
ng C4244: 'argument' : conversion from 'uint64_t' to 'uint32_t', possible loss o
f data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(530) : warni
ng C4244: 'argument' : conversion from 'int64_t' to 'int8_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(533) : warni
ng C4244: 'argument' : conversion from 'int64_t' to 'int8_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(536) : warni
ng C4244: 'argument' : conversion from 'int64_t' to 'int16_t', possible loss of
data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(539) : warni
ng C4244: 'argument' : conversion from 'int64_t' to 'int32_t', possible loss of
data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(690) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(740) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(791) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(828) : warni
ng C4244: 'argument' : conversion from 'uint64_t' to 'unsigned int', possible lo
ss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(830) : warni
ng C4244: 'argument' : conversion from 'uint64_t' to 'unsigned int', possible lo
ss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(841) : warni
ng C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of d
ata
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(919) : warni
ng C4244: 'argument' : conversion from 'int64_t' to '__w64 int', possible loss o
f data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\MsgPack.cpp(1035) : warn
ing C4244: 'argument' : conversion from 'int64_t' to '__w64 int', possible loss
of data
[ 40%] Building CXX object CMakeFiles/shared.dir/src/Socket.cpp.obj
Socket.cpp
p:\plataformas\x32-x64\trabajo_msvc2013_x32\netlink\include\Element.h(121) : war
ning C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of
 data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(90) : warning
 C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(100) : warnin
g C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(114) : warnin
g C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(136) : warnin
g C4101: 'err' : unreferenced local variable
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(147) : warnin
g C4101: 'err' : unreferenced local variable
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(164) : warnin
g C4101: 'err' : unreferenced local variable
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(172) : warnin
g C4244: '=' : conversion from 'long' to 'uint8_t', possible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(381) : warnin
g C4244: 'argument' : conversion from 'std::streamsize' to 'size_t', possible lo
ss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(386) : warnin
g C4101: 'err' : unreferenced local variable
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(406) : warnin
g C4244: 'argument' : conversion from 'std::streamsize' to 'int', possible loss
of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(419) : warnin
g C4244: 'argument' : conversion from 'std::streamsize' to 'int', possible loss
of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(442) : warnin
g C4244: 'argument' : conversion from 'std::streamsize' to 'int', possible loss
of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(456) : warnin
g C4244: 'argument' : conversion from 'std::streamsize' to 'int', possible loss
of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(489) : warnin
g C4244: 'initializing' : conversion from 'std::streamsize' to 'unsigned int', p
ossible loss of data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\Socket.cpp(503) : warnin
g C4244: 'initializing' : conversion from 'std::streamsize' to 'unsigned int', p
ossible loss of data
Linking CXX shared library out\NetLink.dll
[ 40%] Built target shared
Scanning dependencies of target example_tcp
[ 50%] Building CXX object CMakeFiles/example_tcp.dir/src/examples/tcp.cpp.obj
tcp.cpp
p:\plataformas\x32-x64\trabajo_msvc2013_x32\netlink\include\Element.h(121) : war
ning C4244: 'return' : conversion from 'int64_t' to 'uint32_t', possible loss of
 data
P:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\src\examples\tcp.cpp(99) : w
arning C4101: 'exc' : unreferenced local variable
NMAKE : fatal error U1073: don't know how to make 'out\NetLink.lib'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
p:\Plataformas\x32-x64\TRABAJO_MSVC2013_x32\netLink\builds>
Lichtso commented 9 years ago

Well the first warning by cmake is a policy, which is depending on your version and local configuration. You could try "cmake_policy(SET CMP0054 NEW)".

I am not quiet sure what the error is in the build phase. You used nmake from the command line? Could you try what happens when you compile it using the graphical IDE of MSVS?

But thanks anyway for all your help fixing this stuff. What about your other proposals like install, debug / release modi?

DJuego commented 9 years ago

Curious! It works with Visual Studio IDE :-|. Habitually, i build with nmake for Visual Studio binaries-. Anyway congrats! :-) I think you can close the issue. About my suggestions: (debug/release)

(debug and release builds)

They are habitual options for developing with 'third-party" libraries. The idea is generating lib binaries for each setting of the compiler

The result could be: Debug (for debugging setting) NetLink-d.lib NetLink-d.dll Release (for releasing setting) NetLink.lib NetLink.dll

.http://binglongx.com/2013/09/02/setting-different-compile-and-link-options-for-different-build-types-debugrelease-in-cmake/

About install... It allows installing automatically the library in the system with make install, nmake install...

However, these suggestions are not so important for me. I believe you can find inspiration (a gold mine) in this post:

http://en.sfml-dev.org/forums/index.php?topic=13723.0

Specifically in Object Synchronization. Keep an eye on the example of "sfn::Message" On the other hand it's true it is oriented to multiplayer-game...

Another idea could be improving the performance would be offering facilities in order to get data compression (https://github.com/Cyan4973/lz4) or go even further (data encryption facilities)

Anyway, it's sure that you have an vision very concrete about netLink and its goals. :-D

Lichtso commented 9 years ago

I am open to any kind of proposal of new features and added two of them as open issues. They will be implemented when I have some more free time.

The only things netLink has as a strait goal is to be KISS (very simple) and http://MsgPack.org compatible.