2

I'm using Visual Studio 2019 to make a simple scene with OpenGL. The libraries and includes seem to be correctly configured since I can access the header files and the assimp folderstructure. When I try to include any assimp headers though I get this error, the weird thing is that the file is in the folder. It is called "config.h.in" when removing the ".in" from the file I get the error code "E0011" in line 1016 of the "config.h" file. Which reads as follows

// ---------- All the Build/Compile-time defines ------------

/** @brief Specifies if double precision is supported inside assimp
 *
 * Property type: Bool. Default value: undefined.
 */

#cmakedefine ASSIMP_DOUBLE_PRECISION 1

#endif // !! AI_CONFIG_H_INC

Those are lines 1009 to 1018, while the file is open in VS19 I get no error only when switching to another file. I get the error again.

EDIT. I did use CMake and VS to build the Library and .dll files

Bearowl
  • 67
  • 1
  • 7
  • 2
    Did you run CMake? – Lukas-T Feb 17 '20 at 11:44
  • Yes I did, also build it using VS2019. Should have said so mb. – Bearowl Feb 17 '20 at 12:12
  • 1
    Good, then search the `config-h`, I faintly remember that it was generated in the wrong directory under some circumstances. – Lukas-T Feb 17 '20 at 12:21
  • @churill it is in the folder `libraries/assimp/include/assimp/` . libraries is the folder for the project libraries, the file is in there originally as "config.h.in" as stated above. Renaming it to "config.h" results in the VS error code "E0011". – Bearowl Feb 17 '20 at 12:32
  • 2
    `config.h` and `config.h.in` are two _different_ files (sorry for typo above). Check where `config.h` is. (It's generated by CMake _somewhere_) Don't rename anything, that's not the purpose of the file. Not really sure what you are doing there. – Lukas-T Feb 17 '20 at 12:37
  • checked the folder I build the libraries to and lo and behold there was a lone header file called config.h in there. Errors are gone now. Thank you very much for the help. – Bearowl Feb 17 '20 at 12:43

1 Answers1

3

The config.h.in file is the input-file for the configuation-generation-process which is performed during the cmake-build-generation we are using in the Asset-Impoprter-Lib. The cmake-run will read the config.h.in file, replace the defines coming from cmake in the config.h .in and write the generated config.h file in you include folder. So if you want to generate a valid config.h file you have to run the assimp-cmake run before running your own build.

I guess you are just using a solution-file for your opengl-example. So you can install cmake, run it in the root-folder of your assimp-installation and you will be able to find a valid config.h file.

The config.h file contains the defines for your assimp-configuration like which kind of precision will be used and so on.

KimKulling
  • 2,654
  • 1
  • 15
  • 26