Forums HomeForums Home   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in 

GeoExpress DSDK and MinGW / GCC

 
Post new topic   Reply to topic    LizardTech - Forum Index -> SDKs
View previous topic :: View next topic  
Author Message
kshehata



Joined: 08 Mar 2010
Posts: 14

PostPosted: Wed Mar 17, 2010 3:02 pm    Post subject: GeoExpress DSDK and MinGW / GCC Reply with quote

I've now gotten my JNI library to load in the MrSID data and I can display it on my Mac and Linux, and now I'm looking to add it to our windows build. We use MinGW / GCC to build our windows executables. Is there a build of the DSDK available for that environment?

I've tried using the VC9 build. I can get it to compile a .o file by adding a few defines to headfake lt_platform.h into thinking that the compiler is visual studio, but I can't get past linking. The linker seems to recognize the .lib files, but it complains of all kinds of undefined references. Any ideas?

Thanks!

Kareem
Back to top
View user's profile Send private message
kshehata



Joined: 08 Mar 2010
Posts: 14

PostPosted: Wed Mar 17, 2010 3:05 pm    Post subject: Reply with quote

Here's the output from linking:
h_t_t_p://pastebin.com/wJSRJ11z
Back to top
View user's profile Send private message
gat



Joined: 12 Jan 2009
Posts: 27

PostPosted: Wed Mar 17, 2010 4:06 pm    Post subject: Reply with quote

I'm sorry but we do not have a distribution for that compiler.
Back to top
View user's profile Send private message
kirkoman



Joined: 24 Jan 2008
Posts: 11
Location: LizardTech

PostPosted: Wed Mar 17, 2010 5:17 pm    Post subject: Reply with quote

Kareem,

The undefined symbols in your listing should be coming from msvcrt or libc (or corresponding threaded/debug versions of the same). Could they have to do with the warnings up at the front? For example:

Warning: .drectve `/DEFAULTLIB:"libcpmt" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized

I'm not super familiar with the mingw environment, but libcmt is where these symbols should be coming from, so if it is not getting linked in that may be your problem.

Kirk
Back to top
View user's profile Send private message
kshehata



Joined: 08 Mar 2010
Posts: 14

PostPosted: Thu Mar 18, 2010 8:27 am    Post subject: Reply with quote

[quote="gat"]I'm sorry but we do not have a distribution for that compiler.[/quote]

How do people build JNI interfaces for multiple platforms then? I'm trying to have a Java JAR and a set of libraries that work consistently across Windows, Mac, and Linux, and it's a whole lot easier to do that with gcc than switching compilers.

Also: our build server is on Linux, so I'd have to change our entire build system to use the Visual Studio compiler. That's really not an option for us.
Back to top
View user's profile Send private message
kshehata



Joined: 08 Mar 2010
Posts: 14

PostPosted: Thu Mar 18, 2010 12:59 pm    Post subject: Reply with quote

Based on the discussion on StackOverflow (link below, I don't understand why BB code isn't working), it looks like linking from one compiler to another is simply impossible. This is a dealbreaker for us: we have make this work on Windows, or the whole effort is lost. Is there any chance of having a version compiled with MinGW? If you already have a linux build script, this should be trivially easy to do. If not, how do people build JNI libraries for multiple platforms?

h_t_t_p://stackoverflow.com/questions/1796209/how-to-link-to-vs2008-generated-libs-from-g
Back to top
View user's profile Send private message
kshehata



Joined: 08 Mar 2010
Posts: 14

PostPosted: Thu Mar 18, 2010 2:27 pm    Post subject: Reply with quote

Confirmed: you cannot link C++ libraries built with one compiler to another.

h_t_t_p://stackoverflow.com/questions/2472924/linking-to-msvc-dll-from-mingw

BTW: Have you considered releasing a Java interface? Even if it required a platform specific library (.dll/.so/.dylib), the JNI layer on top of what you have should be pretty easy to do. Considering that I started with nothing less than two weeks ago and can now view SID-based map data and I've integrated it with our existing GUI, a full implementation should be quick and high value.
Back to top
View user's profile Send private message
kirkoman



Joined: 24 Jan 2008
Posts: 11
Location: LizardTech

PostPosted: Fri Mar 19, 2010 3:52 pm    Post subject: Reply with quote

I've looked into building our SDK using MinGW and it is not as trivial as one would think. Just as you would have to "change [your] entire build system" to use the VS compiler, we have a pretty hefty build-server system in place which serves its purpose well but adding new platforms is a significant process with a lot of setup and hand-holding.

I would love to see this platform get supported, and will escalate your request. However, this is the only request we have received for mingw support, so even if it does happen, it is not likely to be in a short timeframe. So I'd recommend pursuing your only viable option at this point: Either use the existing C DLL (which is fairly simplistic, I know), or write a VS shim DLL (i.e., roll your own C DLL that meets your needs).

If you're so inclined, I hope you post back once you get something working. Best of luck.
Back to top
View user's profile Send private message
kshehata



Joined: 08 Mar 2010
Posts: 14

PostPosted: Mon Mar 22, 2010 12:29 pm    Post subject: Reply with quote

I ended up switching over to the plain C library and got that to build successfully on all platforms. Since all I'm looking for is the image data and georeferences, this does the trick.

I'm surprised no one else has run into this. It seems like the most natural way to develop cross platform: use gcc for everything! Then again, I guess most people don't do a lot of cross-platform development.

Thanks for your attention on this. If you do decide to implement a MinGW build, I would definitely be interested in testing it out.
Back to top
View user's profile Send private message
barndt



Joined: 27 Jul 2010
Posts: 2

PostPosted: Tue Jul 27, 2010 6:37 pm    Post subject: Reply with quote

I am in the same boat. I've been struggling with this for a couple hours now, before I finally stumbled across this post. I'd like to try moving to the C dll as well, but for the life of me I can't find it. Looking on the SDK download page, all I see for Windows is C++ SDKs. Is there something I'm missing? Is the C API somehow bundled with the C++ ones? Are there examples somewhere that use the C API?

Thanks,
Brad
Back to top
View user's profile Send private message
barndt



Joined: 27 Jul 2010
Posts: 2

PostPosted: Tue Jul 27, 2010 7:16 pm    Post subject: Reply with quote

Nevermind, I think I just found my answer in the /include/c_api directory
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    LizardTech - Forum Index -> SDKs All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



   Terms of Use | Privacy Policy | Contact

Search LizardTech:   


RSS Feeds RSS Feeds for LizardTechLizardTech España   LizardTech Japan   © 2008 LizardTech, Inc. All rights reserved.