My executable is setup.exe, I have a pdb file named setup.pdb in the same directory c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1
My symbol file path is this
cache*c:\symbols;srv*https://msdl.microsoft.com/download/symbols;c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1
When I reload using this
.reload /f
I can see this error :
SYMSRV: c:\symbols\image00000001`3f6b0000.dbg\574587D664000\image00000001`3f6b0000.dbg not found
SYMSRV: c:\symbols\image00000001`3f6b0000.dbg\574587D664000\image00000001`3f6b0000.dbg not found
SYMSRV: https://msdl.microsoft.com/download/symbols/image00000001`3f6b0000.dbg/574587D664000/image00000001`3f6b0000.dbg not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\image00000001`3f6b0000.dbg - file not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\.exe\image00000001`3f6b0000.dbg - path not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\symbols\.exe\image00000001`3f6b0000.dbg - path not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\setup.pdb\image00000001`3f6b0000.dbg - path not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\setup.pdb\.exe\image00000001`3f6b0000.dbg - path not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\setup.pdb\symbols\.exe\image00000001`3f6b0000.dbg - path not found
DBGHELP: C:\ADE\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\Disk1\install\image00000001`3f6b0000.dbg - file not found
DBGHELP: C:\ADE\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\Disk1\install\.exe\image00000001`3f6b0000.dbg - path not found
DBGHELP: C:\ADE\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\Disk1\install\symbols\.exe\image00000001`3f6b0000.dbg - path not found
DBGHELP: image00000001`3f6b0000 missing debug info. Searching for pdb anyway
DBGHELP: Can't use symbol server for image00000001`3f6b0000.pdb - no header information available
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\image00000001`3f6b0000.pdb - file not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\exe\image00000001`3f6b0000.pdb - file not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\symbols\exe\image00000001`3f6b0000.pdb - file not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\setup.pdb\image00000001`3f6b0000.pdb - file not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\setup.pdb\exe\image00000001`3f6b0000.pdb - file not found
DBGHELP: c:\ade\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\disk1\install\setup.pdb\symbols\exe\image00000001`3f6b0000.pdb - file not found
DBGHELP: C:\ADE\bpurana\.ade\view_storage\bpurana_oui_424\oui\cd\Disk1\install\image00000001`3f6b0000.pdb - file not found
DBGHELP: image00000001`3f6b0000.pdb - file not found
*** ERROR: Module load completed but symbols could not be loaded for image00000001`3f6b0000
I am wondering
why is it looking for a dbg file when the pdb is already present in the path.
Why is there a refernce to the image00000001`3f6b0000.pdb ; when the setup.pdb is in the symbol path?
Where is this image<> file name being populated from ?
Edit 1:
Command used for compilation :
icl.exe /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN64" /D "_DEBUG" /D "_WINDOWS" /Fp".\win64\debug\setup.pch" /YX /Fo".\win64\debug\\" /Fd".\win64\debug\\" /c ..\c\runInstaller.c
Edit 2 :
This is what I see when I try the cdb on the exe file. It seems to have a image<> executable within .
C:\Program Files\Debugging Tools for Windows (x64)>cdb.exe -c "q" C:\ADE\bpurana_oui_win\oui\cd\Disk1\install\setup.exe | grep -A 1 -i Execu*
Executable search path is:
ModLoad: 00007ff7`e4e10000 00007ff7`e4e74000 image00007ff7`e4e10000
The ICL version is this :
[C:\ADE\bpurana_oui_win\oui]icl /version
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.4.237 Build 20140805
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.
Even with this the issue is still persisting is there anything else I need to fix ?
directory with a single src file
:\>ls -l
total 4
-rw-rw-rw- 1 HP 0 63 2016-05-27 13:51 hw.cpp
src is a simple hellow orld
:\>cat hw.cpp
#include <stdio.h>
void main (void)
{
printf("hello");
}
compiled with Debug info
:\>cl /nologo /Zi /Fe:hwdbg.exe hw.cpp
hw.cpp
compiled without debug info
:\>cl /nologo /Fe:hwnodbg.exe hw.cpp
hw.cpp
dumping the contents of Debug Directory in Pe header for nodbg and dbg exes
:\>dumpbin /nologo /headers hwdbg.exe hwnodbg.exe | grep -i -A 4 Debug*
5A220 [ 38] RVA [size] of Debug Directory
xxxx
57480732 cv 38 0005B048 59C48 Format: RSDS, {2233DB57-2608-46AF-A94C-0AB233BB333C},
--
164B0 [ 1C] RVA [size] of Debug Directory
xxxxx
57480738 coffgrp 300 000165F4 159F4
loading both the executables in windbg and checking image names
:\>cdb.exe -c "q" hwdbg.exe | grep -A 1 -i Execu*
Executable search path is:
ModLoad: 01070000 010d5000 hwdbg.exe
:\>cdb.exe -c "q" hwnodbg.exe | grep -A 1 -i Execu*
Executable search path is:
ModLoad: 01320000 0133c000 image01320000
Related
I'm on Windows 10, and I installed the toolchain by following chapter 8.2 of the getting-started-with-pico.pdf file. I created the test-project by following chapter 7 of the same PDF file.
Contents of my project folder
CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
include(pico_sdk_import.cmake)
project(test_project)
pico_sdk_init()
add_executable(test test.c)
pico_enable_stdio_usb(test 1)
pico_enable_stdio_uart(test 1)
pico_sdk_import.cmake
# This is a copy of <PICO_SDK_PATH>/external/pico_sdk_import.cmake
# This can be dropped into an external project to help locate this SDK
# It should be include()ed prior to project()
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
endif ()
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT))
set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT})
message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')")
endif ()
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH))
set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH})
message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')")
endif ()
set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the PICO SDK")
set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of PICO SDK from git if not otherwise locatable")
set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK")
if (NOT PICO_SDK_PATH)
if (PICO_SDK_FETCH_FROM_GIT)
include(FetchContent)
set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR})
if (PICO_SDK_FETCH_FROM_GIT_PATH)
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
endif ()
FetchContent_Declare(
pico_sdk
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
GIT_TAG master
)
if (NOT pico_sdk)
message("Downloading PICO SDK")
FetchContent_Populate(pico_sdk)
set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR})
endif ()
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
else ()
message(FATAL_ERROR
"PICO SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git."
)
endif ()
endif ()
get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
if (NOT EXISTS ${PICO_SDK_PATH})
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found")
endif ()
set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake)
if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE})
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the PICO SDK")
endif ()
set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the PICO SDK" FORCE)
include(${PICO_SDK_INIT_CMAKE_FILE})
File test.c
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
#include "pico/binary_info.h"
const uint LED_PIN=25;
int main() {
bi_decl(bi_program_description("This is a test binary."));
bi_decl(bi_1pin_with_name(LED_PIN,"On-board LED"));
stdio_init_all();
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while(1) {
gpio_put(LED_PIN, 0);
sleep_ms(250);
gpio_put(LED_PIN,1);
puts("Hello World\n");
sleep_ms(1000);
}
}
Error
So when I run these same commands in my pico-examples folder it works completely fine.
C:\Users\bensl\Desktop\Electronics\Pico\test_project>mkdir build
C:\Users\bensl\Desktop\Electronics\Pico\test_project>cd build
C:\Users\bensl\Desktop\Electronics\Pico\test_project\build>cmake -G "NMake Makefiles" ..
Pico SDK is located at C:/Users/bensl/Desktop/Electronics/Pico/pico-sdk
PICO platform is rp2040.
PICO compiler is
PICO_GCC_TRIPLE defaulted to arm-none-eabi
PICO target board is pico.
Using board configuration from C:/Users/bensl/Desktop/Electronics/Pico/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at C:/Users/bensl/Desktop/Electronics/Pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
ELF2UF2 will need to be built
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/bensl/Desktop/Electronics/Pico/test_project/build
C:\Users\bensl\Desktop\Electronics\Pico\test_project\build>nmake
Microsoft (R) Program Maintenance Utility Version 14.28.29336.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 1%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.28.29336.0
-- The CXX compiler identification is MSVC 19.28.29336.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/bensl/Desktop/Electronics/Pico/test_project/build/elf2uf2/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_bce2f\fast && "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\nmake.exe" -f CMakeFiles\cmTC_bce2f.dir\build.make /nologo -L CMakeFiles\cmTC_bce2f.dir\build
Building C object CMakeFiles/cmTC_bce2f.dir/testCCompiler.c.obj
C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe #C:\Users\bensl\AppData\Local\Temp\nm3FF1.tmp
testCCompiler.c
Linking C executable cmTC_bce2f.exe
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_bce2f.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\mt.exe --manifests -- C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\link.exe /nologo #CMakeFiles\cmTC_bce2f.dir\objects1.rsp #C:\Users\bensl\AppData\Local\Temp\nm407E.tmp
LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\link.exe /nologo #CMakeFiles\cmTC_bce2f.dir\objects1.rsp /out:cmTC_bce2f.exe /implib:cmTC_bce2f.lib /pdb:C:\Users\bensl\Desktop\Electronics\Pico\test_project\build\elf2uf2\CMakeFiles\CMakeTmp\cmTC_bce2f.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_bce2f.dir/intermediate.manifest CMakeFiles\cmTC_bce2f.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/bensl/Desktop/Electronics/Pico/test_project/build/elf2uf2/CMakeFiles/CMakeOutput.log".
See also "C:/Users/bensl/Desktop/Electronics/Pico/test_project/build/elf2uf2/CMakeFiles/CMakeError.log".
NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
I had the same problem. Then, I used cmake -G "MinGW Makefiles" .. instead. It worked for me. But for build I used nmake.
Note: MinGW GCC must be installed in your device
You should have two compilers. One cross compiler for the target and another one for the Windows host. The Windows compiler is needed to compile for example elf2uf2.exe.
The problem is here:
-- The C compiler identification is MSVC 19.28.29336.0
The compiler should be arm_none_eabi_gcc. I have the same problem, but I don't know how to change this yet.
This question already has answers here:
CMake link to external library
(6 answers)
Closed 2 years ago.
I created a dynamic lib using Rust (crate type = "cdylib"). Rust/Cargo produced two files: text_loading_lib.dll and text_loading_lib.dll.lib. I want to build a really simple project (hello_world.c) on Windows that uses a function from this lib using only MSVC (the Microsoft Visual C++ toolset) and JetBrains CLion/CMake.
main.c
#include <stdio.h>
typedef unsigned long long usize_t; // 64 bit / usize on 64 bit machine
extern void show_loading_animation_ffi(usize_t, usize_t, int, usize_t (*prog_fn)());
// function that tells the lib how many percent progress we made so far
usize_t progress_reporter() { return (usize_t) 20 }
int main(void) {
show_loading_animation_ffi(0, 100, TARGET_STDERR, progress_reporter);
return 0;
}
I'm familiar with this process on UNIX, but I have no clue how it is done on Windows. On UNIX, I'd link the shared object against main.c during compilation and provide its location using LD_LIBRARY_PATH at runtime. Is is similar on Windows?
I also tried it with a CMAKE project using JetBrains CLion, but still no success. When I try to run main() in main.c from CLion, there are always errors that the target can't be created. The library files created with Rust (text_loading_lib.dll and text_loading_lib.dll.lib) are in the same directory as CMakeLists.txt and main.c.
CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(main C)
set(CMAKE_C_STANDARD 11)
add_executable(main main.c)
# the path is correct
target_link_libraries(main text_loading_animation)
#also tried: target_link_libraries(main text_loading_animation.dll)
#also tried: target_link_libraries(main text_loading_animation.dll.lib)
CLion-Output is:
[ 50%] Linking C executable main.exe
LINK Pass 1: command "C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1426~1.288\bin\Hostx64\x64\link.exe /nologo #CMakeFiles\main.dir\objects1.rsp /out:main.exe /implib:main.lib /pdb:C:\dev\lib-text-loading-animation-rust\calling-from-c-examples\windows\cmake-build-debug\main.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console text_loading_animation.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\main.dir/intermediate.manifest CMakeFiles\main.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: File "text_loading_animation.lib" can't be opened.
NMAKE : fatal error U1077: ""C:\Program Files\JetBrains\CLion 2020.1.1\bin\cmake\win\bin\cmake.exe"": Return-Code "0xffffffff"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\nmake.exe"": Rückgabe-Code "0x2"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\nmake.exe"": Rückgabe-Code "0x2"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\nmake.exe"": Rückgabe-Code "0x2"
Stop.
I got it working with CMake as well as the Command Line.
Cmake: CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(main C)
set(CMAKE_C_STANDARD 11)
add_executable(main main.c)
# "*.dll.lib" - important! not just *.dll
target_link_libraries(main ${CMAKE_CURRENT_SOURCE_DIR}/../../target/release/text_loading_animation.dll.lib)
# copy DLL file into target dir
add_custom_command(TARGET main POST_BUILD # Adds a post-build event to "main"
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${PROJECT_SOURCE_DIR}/text_loading_animation.dll" # <--this is in-file
$<TARGET_FILE_DIR:main>) # <--this is out-file path
Now you can "run main" in Jetbrains CLion for example.
Command Line (windows batch script)
Important part is:
cl main.c /link text_loading_animation.dll.lib
main.exe
Full Batch script:
#echo off
rem: clean old data
del main.exe main.obj *.dll *.dll.lib
rem: copy rust lib into current dir
xcopy /y ..\..\target\release\text_loading_animation.dll .
xcopy /y ..\..\target\release\text_loading_animation.dll.lib .
rem: sets up Visual Studio Compilertoolsuite environment
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
rem: *.dll.lib contains header information during compile; *.dll is the runtime file that must be in the same directory/path
rem: "cl" is windows compiler: produces main.obj and main.exe; main.obj is not needed in the end;
rem: it is only for the stage between compiling and linking
rem: /W4 is highest warnings flag
cl /W4 main.c /link text_loading_animation.dll.lib
del main.obj
rem: now execute
main.exe
Hi I'm rather new to Windows command prompt(have only been using Linux-based OS)
I'm trying to install OpenBLAS for Windows according to this tutorial.
When I tried running step 6
cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DBUILD_WITHOUT_LAPACK=no -DNOFORTRAN=0 -DDYNAMIC_ARCH=ON -DCMAKE_BUILD_TYPE=Release
I get the following error
Compiling the C compiler identification source file
"CMakeCCompilerId.c" failed. Compiler:
C:/ProgramData/Anaconda3/Library/bin/clang-cl.exe Build flags:
/DWIN32;/D_WINDOWS;/W3 Id flags:
The output was: 1104 LINK : fatal error LNK1104: ファイル 'libcmt.lib'
を開くことができません。 clang-cl.exe: error: linker command failed with exit code
1104 (use -v to see invocation)
Run Build Command:"C:/ProgramData/Anaconda3/Library/bin/ninja.exe"
"cmTC_e55c4" [1/2] Building C object
CMakeFiles\cmTC_e55c4.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_e55c4.exe
FAILED: cmTC_e55c4.exe
cmd.exe /C "cd . && C:\ProgramData\Anaconda3\Library\bin\cmake.exe -E
vs_link_exe --intdir=CMakeFiles\cmTC_e55c4.dir --manifests --
C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe
/nologo CMakeFiles\cmTC_e55c4.dir\testCCompiler.c.obj
/out:cmTC_e55c4.exe /implib:cmTC_e55c4.lib /pdb:cmTC_e55c4.pdb
/version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /foCMakeFiles\cmTC_e55c4.dir/manifest.res
CMakeFiles\cmTC_e55c4.dir/manifest.rc" failed (exit code 0) with the
following output:
隰悶・・ョ螢ケ・・ケァ蠕娯螺郢晁シ斐<郢ァ・、郢晢スォ邵コ迹夲スヲ荵昶命邵コ荵晢ス顔クコ・セ邵コ蟶呻ス鍋クイ繝サ ninja: build
stopped: subcommand failed.
Random but also,I don't know why it's outputting Chinese characters in the end...(my system language is set to Japanese and not Chinese)
Sorry for late answer - you should also add -DCMAKE_RC_COMPILER=llvm-rc (don't remember correct name)
I'm currently studying the xv6 OS.
I found out here how to add a system call by modifying the MAKEFILE file.
My question is: how do we add simple text files or any other kind of file to be seen in the xv6 system once it boots?
README file in Xv6 is a generic file too. Searching for occurrences of README in the MakeFile and adding your required file will be sufficient.
Suppose new.txt is the file you want to add.
Parts of the MakeFile to be changed are:
1)
fs.img: mkfs README new.txt $(UPROGS)
./mkfs fs.img README new.txt $(UPROGS)
2)
PRINT = runoff.list runoff.spec README new.txt toc.hdr toc.ftr $(FILES)
3)
EXTRA=\
mkfs.c ulib.c user.h cat.c echo.c forktest.c grep.c kill.c\
ln.c ls.c mkdir.c rm.c stressfs.c usertests.c wc.c zombie.c\
printf.c umalloc.c\
README new.txt dot-bochsrc *.pl toc.* runoff runoff1 runoff.list\
.gdbinit.tmpl gdbutil\
Like Sravani suggested, I added my "new.txt" adjecent to all occurences of README. I got the error:
make: No rule to make target `sample.txt', needed by `fs.img'. Stop.
Then I removed the file type, i.e ".txt". Works well now!
In Eclipse, I am getting a post build error when I convert my C elf file into an IMG file.
This is the error:
Building target: USBDebug.elf
Invoking: ARM Sourcery Windows GCC C Linker
arm-none-eabi-gcc ./cyfx_gcc_startup.o ./cyfxtx.o ./cyfxusbdebug.o ./cyfxusbdscr.o -T"C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\/firmware/common/fx3.ld" -nostartfiles -Wl,-Map,USBDebug.map -Wl,-d -Wl,--no-wchar-size-warning -Wl,--gc-sections -Wl,--entry,CyU3PFirmwareEntry "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\lib\fx3_debug\cyfxapi.a" "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\lib\fx3_debug\cyu3lpp.a" "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\lib\fx3_debug\cyu3threadx.a" "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\arm-none-eabi\lib\libc.a" "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\lib\gcc\arm-none-eabi\4.5.2\libgcc.a" -mcpu=arm926ej-s -mthumb-interwork -g -gdwarf-2 -o"USBDebug.elf"
**/usr/bin/sh: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\util\elf2img\elf2img.exe: command not found
Finished building target: USBDebug.elf
cs-make[1]: [post-build] Error 127 (ignored)**
cs-make --no-print-directory post-build
Converting ELF to image (.img) format
"C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\util\elf2img\elf2img.exe" -i USBDebug.elf -o USBDebug.img
It seems odd to me that /usr/bin/sh appears even though I am in windows. I can go into the command prompt and type this in and it works perfectly
"C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.2\\util\elf2img\elf2img.exe" -i USBDebug.elf -o USBDebug.img
Would anybody know why I am getting command not found?
The problem is that the spaces and parentheses in your path are not escaped correctly.
I was able to fix this on my setup by going to "C/C++ Build" -> "Settings" -> "Build Steps"
and changing the double quotes (") in the command to single quotes (').
More information about this problem can be found here http://www.cypress.com/?app=forum&id=167&rID=78767