linker-errors

Getting INT 16h key scancode instead of character

▼魔方 西西 提交于 2021-01-28 09:26:14
问题 I'm writing a simple bootloader, and I have a getch function. char getch() { uint16_t inchar; __asm__ __volatile__ ("int $0x16\n\t" : "=a"(inchar) : "0"(0x0)); return (char)inchar; } I tried the first obvious solution, which is remove the casting to char of the inchar variable, but when I print it still returning a char instead of code. My println implementation: void println(char *str) { while (*str) { // AH=0x0e, AL=char to print, BH=page, BL=fg color __asm__ __volatile__ ("int $0x10" : :

Getting INT 16h key scancode instead of character

冷暖自知 提交于 2021-01-28 09:26:00
问题 I'm writing a simple bootloader, and I have a getch function. char getch() { uint16_t inchar; __asm__ __volatile__ ("int $0x16\n\t" : "=a"(inchar) : "0"(0x0)); return (char)inchar; } I tried the first obvious solution, which is remove the casting to char of the inchar variable, but when I print it still returning a char instead of code. My println implementation: void println(char *str) { while (*str) { // AH=0x0e, AL=char to print, BH=page, BL=fg color __asm__ __volatile__ ("int $0x10" : :

Dynamic linker gives “cannot open shared object file: No such file or directory” after using -L option

☆樱花仙子☆ 提交于 2021-01-28 05:41:26
问题 I have a project struct of a lib like this: lib_ode/ src/ main/ c/ ode.c incluce/ ode.h test/ c/ test_ode.c include/ target/ .objs/ test/ In this struct I had compile my project with those 4 commands: (creating lib object) gcc -fPIC -O3 -DNDEBUG -g -Wall -Isrc/main/include -c -o "target/.objs/ode.o" src/main/c/ode.c (creating lib) gcc -shared target/.objs/ode.o -lm -o "target/libode.so" (creating test object) gcc -fPIC -O3 -DNDEBUG -g -Wall -Isrc/main/include -c -Isrc/test/include -o target/

What is the correct way to link C++17 filesystem with CMake?

帅比萌擦擦* 提交于 2021-01-28 01:49:10
问题 I noticed that linking my CMake project with gcc 8.3 fails to link functions from std::filesystem. This is not the case with gcc 9, clang 7 or clang 8. I found solutions like this and this, but these hard-code the linking of stdc++fs , which is normally not what you want to do. So what is the correct way to link such libraries? Do I have to do a find_package ? What would be the package I am looking for? 回答1: It looks like there is no proper solution to this as of now. There still is an open

MSVC - Creating a static library via Makefile

喜夏-厌秋 提交于 2021-01-27 21:31:45
问题 So I've been trying to create a static library under Windows under MSVC by launching mingw32-make under Microsoft's x64 Command Line Tools. I get linker error LNK1561: entry point must be defined. For completeness, here's my Makefile. all: build\lib\libds.lib build\lib\libds.lib: build\obj\priority-queue.obj link /OUT:build\bin\libds.lib build\obj\priority-queue.obj build\obj\priority-queue.obj: libs/ds/priority-queue.c include/ds/priority-queue.h cl /Iinclude /c libs/ds/priority-queue.c /Fo

\mingw-w64\ … \ld.exe: cannot find -lboost_filesystem

感情迁移 提交于 2021-01-27 17:32:23
问题 I'm trying to compile simple c++ program with mingw on "windows 7 64bit" command prompt. Error I get is: >gcc fs.cpp -lboost_filesystem -lboost_system c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lboost_filesystem c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find

C++ template specialization definitions shared across files

穿精又带淫゛_ 提交于 2021-01-27 07:05:31
问题 I have a template class "Extra," defined in "extra.h," with a function "doSomething," and I have defined two specializations of "doSomething." Two different functions create objects of type "Extra," each with a different type parameter, and each calls a different one of the specializations. The two client functions, "client1" and "client2," are defined in two files, "client1.cpp" and "client2.cpp," respectively. In a third file, "main" calls "client1" and then "client2." Now, "client1.cpp"

GSL linkage on Windows

穿精又带淫゛_ 提交于 2021-01-07 03:11:21
问题 I am trying to compile examples from GSL documentation. Windows, Cmake + MSVS + GSL 2.6 installed under conda. Basic example gets compiled and works just fine: cmake_minimum_required(VERSION 3.15) project(test) find_package(GSL REQUIRED) add_executable(test) target_sources(test PRIVATE main.cpp) target_include_directories(test PRIVATE "${GSL_INCLUDE_DIRS}") target_link_libraries(test "${GSL_LIBRARIES}") #include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 5.0; double

GSL linkage on Windows

廉价感情. 提交于 2021-01-07 03:09:38
问题 I am trying to compile examples from GSL documentation. Windows, Cmake + MSVS + GSL 2.6 installed under conda. Basic example gets compiled and works just fine: cmake_minimum_required(VERSION 3.15) project(test) find_package(GSL REQUIRED) add_executable(test) target_sources(test PRIVATE main.cpp) target_include_directories(test PRIVATE "${GSL_INCLUDE_DIRS}") target_link_libraries(test "${GSL_LIBRARIES}") #include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 5.0; double

GSL linkage on Windows

二次信任 提交于 2021-01-07 03:09:17
问题 I am trying to compile examples from GSL documentation. Windows, Cmake + MSVS + GSL 2.6 installed under conda. Basic example gets compiled and works just fine: cmake_minimum_required(VERSION 3.15) project(test) find_package(GSL REQUIRED) add_executable(test) target_sources(test PRIVATE main.cpp) target_include_directories(test PRIVATE "${GSL_INCLUDE_DIRS}") target_link_libraries(test "${GSL_LIBRARIES}") #include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 5.0; double