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

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

问题描述

这是一个简单的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.

它的原因是因为 Java中的System.loadLibrary()

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


loadLibrary

public static 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 code> 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.

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

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