开发者

How to configure Eclipse project libraries to compile both on Windows and Linux?

开发者 https://www.devze.com 2023-01-14 04:50 出处:网络
It\'s a simple OpenGL app. The problem is, JOGL needs native libraries, and I need to set \"Native library location\", which is different for Windows and Linux. Is it possible to share project setting

It's a simple OpenGL app. The problem is, JOGL needs native libraries, and I need to set "Native library location", which is different for Windows and Linux. Is it possible to share project settings between platforms?

I want to make the workspace setup process as simple as "chec开发者_如何学Gokout from SVN, compile, run".


If it's just Windows and Linux, you can put them in the same folder, as j flemm states.

The reason it works is because of the definition of System.loadLibrary() in Java:

loadLibrary

public static void loadLibrary(String libname)

Loads the system library specified by the libname argument. The manner in which a library name is mapped to the actual system library is system dependent.

That means System.loadLibrary("jogl") will try to load jogl.dll on Windows and libjogl.so on Linux. It's pretty nice.

0

精彩评论

暂无评论...
验证码 换一张
取 消