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
GeoExpress DSDK and MinGW / GCC
Moderator: jskiffington
11 posts
• Page 1 of 1
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
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
- kirkoman
- Posts: 11
- Joined: Thu Jan 24, 2008 2:50 pm
- Location: LizardTech
[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.
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.
- kshehata
- Posts: 14
- Joined: Mon Mar 08, 2010 2:44 pm
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
h_t_t_p://stackoverflow.com/questions/1796209/how-to-link-to-vs2008-generated-libs-from-g
- kshehata
- Posts: 14
- Joined: Mon Mar 08, 2010 2:44 pm
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.
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.
- kshehata
- Posts: 14
- Joined: Mon Mar 08, 2010 2:44 pm
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.
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.
- kirkoman
- Posts: 11
- Joined: Thu Jan 24, 2008 2:50 pm
- Location: LizardTech
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.
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.
- kshehata
- Posts: 14
- Joined: Mon Mar 08, 2010 2:44 pm
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
Thanks,
Brad
- barndt
- Posts: 2
- Joined: Tue Jul 27, 2010 6:32 pm
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
- Forum index
- The team • Delete all board cookies • All times are UTC - 7 hours
