如何配置Eclipse项目库以在Windows和Linux上进行编译? [英] How to configure Eclipse project libraries to compile both on Windows and Linux?

查看:109
本文介绍了如何配置Eclipse项目库以在Windows和Linux上进行编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个简单的OpenGL应用程序。问题是,JOGL需要本机库,而我需要设置本机库位置,这对于Windows和Linux是不同的。可以在平台之间共享项目设置吗?

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?

我想使工作区设置过程像从SVN签出,编译,运行一样简单。

I want to make the workspace setup process as simple as "checkout from SVN, compile, run".

推荐答案

如果只是Windows和Linux,则可以按照j flemm的说明将它们放在同一文件夹中。

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

之所以起作用,是因为 System.loadLibrary() 在Java中:

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


loadLibrary

公共静态void loadLibrary(String
libname)

public static void loadLibrary(String libname)

加载由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.

这意味着 System.loadLibrary( jogl)将尝试在Windows上加载 jogl.dll 并在 libjogl.so 在Linux上。很好。

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

这篇关于如何配置Eclipse项目库以在Windows和Linux上进行编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆