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

xmake dpp.lib(cluster.cpp.obj) : error LNK2019 #1007

Closed
FabriicioMelo opened this issue Nov 18, 2023 · 14 comments
Closed

xmake dpp.lib(cluster.cpp.obj) : error LNK2019 #1007

FabriicioMelo opened this issue Nov 18, 2023 · 14 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@FabriicioMelo
Copy link

Git commit reference:
ffa2653

Describe the bug:
When trying to install dpp through xmake, I receive this error, which does not allow me to start the project.

To Reproduce:
Steps to reproduce the behavior:

  1. Create a new xmake project
  2. Update the xmake.lua file by adding the dpp package, below the minimum configuration:
add_rules("mode.debug", "mode.release")

add_requires("dpp")

target("test-bot")
	set_kind("binary")
	add_files("src/*.cpp")

	add_packages("dpp")
  1. Then build it xmake build

Screenshots:
image

System Details:

  • OS: Windows 11 Pro 64 bits
  • Version: 22621.2715

Adicional Info:
I literally did what I was told on your website, here is the link: https://dpp.dev/10.0.28/install-xmake.html

@FabriicioMelo FabriicioMelo added the bug Something isn't working label Nov 18, 2023
@Mishura4 Mishura4 self-assigned this Nov 18, 2023
@Jaskowicz1
Copy link
Contributor

@Mishura4 This is related to #980. Is this because it's not ran inside visual studio?

@Mishura4
Copy link
Member

I'll investigate. In the meantime you can add DPP_BYPASS_VERSION_CHECKING to the list of defines in your project to work around this

@braindigitalis
Copy link
Contributor

you didn't link the windows sdk which contains the messageboxA function, this is required client side in the program which includes dpp.

@FabriicioMelo
Copy link
Author

@braindigitalis Thanks to you, I managed to compile. I found how to link to the sdk.
My xmake.lua file now looks like this:

add_rules("mode.debug", "mode.release")

add_requires("dpp")

target("test-bot")
    add_rules("win.sdk.application")

    set_kind("binary")
    add_files("src/*.cpp")

    add_packages("dpp")

You need to update this on your website.

@Mishura4
Copy link
Member

Please don't close this if it's not yet resolved on our end.

Thank you though for the solution, we'll look at this. There are potentially other solutions as well.

@Jaskowicz1
Copy link
Contributor

Jaskowicz1 commented Nov 22, 2023

Maybe we could simply change the solution to patch Scary->MyHead? If the windows api is found (check with #ifdef) then we do the message box, otherwise we could do a fallback and just send the error log via std::cout or something.

@Mishura4
Copy link
Member

I have ideas, I'll take a look soon
Very busy atm so probably next week

@Jaskowicz1
Copy link
Contributor

I have ideas, I'll take a look soon Very busy atm so probably next week

Okie dokie!

Copy link
Contributor

This issue has had no activity and is being marked as stale. If you still wish to continue with this issue please comment to reopen it.

@github-actions github-actions bot added the Stale label Jan 24, 2024
@Mishura4
Copy link
Member

i forgor

@github-actions github-actions bot removed the Stale label Jan 25, 2024
@braindigitalis
Copy link
Contributor

did you forgor mor?

@Jaskowicz1 Jaskowicz1 moved this to Todo in D++ To-do Feb 19, 2024
@Jaskowicz1
Copy link
Contributor

@Mishura4 Did you forgor even mor?

@github-actions github-actions bot added the Stale label Jun 3, 2024
@brainboxdotcc brainboxdotcc deleted a comment from github-actions bot Jun 3, 2024
@Nk125
Copy link
Contributor

Nk125 commented Jun 30, 2024

Why not including the pure user32.lib from windows?, I'm not so experienced handling with xmake but something like a pragma to import user32 in this lines.
Also would be useful if TEXT() macro (defined in windows.h) is used in MessageBox to support unicode and non-unicode windows builds, avoiding compile issues in the future.

#ifdef _WIN32
#include <windows.h>
#pragma comment(lib, "user32.lib")

if constexpr (BuildType != build_type::universal && BuildType != expected) {
		MessageBox(
			nullptr,
			TEXT(
				"Mismatched Debug/Release ...\n"
				"..."
			),
			TEXT("D++ Debug/Release mismatch"),
			MB_OK | MB_ICONERROR
		);
		// ...
}
#endif
// ...

Useful links:
MessageBoxA requirements
MessageBoxW requirements

Copy link
Contributor

This issue has had no activity and is being marked as stale. If you still wish to continue with this issue please comment to reopen it.

@github-actions github-actions bot added the Stale label Aug 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in D++ To-do Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
Status: Done
Development

No branches or pull requests

5 participants