简体   繁体   中英

Problems adding a library project (should be added with ..\\ or ../ )

I'm maintaining a project developed from other person on the past, in other machines, mac, linux, etc... Now im programming with Windows 7.

The project consists of two android projects, one of them is a library, and the other should link to that library android project.

I created now another library project, and the main project should link two library projects now.

The problem is that when i add the new library project, i can see in project.properties this:

android.library.reference.1=..\\LibraryAndroid1
android.library.reference.2=../LibraryAndroid2

The first one is the old one, and the second one is the new library that i created in Windows now.

WHy the first haves ..\\ and the second ../ ?

It can be a problem if this project is compiled on a Windows or a Mac machine?

Thanks

Both will works correctly on Windows. But you should use the same syntax for all references.

However, IMO, the good way is the second one.

Windows uses back-slash '\\' as the directory separator; while Unixes/Mac uses forward-slash '/' . Hence when the project has complied for Unixes/Mac the ..\\\\LibraryAndroid1 and after building on Windows it is ../LibraryAndroid2

"Of course on Windows, backslashes are acceptable path separators. But on Mac and Linux such paths do not work. The thing is, on Windows, forward slashes work perfectly well. So, our policy now is always to commit the file with forward slashes, so that it will work for everyone."

Source : Eclipse project.properties backslash paths considered harmful

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM