Im developing a console app that runs on Linux and calls a windows dll using Wine.
While I am able to call the dll I am getting some unexpected output when running the .exe console app.
For example:
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded.
err:winediag:nulldrv_CreateWindow The graphics driver is missing. Check your build!
err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded.
err:winediag:nulldrv_CreateWindow The graphics driver is missing. Check your build!
err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x800736b7
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 800736b7
err:ole:get_local_server_stream Failed: 800736b7
err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded.
err:winediag:nulldrv_CreateWindow The graphics driver is missing. Check your build!
err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded.
err:winediag:nulldrv_CreateWindow The graphics driver is missing. Check your build!
err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded.
err:winediag:nulldrv_CreateWindow The graphics driver is missing. Check your build!
Could not load wine-gecko. HTML rendering will be disabled.
It seems Wine is expecting the .exe to be a Gui app.
I use Cmake to compile. Here is my Cmake instructions:
# --- Script Setup
cmake_minimum_required (VERSION 2.8)
#if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
# message(FATAL_ERROR "In-source builds are not allowed.")
#endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
# Disable in-source builds and modifications
# to the source tree.
#set(CMAKE_DISABLE_SOURCE_CHANGES ON)
#set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
# Enable compiler tests.
enable_testing()
set(CMAKE_CXX_COMPILER wineg++)
set(CMAKE_CCC_COMPILER winegcc)
project(CREDIT_SERVICE C CXX)
if(NOT CMAKE_BUILD_TYPE)
# Build debug by default.
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose build type (options are None, Debug, Release, RelWithDebInfo and MinSizeRel)." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# --- Compiler Properties
set(CREDIT_SERVICE_MAJOR_VERSION 1)
set(CREDIT_SERVICE_MINOR_VERSION 0)
set(CREDIT_SERVICE_PATCH_VERSION 0)
set(CREDIT_SERVICE_BUILD_VERSION 0)
set(CREDIT_SERVICE_VERSION ${COIN_MAJOR_VERSION}.${CREDIT_SERVICE_MINOR_VERSION}.${CREDIT_SERVICE_PATCH_VERSION}.${CREDIT_SERVICE_PATCH_VERSION})
message(STATUS "Building COIN version ${COIN_VERSION} using build type '${CMAKE_BUILD_TYPE}'.")
message(STATUS " Source directory is '${PROJECT_SOURCE_DIR}'.")
message(STATUS " Build directory is '${PROJECT_BINARY_DIR}'.")
# --- Compiler Flags
add_definitions( -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS )
# Enable most warnings.
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wshadow -Wundef -Wpointer-arith -Wcast-align -Wwrite-strings")
#add version 0x600 as windows define.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x600")
# Use C++11.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# Enable/disable optimisation depending on build type.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
# Add version as preprocessor defines.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOIN_VERSION=${COIN_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOIN_MAJOR_VERSION=${COIN_MAJOR_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOIN_MINOR_VERSION=${COIN_MINOR_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOIN_PATCH_VERSION=${COIN_PATCH_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOIN_BUILD_VERSION=${COIN_BUILD_VERSION}")
# Enable/disable profiling information.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
# --- Subdirectories
# All headers are in the /include directory.
include_directories (
"${PROJECT_SOURCE_DIR}/include"
)
link_directories ("/usr/local/lib"
)
# Examples.
add_subdirectory(UnitTest)
# Library code.
add_subdirectory(config4cpp)
add_subdirectory(configure)
add_subdirectory(src)
I tried adding:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /SUBSYSTEM:console")
and
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --subsystem console")
But cmake didnt recognize these.
How can I tell Wine that it is a console app and that no GUI is required?
Well, if you are sure the problem is with the subsystem, then you can change it with
editbin.exe /subsystem:console app.exe
The editbin
tool comes with MSVC. You can also edit the file in a hex editor, but first need to find out the offset of the subsystem field in it.
User contributions licensed under CC BY-SA 3.0