Borrar filtros
Borrar filtros

Four unresolved external symbol when generating static library for function "pcdownsample"

3 visualizaciones (últimos 30 días)
Steps to reproduce:
1. Write simple function which just wrap a call to the cv toolbox function "pcdownsample"
2. Write a simple script that calls the function. The script refered to the first example of the help page of the "pcdownsample".
3. Use Coder app, specify "mypcdownsample" as the function to be translated, specify "run_mypcdownsample" as the running code to define input types. Modify the input type to "inf×3" and choose c++ static library as the wanted build type. Select "vs 2019 project | cmake 64-bit" as the toolchain. Below are snapshots of the matlab coder:
4. Open the sln, create a new project, add the auto-generated example files(main.h main.cpp) to this project. Replace the trivial init function with my own correct function which reads the "teapot.txt" file. Also add some folders to the "additional include directories" so that vs could find the headers.
5. Build the solution. VS complained about "unresolved external symbol", both in "debug" and "release" mode.

Respuesta aceptada

Supreeth Subbaraya
Supreeth Subbaraya el 11 de Oct. de 2023
This issue is because a few of the libraries required are not linked. Here is a workaround you can try to resolve the issue:
Obtain the required files and libraries using the packNGo function. This creates a .zip folder with all the files required
  1. Load the buildInfo.mat from the 'codegen' directory, into your workspace
  2. >> packNGo(buildInfo)
Extract the files and in your visual studio and then configure the linker settings.
  1. In solution explorer at the right side, right click on your project, then click properties
  2. Go to, Linker -> General, add the packNGo Folder to the "Additional Library Directories"
  3. Go to, Linker -> Input, add the required libraries as additional dependencies. Add the libraries mypcdownsample.lib, libmwkdtree.lib and libmwvoxelGridFilter.lib (see below screenshot as reference)
Hope this resolves the issue
  1 comentario
zzm oliver
zzm oliver el 12 de Oct. de 2023
Thank you, later on I tried generating dll. And building dll is fine. But thanks anyway! This "packNGo" is really useful!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by