Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V9.12 Fix the lnk1189 problem #4596

Open
wants to merge 3 commits into
base: stable
Choose a base branch
from

Conversation

xingfutuhuangdi
Copy link

@xingfutuhuangdi xingfutuhuangdi commented Mar 18, 2025

cmake 3.31.3
vs2022
window10

编译debug版本总是报lnk1189的问题,现在修复了。
Compiling debug version always quote lnk1189 issue now fixed.

Copy link

google-cla bot commented Mar 18, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@xingfutuhuangdi xingfutuhuangdi changed the title V9.12修复lnk1189问题 V9.12 Fix the lnk1189 problem Mar 18, 2025
sat)
add_subdirectory(ortools/${SAMPLES}/samples)
endforeach()
# foreach(SAMPLES IN ITEMS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this (and below) ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it was my fault. I forgot to remove the comment. Very Very Sorry.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it was my fault. I forgot to remove the comment. Very Very Sorry.

@@ -30,6 +30,17 @@ message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}")

if(MSVC)
set(CMAKE_CXX_STANDARD 20)
# 设置源代码和执行字符集为 UTF-8(MSVC 2015 及以上支持 /utf-8)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use english in comment
why MSVC 2015 ? we only support 2022...

@@ -30,6 +30,17 @@ message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}")

if(MSVC)
set(CMAKE_CXX_STANDARD 20)
# 设置源代码和执行字符集为 UTF-8(MSVC 2015 及以上支持 /utf-8)
message(STATE "set utf-8=======")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no STATE and this log seems a debug log/dev to suppress imho

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry,this is my fault

add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
# message(STATE "set bigobj=======")
add_compile_options(/bigobj)
SET(CMAKE_CXX_FLAGS_DEBUG "/Od2")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ? I prefer to be conservative and keep the cmake default debug configuration

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My releas compilation caused errors in lnk1189, and I found two solutions on the Internet, so I added both of them. The compilation time was too long, so I added both solutions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@Mizux Mizux Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we already enable /bigobj...

or-tools/cmake/cpp.cmake

Lines 102 to 105 in 35c27ab

# Compiler options
if(MSVC)
list(APPEND OR_TOOLS_COMPILE_OPTIONS
"/bigobj" # Allow big object

target_compile_options(${PROJECT_NAME} PUBLIC ${OR_TOOLS_COMPILE_OPTIONS})


# 设置堆栈保留大小为16MB(单位:字节)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:104857600")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /STACK:104857600")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please explain

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the stack retention size.

@Mizux
Copy link
Collaborator

Mizux commented Mar 19, 2025

this seems to have been IA generated....

@xingfutuhuangdi
Copy link
Author

I'm not very good at English, so I have to use a translation software.
I pulled the v9.12 code for compilation, and I needed a debug version, but it failed.
I had to look for ways on the Internet. I had to try them one by one, and it took about three or four hours to compile them.
There are some things I don't know about, it just work. Thank you for your efforts, and I hope these codes won't cause you any trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants