Netbeans Project from Mac to Windows

I created a Netbeans CPP Project in my Mac and uploaded it into git. The project has collaborators who use Windows.

When I pushed my project into github , I pushed the makefile information too (the whole project). Now the collaborators are getting build errors because the reference contains my Mac filepaths.

  • Why is a Git post-commit hook on non-interactive rebase not run?
  • How to use git bisect?
  • Setting colors for prompt in Git Bash on Windows
  • Is the git binary diff algorithm (delta storage) standardized?
  • How to remove the first commit in git?
  • How can I manually remove a blob object from a tree in Git?
  • The Windows machine have cygwin installed.

    1. How do I resolve it ?
    2. How I do make it platform independent ?
    3. What should I (and collaborators ) do to not affect the other workers ?

    ANSWER : Netbeans has an option (in the project properties under c++), to have the file path as absolute or relative. So I all had to do was, set the relative option and push the changes . The project started working for everyone ! VOILA !!!!!!!!

  • Git submodule fails on TFS Build
  • Gitignore won't ignore .vs folder for Visual Studio 2015 RC on Windows7/8
  • What's the best practice to “git clone” into an existing folder?
  • how to create a new git repository from an existing one
  • gitignore for folder of eclipse projects
  • Git submodule on remote bare
  • 3 Solutions collect form web for “Netbeans Project from Mac to Windows”

    Netbeans has an option (in the project properties under c++), to have the file path as absolute or relative. So I all had to do was, set the relative option and push the changes . The project started working for everyone ! VOILA !!!!!!!!

    I’ve found that the project files generated by NetBeans for C++ are rather unweildy and aren’t very maintainable by humans. And while they do tend to reference paths relatively from the root of the project (facilititating copying the project to different directories), there’s just too many project files to maintain. And you’re sol if they don’t work.

    I don’t know if NetBeans allows you to specify environment variables for paths in the project settings dialogs. The macro/variable stuff is largely undocumented as far as I can tell. But if you know how to do that, then define all your file path dependencies by an environment variable instead of a hardcoded path in the project settings window. Remote developers need only redefine the environment vars on their machine.

    But I think a better solution is to not use the NetBeans auto-generated Makefile from Project Settings. Instead, declare your own Makefile and create a NetBeans project type from “an existing Makefile”. I’ve found that works really well.

    Then you can have a line at the top of you Makefile as follows:

    include common.inc
    

    Where “common.inc” includes all the hardcoded library paths that are machine dependent. Here’s an example of mine:

    BOOST_INCLUDE := -I/home/jselbie/lib/boost_1_46_1
    OPENSSL_INCLUDE := -I/home/jselbie/lib/openssl
    

    And then my Makefile only references these directories by variable name. And so when I move the project around different machines with different configs, I just need to update common.inc.

    And then if anyone else wants to use NetBeans to compile my project, they just need to create a NetBeans project from “an existing Makefile” option.

    The option for relative file paths is actually NOT in the project properties! Instead, it’s in the top menu bar.. choose “Tools” then “options” then click the “C/C++” tab, and the second box down is “File path mode” select “always relative”

    Git Baby is a git and github fan, let's start git clone.