[ 
https://issues.apache.org/jira/browse/THRIFT-2571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14503696#comment-14503696
 ] 

James E. King, III commented on THRIFT-2571:
--------------------------------------------

libevent generates a file called event-config.h when used with "./configure" - 
unfortunately on Windows native there is no such tool and no event-config.h 
gets created, so compiling against libevent does not work.  Further, libevent 
uses a header called "event.h" which conflicts with an identically named header 
in the Windows Platform SDK.  CMake will pick up the Platform SDK as the 
LibEvent_INCLUDE_DIRS variable, so you need to edit CMakeCache.txt and change 
it to the real location, however once you do that, you run into the 
event-config.h issue.

So I have given up on libevent on Windows for the time being.  I found that the 
thriftz library does not depend on the thrift library in CMake however the 
windows linker complains about a couple missing things.  So I made thriftz 
depend on thrift in my local copy.

Sadly, when I try to link thriftz or any of the unit tests, I get 
"..\Debug\thriftd.lib not found".  That's really bizarre, so I enabled verbose 
output in Visual Studio 2010 and see the link line:
{quote}
1>  c:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT 
/OUT:"C:\Users\Jim\workspace\thrift-build\bin\Debug\thriftd.dll" /INCREMENTAL 
/NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib 
oleaut32.lib uuid.lib comdlg32.lib advapi32.lib 
"C:\win3p\tools\x64\openssl-1.0.1b\lib\ssleay32.lib" 
"C:\win3p\tools\x64\openssl-1.0.1b\lib\libeay32.lib" 
"C:\Boost\lib\boost_system-vc100-mt-gd-1_58.lib" 
"C:\Boost\lib\boost_thread-vc100-mt-gd-1_58.lib" /MANIFEST 
/ManifestFile:"thrift.dir\Debug\thriftd.dll.intermediate.manifest" 
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG 
/PDB:"C:/Users/Jim/workspace/thrift-build/bin/Debug/thriftd.pdb" 
/SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT 
/IMPLIB:"C:/Users/Jim/workspace/thrift-build/lib/Debug/thriftd.lib" 
/MACHINE:X64 /DLL thrift.dir\Debug\thriftd.dll.embed.manifest.res
{quote}

Clearly there is an IMPLIB defined but it is not a valid path for Windows.  My 
guess is since nothing is defined __declspec(dllexport), no .lib is being 
created for the dynamic library, hence no .lib file to be found.  I'll try only 
using static libraries, I guess.

> Simplify cross compilation using CMake
> --------------------------------------
>
>                 Key: THRIFT-2571
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2571
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (General)
>    Affects Versions: 1.0
>            Reporter: Pascal Bach
>            Assignee: Henrique Mendonça
>            Priority: Minor
>             Fix For: 0.9.2
>
>
> Using CMake would simplify cross compilation.
> The for example the same build script can be used to build:
> - Native for Linux using GCC
> - Native for Windows using Visual Studio
> - Cross compile for ARM on Linux
> - Cross compile for Windows form Linux using mingw32
> It also makes it easy to generate project files for Eclipse or Visual Studio.
> h2. Some examples:
> {code:title=Create an eclipse project|borderStyle=solid}
> mkdir build_ec && cd build_ec
> cmake -G "Eclipse CDT4 - Unix Makefiles" ../compiler/cpp
> make
> {code} 
> Now open the folder build_ec using eclipse.
> {code:title=Create a Visual Studio project (Windows only)|borderStyle=solid}
> mkdir build_vs && cd build_vs
> cmake -G "Visual Studio 12" ../compiler/cpp
> {code} 
> Now open the folder build_vs using Visual Studio.
> {code:title=Cross compile using mingw32|borderStyle=solid}
> mkdir build_mingw32 && cd build_mingw32
> cmake -DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake 
> ../compiler/cpp
> make
> {code} 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to