janet-lang / jpm

Janet Project Manager
MIT License
65 stars 21 forks source link

(Windows) Fatal error LNK4272: module machine type 'x86' conflicts with target machine type 'x64' #54

Closed quienn closed 1 year ago

quienn commented 2 years ago

Aside from the error that's inside this issue's title, there's some other artifacts the build output shows (it's in Spanish, I'm sorry):

creating native module build/_uri.dll...
   Creando biblioteca build\_uri.lib y objeto build\_uri.exp
uri.o : error LNK2019: símbolo externo _janet_nanbox32_from_tagp sin resolver al que se hace referencia en la función _jescape
uri.o : error LNK2019: símbolo externo _janet_string sin resolver al que se hace referencia en la función _jescape
uri.o : error LNK2019: símbolo externo _janet_smalloc sin resolver al que se hace referencia en la función _jescape
uri.o : error LNK2019: símbolo externo _janet_sfree sin resolver al que se hace referencia en la función _jescape
uri.o : error LNK2019: símbolo externo _janet_cfuns sin resolver al que se hace referencia en la función __janet_init
uri.o : error LNK2019: símbolo externo _janet_fixarity sin resolver al que se hace referencia en la función _jescape
uri.o : error LNK2019: símbolo externo _janet_getstring sin resolver al que se hace referencia en la función _jescape
C:\Users\quien\AppData\Local\Apps\Janet\C\\janet.lib : warning LNK4272: el tipo de máquina de biblioteca 'x64' está en conflicto con el tipo de máquina de destino 'x86'
build\_uri.dll : fatal error LNK1120: 7 externos sin resolver
error: command failed with non-zero exit code 1120
error: build fail
  in pdag [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in <anonymous> [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/pm.janet] on line 236, column 9
  in <anonymous> [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/pm.janet] on line 221, column 5
  in bundle-install [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/pm.janet] on line 219, column 3
  in <anonymous> [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/pm.janet] on line 234, column 13
  in <anonymous> [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/pm.janet] on line 221, column 5
  in bundle-install [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/pm.janet] on line 219, column 3
  in install [C:/Users/quien/AppData/Local/Apps/Janet/Library/jpm/commands.janet] (tailcall) on line 197, column 20
  in run-main [boot.janet] on line 3776, column 16
  in cli-main [boot.janet] on line 3921, column 17
quienn commented 2 years ago

note: I was just trying to install the Joy framework. This happens with all projects that are C modules.

sogaiu commented 2 years ago

May be the following text is relevant?

If you want to use jpm to install native extensions, you will also need to install Visual Studio, ideally a recent release (2019 or 2017 should work well). Then, running jpm from the x64 Native Tools Command Prompt should work for a 64-bit build, and from the Developer Command Prompt should work for 32-bit builds. Using these specific command prompts for jpm simply lets jpm use the Microsoft compiler to compile native modules on install.

Specifically, the bit about:

running jpm from the x64 Native Tools Command Prompt should work for a 64-bit build, and from the Developer Command Prompt should work for 32-bit builds

via: https://janet-lang.org/docs/index.html#Installation

quienn commented 2 years ago

I tried it with all of them, and it still shows the same error...

image

bakpakin commented 2 years ago

This does look strange, probably an issue with linking to the 32 bit build. The easiest fix would be to only use the 64 bit build, since there is very little hardware out there that needs 32 bit.

bakpakin commented 1 year ago

also you need to clean the build if you used the wrong architecture, that would result in the same issues. Closing as cannot reproduce.