首页 > 编程语言 >Can't open dsw file in Visual Studio C++ 6.0

Can't open dsw file in Visual Studio C++ 6.0

时间:2023-04-12 13:12:01浏览次数:55  
标签:files Git dsw C++ endings Visual file line your

Can't open dsw file in Visual Studio C++ 6.0

 

When I try to "Open Workplace" of my project, visual studio does nothing, solution explorer is empty. Also when I try to open my project, I occasionally see this error:

This makefile was not generated by Developer Studio.Continuing will create a new Developer Studio project to wrap this makefile. You will be prompted to save after the new project has been created.Do you want to continue?This makefile was not generated by Developer Studio.
Continuing will create a new Developer Studio project to wrap this makefile. You will be prompted to save after the new project has been created.
Do you want to continue?

 

The problem was that my dsp/dsw file endings were LF. You can check your file endings in your code editor or using this git command:

git ls-files --eol

After converting ds/dsp files to CRLF, I was able to open the project. You can convert file endings in Unix using this command:

unix2dos YouFileName.dsw



UltraEdit中打开 每一个项目与工作空间, 将文件另存格式 RRLF, 不及格的程序员-八神

 

 扩展资料:不及格的程序员-八神

Configuring Git to handle line endings

In this article

  • About line endings
  • Global settings for line endings
  • Per-repository settings
  • Refreshing a repository after changing line endings
  • Further reading

To avoid problems in your diffs, you can configure Git to properly handle line endings.

MacWindowsLinux

About line endings

Every time you press return on your keyboard you insert an invisible character called a line ending. Different operating systems handle line endings differently.

When you're collaborating on projects with Git and GitHub, Git might produce unexpected results if, for example, you're working on a Windows machine, and your collaborator has made a change in macOS.

You can configure Git to handle line endings automatically so you can collaborate effectively with people who use different operating systems.

Global settings for line endings

The git config core.autocrlf command is used to change how Git handles line endings. It takes a single argument.

On Windows, you simply pass true to the configuration. For example:

$ git config --global core.autocrlf true
# Configure Git to ensure line endings in files you checkout are correct for Windows.
# For compatibility, line endings are converted to Unix style when you commit files.

Per-repository settings

Optionally, you can configure a .gitattributes file to manage how Git reads line endings in a specific repository. When you commit this file to a repository, it overrides the core.autocrlf setting for all repository contributors. This ensures consistent behavior for all users, regardless of their Git settings and environment.

The .gitattributes file must be created in the root of the repository and committed like any other file.

.gitattributes file looks like a table with two columns:

  • On the left is the file name for Git to match.
  • On the right is the line ending configuration that Git should use for those files.

Example

Here's an example .gitattributes file. You can use it as a template for your repositories:

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

You'll notice that files are matched—*.c*.sln*.png—, separated by a space, then given a setting—texttext eol=crlfbinary. We'll go over some possible settings below.

  • text=auto Git will handle the files in whatever way it thinks is best. This is a good default option.

  • text eol=crlf Git will always convert line endings to CRLF on checkout. You should use this for files that must keep CRLF endings, even on OSX or Linux.

  • text eol=lf Git will always convert line endings to LF on checkout. You should use this for files that must keep LF endings, even on Windows.

  • binary Git will understand that the files specified are not text, and it should not try to change them. The binary setting is also an alias for -text -diff.

Refreshing a repository after changing line endings

When you set the core.autocrlf option or commit a .gitattributes file, you may find that Git reports changes to files that you have not modified. Git has changed line endings to match your new configuration.

To ensure that all the line endings in your repository match your new configuration, backup your files with Git, delete all files in your repository (except the .git directory), then restore the files all at once.

  1. Save your current files in Git, so that none of your work is lost.
    $ git add . -u
    $ git commit -m "Saving files before refreshing line endings"
  2. Add all your changed files back and normalize the line endings.
    $ git add --renormalize .
  3. Show the rewritten, normalized files.
    $ git status
  4. Commit the changes to your repository.
    $ git commit -m "Normalize all the line endings"

标签:files,Git,dsw,C++,endings,Visual,file,line,your
From: https://www.cnblogs.com/ioriwellings/p/17309458.html

相关文章

  • Visual Studo for Mac 快捷键
    DefaultKeyboardShortcuts-VisualStudioforMac|MicrosoftLearnCodeNavigationCommandsKeyboardshortcutsFindReferences⇧⌘R, F12GotoDeclaration⌘D, F12NextError⌥⇧⇟, ⇧⌘F12NextIssueinFile⌥⇟PreviousError⌥⇧⇞......
  • 【C++】统计文本词频程序
    1#include<iostream>2#include<fstream>3#include<string>4#include<iomanip>5#include<vector>6#include<map>7#include<cctype>8#include<algorithm>9boolcmp(std::pair<std::strin......
  • 网络框架重构之路plain2.0(c++23 without module) 综述
    最近互联网行业一片哀叹,这是受到三年影响的后遗症,许多的公司也未能挺过寒冬,一些外资也开始撤出市场,因此许多的IT从业人员加入失业的行列,而且由于公司较少导致许多人求职进度缓慢,很不幸本人也是其中之一。自从参加工作以来,一直都是忙忙碌碌,开始总认为工作只是为了更好的生活,但是一......
  • C++中&的功能 及 用法
    参考资料:C++中&的功能及用法-konglingbin-博客园(cnblogs.com)对于习惯使用C进行开发的朋友们,在看到c++中出现的&符号,可能会犯迷糊,因为在C语言中这个符号表示了取地址符,但是在C++中它却有着不同的用途,掌握C++的&符号,是提高代码执行效率和增强代码质量的一个很好的办法。......
  • C++/ 4/11 学习内容
    空指针调用结构体中的成员函数const修饰成员函数,不能更改函数成员的值友元,让朋友可以访问本类的私有变量, *全局函数做友元*类做友元*成员函数做友元运算符重载:注意格式就ok还有<<这个输出时候的重载, 各种个样的函数重载,主要是为了方便,在主函数里面的实现......
  • Code-C++-Linux-统计一个文件夹占据空间大小
    Code-C++-Linux-统计一个文件夹占据空间大小https://my.oschina.net/Tsybius2014/blog/330628从以上链接中拷贝的代码#include<stdio.h>#include<sys/stat.h>#include<sys/types.h>#include<unistd.h>#include<stdlib.h>#include<dirent.h>#incl......
  • C++ 按照字典序实现combination
    C++按照字典序实现combination引言C++STL提供了permutation相关的函数(std::next_permutation和std::prev_permutation),但是没有提供combination相关的函数,本文将基于字典序的方法实现一个combination相关的函数。算法回顾1.permutation用法C++的permutation是基于字典序实......
  • C++复习第五天(封装)
    封装练习,设计一个学生类,属性有姓名和学号,可以给姓名和学号赋值,可以显示姓名和学号。#include<iostream>#include<string>usingnamespacestd;classStudent{public://类中的属性和行为,我们统一称为成员stringm_name;intm_Id;voidshowStudent......
  • C++-unique_lock与lock_guard区别
    C++-unique_lock与lock_guard区别https://blog.csdn.net/ccw_922/article/details/124662275https://blog.csdn.net/sinat_35945236/article/details/124505414都可以对std::mutex进行封装,实现RAII的效果。绝大多数情况下这两种锁是可以互相替代的,区别是unique_lock比lock_gu......
  • C++ Traits的笔记
    traits意思为特性,特点在C++中用于提取类型信息#include<type_traits>type_traits库中有std::is_same可以判断两个类型是否相同先看一下使用模板提取类型信息,就是多做一层封装在使用模板的过程中假设函数中有必要声明一个变量,要和迭代器所指向的对象类型相同template<class......