How to solve 'Entry Point Not Found' error in a Vulkan project (CMake 3.21/VisualStudio/C++20/VMA/shaderc) - visual-c++

(firstly I'm a chinese, so there might be some syntax errors. I'm sorry for that)
So yesterday I just update my VulkanSDK version to the newest (version 1.3.216.0) as well as VMA, but there's a runtime error occured when I try to run the code which was like : 'Entry Point Not Found'(The picture's chinese)
So I try to clean the Project and Regenerate it but no progress, then I re-installed VulkanSDK and restart my computer but still nothing helped. Later I find that this is a Vulkan error which probably originate from vk_mem_alloc.h (VMA). But I debugged for a few days but still don't understand why "vkGetDeviceImageRequirements" is not find while there seems nothing wrong with "vkGetDeviceBufferMemoryRequirements" which was actually fetched earlier
#if VMA_VULKAN_VERSION >= 1003000
if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 3, 0))
{
VMA_FETCH_DEVICE_FUNC(vkGetDeviceBufferMemoryRequirements, PFN_vkGetDeviceBufferMemoryRequirements, "vkGetDeviceBufferMemoryRequirements");
VMA_FETCH_DEVICE_FUNC(vkGetDeviceImageMemoryRequirements, PFN_vkGetDeviceImageMemoryRequirements, "vkGetDeviceImageMemoryRequirements");
}
#endif
And here is my base.h:
#pragma once
#include <glad/glad.h>
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <vulkan/vulkan.hpp>
#include <shaderc/shaderc.hpp>
#include <vma/vk_mem_alloc.h>
This is my CKake list:
cmake_minimum_required(VERSION 3.21)
project(FFEngine_Project)
set(CMAKE_CXX_STANDARD 20)
file(GLOB copyResources "./assets" "./thirdParty/libs/assimp/assimp-vc143-mtd.dll")
file(COPY ${copyResources} DESTINATION ${CMAKE_BINARY_DIR})
include_directories(
SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/thirdParty/include)
include_directories(
SYSTEM D:/Vulkan/VulkanSDK/1.3.216.0/Include)
link_directories(
SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/thirdParty/libs/glfw
SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/thirdParty/libs/assimp
SYSTEM D:/Vulkan/VulkanSDK/1.3.216.0/Lib
)
add_subdirectory(ff)
add_executable(triangle "examples/triangle.cpp")
target_link_libraries(triangle ff_lib glfw3.lib vulkan-1.lib shaderc_sharedd.lib assimp-vc143-mtd.lib)
This error has been confusing me for days, I'm really pissed off... If any more details or codes are needed, ask me, and I'll reply

Related

Error: conflicting types when trying to make a simple syscall

I'm brand new to Linux programming and I'm trying to implement a simple system call loosely following this guide: https://medium.com/anubhav-shrimal/adding-a-hello-world-system-call-to-linux-kernel-dad32875872. In my linux kernel directory, I created a new directory called my_syscall. Within that directory, I created my_syscall.c. Here is my_syscall.c
#include <linux/syscalls.h>
#include <linux/kernel.h>
asmlinkage long sys_my_syscall(int i) {
prink(KERN_INFO "This is the system call.");
return(0);
}
I then created a Makefile in the my_syscall directory with a single line:
obj-y := my_syscall.o
I then edited this line in the Makefile in the kernel directory to be:
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ my_syscall/
Then, in the directory linux-5.4.15/arch/x86/entry/syscalls, I edited the syscall_64.tbl to include the following line at the very end:
548 64 my_syscall sys_my_syscall
Finally, in the directory linux-5.4.15/include/linux, I edited the syscalls.h file to include this line before the #endif:
asmlinkage long sys_my_syscall(int i);
Now, when I run the command sudo make, I run into the following error soon after:
./arch/x86/include/generated/asm/syscalls_64.h:2664:19: error: conflicting types for 'sys_my_syscall'
__SYSCALL_64(548, sys_my_syscall, )
arch/x86/entry/syscall_64.c:18:60: note: in definition of macro '__SYSCALL-64'
#define __SYSCALL_64(nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *);
In file included from arch/x86/entry/syscall_64.c:7:0:
./include/linux/syscalls.h:1423:17: note: previous declaration of 'sys_my_syscall' was here
asmlinkage long sys_my_syscall(int i);
^
make[3]: *** [arch/x86/entry/syscall_64.o] Error 1
make[2]: *** [arch/x86/entry] Error 2
make[1]: *** [arch/x86] Error 2
make: *** [sub-make] Error 2
I have no idea how to approach this error. With a conflicting types error, I would think I declared the syscall differently in someplace, but in both my_syscall.c and the syscalls.h files, the declaration is the same. These were the only two files where the syscall is declared, but it is also named within syscall_64.tbl and it seems like this is where linux is trying to point me towards. However, I don't see what's wrong with how I declared it in the table as I followed the guide directly. Any help with this would be greatly appreciated!
Info:
Kernel version: 5.4.15
Linux Distribution: Ubuntu 14
I just changed the location where the syscall number is defined in syscall_64.tbl.
Instead of this:
548 64 my_syscall sys_my_syscall
I wrote this:
436 common my_syscall __x64_sys_my_syscall
Screen Capture of my configuration
It worked out.
I'm doing something similar and got the exact same error.
What fixed the error for me is changing the last part of the syscall_64.tbl table entry from "sys_my_syscall" to "__x64_sys_my_syscall". If you scroll up, other entries have the same prefix. The kernel started compiling after I made that change.
I eventually gave up on trying to implement this in kernel 5. Unfortunately, none of the other solutions resulted in my kernel compiling. I rolled back my kernel and followed the steps here. This resulted in the system call working correctly. I'm not sure how to make this function in kernel 5+.
#include <linux/syscalls.h>
#include <linux/kernel.h>
SYSCALL_DEFINE1(my_syscall, int, i)
{
printk(KERN_INFO "This is the system call (param %d).\n", i);
return(0);
}
For kernel 5, try deleting "sys_" before "my_syscall" and try. It worked for me
Some architectures (including x86-64) use syscall wrappers to call the real syscall handler. To define the real syscall handler and its wrappers (for architectures that use syscall wrappers), use one of the SYSCALL_DEFINE<n> macros before the body of the syscall handler. The parameters of the SYSCALL_DEFINE<n> macros are the function name, followed by <n> pairs of ``type, param'' for the function parameters.
Your sys_my_syscall syscall handler function has one parameter, so use the SYSCALL_DEFINE1 macro before the body of the function:
#include <linux/syscalls.h>
#include <linux/kernel.h>
SYSCALL_DEFINE1(sys_my_syscall, int, i)
{
printk(KERN_INFO "This is the system call (param %d).\n", i);
return(0);
}

Unable to add a custom system call on x86 ubuntu linux

I am new to this and just learning about the kernel, and I am trying to add a custom call to kernel 4.20.4. This is the steps that I did.
First I create the file (kernel/printmsg.c) that contains the code.
#include <linux/kernel.h>
#include <linux/syscalls.h>
SYSCALL_DEFINE1(printmsg, int, i)
{
printk(KERN_DEBUG, "TESTING %d", i);
return 1;
}
Next, I add this file to the kernel/Makefile
obj-y = fork.o exec_domain.o panic.o \
// A few more lines
obj-y += printmsg.o // I added this line
Finally, I add the system call to the syscall table on arch/x86/entry/syscalls/syscall_64.tbl(I'm building this on a 64-bit Ubuntu) by appending this line:
548 64 printmsg sys_printmsg
Now, I proceed to run make. However, it has this error:
arch/x86/entry/syscall_64.o:(.rodata+0x1120): undefined reference to `sys_printmsg'
Makefile:1034: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
I've been scratching my head for a long time for this but I can't seem to realised what went wrong.
Hope that anyone that managed to find a problem can help out a poor soul. Thanks in advance!
Okay, after hours of trial and error, I have finally found the problem. From linux kernel v4.17 onwards, x86_64 system calls may begin with "__x64_sys".
So, instead of using 548 64 printmsg sys_printmsg, I changed it to 548 64 printmsg __x64_sys_printmsg. Then everything works.
Hoped this helped everyone that might have this problem.

How to install tsim-0.84 on Windows 10 with Cygwin?

For a laboration in class we are using an old train simulator for Linux called tsim. I am trying to get this to run on my Windows 10 laptop with Cygwin but I get an error when running the "make" command.
AddToggleWidget.c:3:27: fatal error: X11/Intrinsic.h: No such file or directory
The thing is I think the simulator is so old that it wants to use this X11/Intrinsic.h from an old library called xorg-x11-devel. Because I already have it in a newer one called libXt-devel. This is based on this old cygwin thread.
I have looked everywhere for a way to get the xorg-x11-devel library but can't find it so any help would be greatly appreciated.
The laboration.
The Train Simulator, tsim(source code).
You need to install the libXt-devel package.
To verify if the libXt-devel is properly installed
$ cygcheck -c libXt-devel
Cygwin Package Information
Package Version Status
libXt-devel 1.1.5-1 OK
As it seems that instead your real problem is how to build tsim on cygwin and you are focusing on the wrong issue, I will also provide you the recipe I used.
The following patch is needed for proper build and link:
--- orig/tsim-0.84/src/Makefile.am 2008-09-10 12:45:17.000000000 +0200
+++ tsim-0.84/src/Makefile.am 2016-09-05 22:06:47.665318000 +0200
## -11,5 +11,6 ##
tsim_CFLAGS = -std=gnu99 -pedantic -Wall -Wextra -Wmissing-prototypes \
-DRESDIR=\"${datadir}/tsim\"
-tsim_LDFLAGS = -L/usr/X11R6/lib -lXaw -lXt -lXmu -lX11 -lXext
+tsim_LDFLAGS = -L/usr/lib
+tsim_LDADD = -largp
--- orig/tsim-0.84/src/bitmap.c 2008-09-08 13:14:16.000000000 +0200
+++ tsim-0.84/src/bitmap.c 2016-09-05 22:14:02.032117400 +0200
## -17,14 +17,14 ##
static void GetBitmapPath(
String name,
String full_name) {
- sprintf(full_name, "%s/%s/%s", app_dir(), bitmap_dir(), name);
+ sprintf(full_name, "%s%s/%s", app_dir(), bitmap_dir(), name);
}
void ReadCustomBitmaps(
Widget w) {
char custom_directory[BUFSIZE];
- sprintf(custom_directory, "%s/%s/customBitmaps", app_dir(), bitmap_dir());
+ sprintf(custom_directory, "%s%s/customBitmaps", app_dir(), bitmap_dir());
gBitmapDirectory = BDAddDirectory(w, custom_directory, NULL);
}
--- orig/tsim-0.84/src/pipe.c 2008-09-09 12:55:58.000000000 +0200
+++ tsim-0.84/src/pipe.c 2016-09-05 18:47:40.261754300 +0200
## -3,6 +3,7 ##
#include <stdlib.h> /* exit */
#include <unistd.h> /* read */
#include <sys/param.h> /* MIN, MAX */
+#include <sys/socket.h>
#if defined sun3 || defined sun4
#include <sys/filio.h>
Makefile.am is changed as /usr/X11R6/lib has been replace long time ago by /usr/lib and the libs should be put in LDADD not on LDFLAGS to avoid problem of order durink linking . -largp is missing from the requirement while the the other libs will be correctly added during configure
The changes in bitmap.c are needed to avoid wrongly loading default data. Cygwin have a dedicate meaning for path starting with "//" that are a side effect of current code.
Step by step instruction:
- install libargp-devel, libX11-devel, libXaw-devel, libXext-devel, libXmu-devel, libXt-devel
- unpack the tsim-0.84.tar.gz
- apply the patch
- run autoreconf , it will properly rebuilds the Makefile.in
- run ./configure it will properly rebuilds the Makefile
- run make
- run make install
- run tsim
As bonus, how the program looks:

Rcpp & RInside link error

I am running R3.1 on Kubuntu 14.04 and using Codeblocks as an IDE for trying an RInside program from Dirk Eddelbuettels eg:
http://dirk.eddelbuettel.com/blog/2011/03/25/#rinside_and_qt
`
// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
//
// GPL'ed
#include <RInside.h> // for the embedded R via RInside
int main(int argc, char *argv[]) {
RInside R(argc, argv); // create an embedded R instance
R["txt"] = "Hello, world!\n"; // assign a char* (string) to 'txt'
R.parseEvalQ("cat(txt)"); // eval the init string, ignoring any returns
exit(0);
}
`
and i get the following error:
/usr/bin/ld: obj/Debug/main.o||undefined reference to symbol 'REprintf'|
and I don't know what library is missing. Anyone know?
Thanks
That is the environment I develop on (apart from the difference that I am now on 15.05) which is almost certain to work -- but you got an error indicating that you did not link against libR.
That is almost surely due to you not doing what the README suggests ie for the dozen+ examples in directory examples/standard/ do
make # compile and link all
./rinside_sample0 # run the first
If you insist on using an IDE you can use the contributed cmake/ directory. But the code is tested and released with for use with the (GNU)makefile.

Where to find TortoiseSvn Subwcrev Error code list?

Today one of our devs had "error 9009" from my subwcrev post-build command. It worked fine in the command line. What fixed it was restarting Visual Studio. A couple of other people found that updating SVN and/or ensuring it's on the path were the culprits;
http://forum.battleclinic.com/index.php?topic=42617.0;Building-problems
http://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting
I was surprised not to see a list of SubWcRev's error code's and their meanings. Does anyone know where to find that? thank you!
You can find the error codes in the source.
// Internal error codes
#define ERR_SYNTAX 1 // Syntax error
#define ERR_FNF 2 // File/folder not found
#define ERR_OPEN 3 // File open error
#define ERR_ALLOC 4 // Memory allocation error
#define ERR_READ 5 // File read/write/size error
#define ERR_SVN_ERR 6 // SVN error
// Documented error codes
#define ERR_SVN_MODS 7 // Local mods found (-n)
#define ERR_SVN_MIXED 8 // Mixed rev WC found (-m)
#define ERR_OUT_EXISTS 9 // Output file already exists (-d)
#define ERR_NOWC 10 // the path is not a working copy or part of one
Remove it from: Project--> Properties ---> Build Event --> Pre build event command line
subwcrev "$(SolutionDir)." "$(ProjectDir)Properties\AssemblyInfoTemplate.cs" "$(ProjectDir)Properties\AssemblyInfo.cs" -f
Then build the project

Resources