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

Fatal errors with new projects under both VS 2017 and VS 2019 #238

Closed
pixelherodev opened this issue Oct 2, 2019 · 11 comments
Closed

Fatal errors with new projects under both VS 2017 and VS 2019 #238

pixelherodev opened this issue Oct 2, 2019 · 11 comments

Comments

@pixelherodev
Copy link
Contributor

A fresh Oryol-based project fails with win64-vs{code,2017,tudio}-debug, with or without a d3d11- prefix, with errors like

LINK : fatal error LNK1104: cannot open file 'oryol_Gfx\Debug\Gfx.obj' [C:\Users\...\d3d11-win64-vs2017-debug\....vcxproj
]```
 I'm reporting this here, not there, because if I manually copy files from e.g. oryol_Gfx\Gfx.dir\Debug into that folder, and repeat for the next five or six, it eventually happens with every single dependency.
@floooh
Copy link
Owner

floooh commented Oct 2, 2019

I'll give it a try, at first glance it this path 'oryol_gfx...' looks wrong, it should be an absolute path, not relative..

@pixelherodev
Copy link
Contributor Author

Release builds are also failing, with e.g. LINK : fatal error LNK1181: cannot open input file 'oryol_Gfx\Release\Gfx.obj'

@floooh
Copy link
Owner

floooh commented Oct 2, 2019

Does https://github.com/floooh/oryol-test-app build and run for you? I just tried that on a Win10 machine with the default build config.

@pixelherodev
Copy link
Contributor Author

Either way, that path doesn't exist for any given configuration - but, in a slightly different folder (e.g. oryol_Gfx\Gfx.dir\Debug\ instead of oryol_Gfx\Debug), the files are present.

@pixelherodev
Copy link
Contributor Author

... it does build, without issues, and runs. Sorry for wasting your time, this is almost certainly an issue with my setup.

@floooh
Copy link
Owner

floooh commented Oct 2, 2019

Hmm, yeah, in my test-build the files are also in a Gfx.dir subdirectory:

...fips-build/oryol-test-app/win64-vstudio-debug/oryol_Gfx/Gfx.dir/Debug/...

Can you post your fips.yml file and toplevel CMakeLists.txt file? I suspect it has something todo with no_auto_import policy in the fips.yml file, but then not manually importing the required Oryol modules in the CMakeLists.txt file.

See here:

https://github.com/floooh/oryol-test-app/blob/aacc0ff10890bf2801c13eb05f2e7e0701d46525/fips.yml#L5-L6

And here:

https://github.com/floooh/oryol-test-app/blob/aacc0ff10890bf2801c13eb05f2e7e0701d46525/CMakeLists.txt#L15-L22

@pixelherodev
Copy link
Contributor Author

no_auto_import is set to false...

policies:
  no_auto_import: false
imports:
  oryol:
    git: https://github.com/floooh/oryol.git
  oryol-imgui:
    git: https://github.com/floooh/oryol-imgui.git
  stb:
    git: https://github.com/fips-libs/fips-stb

@pixelherodev
Copy link
Contributor Author

cmake_minimum_required(VERSION 3.1)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Suppress warnings for dependencies
    add_definitions(-Wno-implicit-fallthrough)
endif()

# include the fips main cmake file
get_filename_component(FIPS_ROOT_DIR "./build/fips" ABSOLUTE)
include("${FIPS_ROOT_DIR}/cmake/fips.cmake")

if (FIPS_EMSCRIPTEN)
    add_definitions(-DSOKOL_GLES3)
    set(SOKOL_GLES3 TRUE)
elseif (FIPS_RASPBERRYPI)
    add_definitions(-DSOKOL_GLES2)
    set(SOKOL_GLES2 TRUE)
elseif (FIPS_ANDROID)
    add_definitions(-DSOKOL_GLES3)
    set(SOKOL_GLES3 TRUE)
elseif (SOKOL_USE_D3D11)
    add_definitions(-DSOKOL_D3D11)
    set(SOKOL_D3D11 TRUE)
elseif (SOKOL_USE_METAL)
    add_definitions(-DSOKOL_METAL)
    set(SOKOL_METAL TRUE)
else()
    if (FIPS_IOS)
        add_definitions(-DSOKOL_GLES3)
        set(SOKOL_GLES3 TRUE)
    else()
        add_definitions(-DSOKOL_GLCORE33)
        set(SOKOL_GL TRUE)
    endif()
endif()

fips_setup(PROJECT DocTag-Client)
project(DocTag-Client VERSION 0.1.0.0)

set(VERSION_PREFIX "alpha-")
set(VERSION_SUFFIX "")
configure_file(${CMAKE_SOURCE_DIR}/src/config.h.in ${CMAKE_BINARY_DIR}/config.h)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    # Re-enable warnings that are suppressed for dependencies
    add_definitions(-Wimplicit-fallthrough)
    # Make all warnings errors, helps avoid accidentally introducing UB. Done here
    # so as to affect the client and libdoctag both without affecting any third
    # party dependencies.
    add_definitions(-Werror)
endif()

# Manually import libdoctag
set(FIPS_IMPORT 1)
get_filename_component(LIBDOCTAG_DIR "../libdoctag" ABSOLUTE)
add_subdirectory("${LIBDOCTAG_DIR}" "libdoctag")
set(FIPS_IMPORT)
fips_include_directories("${LIBDOCTAG_DIR}/src")
if (FIPS_WINDOWS)
    fips_include_directories("${LIBDOCTAG_DIR}/src/backends/windows")
endif()

# Has to be defined as cmdline for stdio to work properly on Windows
fips_begin_app(doctag-client cmdline)
fips_src(src NO_RECURSE)
fips_include_directories(${CMAKE_BINARY_DIR})
fips_deps(Gfx Input IMUI doctag)
fips_end_app()

if (UNIT_TESTING)
	add_definitions(-DUNIT_TESTING)
endif()

fips_finish()

@floooh
Copy link
Owner

floooh commented Oct 2, 2019

Hmm weird. If you find out what's wrong can you post an update here? I'd like to know what happened there. Even when it's not a bug a bug in fips it might sense to print more helpful error messages...

@pixelherodev
Copy link
Contributor Author

Yeah, sure. Going to have to find out what's wrong now that I know this on my end and I really need to get this working 😬

@pixelherodev
Copy link
Contributor Author

Going to start with a literally empty folder and slowly build it up to see what pushes it over to the error.

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

No branches or pull requests

2 participants