Skip to content

Line feed causes visual studio 2022 compilation error under windows#22452

Closed
laolaolulu wants to merge 3 commits intoopencv:4.xfrom
laolaolulu:4.x
Closed

Line feed causes visual studio 2022 compilation error under windows#22452
laolaolulu wants to merge 3 commits intoopencv:4.xfrom
laolaolulu:4.x

Conversation

@laolaolulu
Copy link
Copy Markdown
Contributor

@laolaolulu laolaolulu commented Aug 31, 2022

Download zip.windows environment and use visual studio to open it. The default format is "LF". The modified place fails to compile

@asenyaev
Copy link
Copy Markdown
Contributor

@laolaolulu, thank you for the PR!

Could you provide a log with an error which happens on your side?

I tried to reproduce it, but non of Visual Studio (2019, 2022) shows an error, only a warning.

Steps to reproduce:

  1. Clone repository
git clone https://github.com/opencv/opencv.git
  1. Cmake OpenCV
mkdir build && cd build
cmake -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DCMAKE_BUILD_TYPE=Release ..\opencv
  1. Build OpenCV
cmake --build . --config release

@laolaolulu
Copy link
Copy Markdown
Contributor Author

@laolaolulu,谢谢你的公关!

您能否提供一个日志,其中包含您身边发生的错误?

我试图重现它,但 Visual Studio(2019、2022)中没有一个显示错误,只有一个警告。

重现步骤:

  1. 克隆存储库
git clone https://github.com/opencv/opencv.git
  1. Cmake OpenCV
mkdir build && cd build
cmake -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DCMAKE_BUILD_TYPE=Release ..\opencv
  1. 构建 OpenCV
cmake --build . --config release

Download ZIP

@laolaolulu,谢谢你的公关!

您可以提供一个日志,其中包含您身边发生的错误吗?

我重做,但Visual Studio2错误它19、20202)中没有一个只有一个警告。

返回步骤:

  1. 图书馆存储
git clone https://github.com/opencv/opencv.git
  1. Cmake OpenCV
mkdir build && cd build
cmake -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DCMAKE_BUILD_TYPE=Release ..\opencv
  1. 制造OpenCV
cmake --build . --config release

Download ZIP.
Not a clone

@asenyaev
Copy link
Copy Markdown
Contributor

Okay, I'll try to build using a zip archive and give a feedback later.

@laolaolulu
Copy link
Copy Markdown
Contributor Author

好的,我将尝试使用 zip 存档进行构建,稍后再提供反馈。

Okay, I'll try to build using a zip archive and give a feedback later.

windows. VS opens the default "LF", build error12

@asenyaev
Copy link
Copy Markdown
Contributor

asenyaev commented Sep 1, 2022

@laolaolulu, I didn't find any issues during a build using a zip archive also.

I don't know would be this good or not, but maybe just to translate these comments in Japanese to English version and remove Japanese version. I only added it as a comment yesterday in my PR (latest commit).

Moreover, it can be converted in Japanese easily using a script from here.

@laolaolulu
Copy link
Copy Markdown
Contributor Author

@laolaolulu,我在使用 zip 存档的构建过程中也没有发现任何问题。
我不知道这样好不好,但也许只是将这些评论从日文翻译成英文版并删除日文版。我昨天才在我的 PR(最新提交)中将它作为评论添加。
此外,可以使用此处的脚本轻松将其转换为日文。

I changed my computer and repeated errors 微信截图_20220901164023

Strange, I can compile successfully by deleting the last Japanese character in line 334, or by adding any character after line 334

@laolaolulu
Copy link
Copy Markdown
Contributor Author

std::string s[1] = { ""//す };

error!

@asenyaev
Copy link
Copy Markdown
Contributor

asenyaev commented Sep 1, 2022

Could you try to replace Japanese characters with English version and build the project?

@laolaolulu
Copy link
Copy Markdown
Contributor Author

文字符

Could you try to replace Japanese characters with English version and build the project?

ok thank you! I close

@laolaolulu laolaolulu closed this Sep 1, 2022
@asenyaev
Copy link
Copy Markdown
Contributor

asenyaev commented Sep 1, 2022

Does it work with replacing?

@laolaolulu
Copy link
Copy Markdown
Contributor Author

std::string s[1] = { ""//す };

Write this line of code anywhere and compile will fail! (windows-visualstudio-LF)

@asenyaev
Copy link
Copy Markdown
Contributor

asenyaev commented Sep 1, 2022

Okay, got it. I'll replace comments in Japanese with English version in my PR then to avoid it.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants