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

Add Windows CMake instructions #57

Open
fedorovmichael opened this issue May 31, 2020 · 6 comments
Open

Add Windows CMake instructions #57

fedorovmichael opened this issue May 31, 2020 · 6 comments
Labels

Comments

@fedorovmichael
Copy link

Hi,
I try to run the example as is and after running cmake command running the command make and getting error:
make: *** No targets specified and no makefile found

@domesticmouse
Copy link
Member

By default, cmake on Windows generates a VSCode solution file. You should be able to pass cmake the appropriate flags to generate an appropriate Makefile, but I'm not a CMake expert.

@fedorovmichael
Copy link
Author

but it from your example:
https://github.com/dart-lang/samples/tree/master/ffi

Readme:
Building native libraries
Each sample uses CMake to generate a Makefile. To build the native library for each sample:

cd hello_world/hello_library
cmake .
make
The make command creates a libhello.dylib (macOS), libhello.dll (Windows) or libhello.so (Linux) library file.

@domesticmouse domesticmouse reopened this Jun 1, 2020
@domesticmouse domesticmouse self-assigned this Jun 1, 2020
@MrUnfunny
Copy link

MrUnfunny commented Oct 23, 2020

@domesticmouse By passing <-G "Unix Makefiles"> flag with cmake command, we can generate appropriate makefiles for "make" command, but using it in this way, the path of generated dynamic library will be "..\hello_library\libhello.dll" instead of "..\hello_library\Debug\hello.dll" as expected by the code. So, either we can change path in code or use visual studio to build sln file. However, the documentation for windows must be update in either case.

@function1983
Copy link

Running make in windows is not so trivial as in Linux. Here are the steps:

  • Run cmake .. This will create a visual studio project structure.
  • Double click on hello_library.vcxproj to open with visual studio (you should have visual studio installed, community version works just fine)
  • Default build option is debug, change it to release
  • Click Build or press F7

You should find 4 files including hello.dll in a newly created Release folder.

@johnpryan johnpryan changed the title windows 10 64 bit make: *** No targets specified and no makefile found Add Windows CMake instructions May 10, 2022
@victorruandev
Copy link

Hello! I'm trying to do what the READ.ME explains but it is not working. Somebody can help-me? I just copy the project called "Hello World", my code is exactly the same.

@domesticmouse
Copy link
Member

Also this one @cbracken.

@domesticmouse domesticmouse removed their assignment Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants