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

55 views Asked by At

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

2

There are 2 answers

2
shemsu On

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.

1
Vinayak Bevinakatti On

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