I had a double check about using namespace optix; and I found nothing.
Also I just now reproduce the problem with user-defined function.
So, I have function
// primeComon.cpp
optix::float3 transformPoint(const SimpleMatrix4x3& M, const optix::float3& p)
{
return optix::make_float3(
M.f0*p.x + M.f1*p.y + M.f2*p.z + M.f3,
M.f4*p.x + M.f5*p.y + M.f6*p.z + M.f7,
M.f8*p.x + M.f9*p.y + M.f10*p.z + M.f11);
}
After compilation, I have primeCommon.obj.
Using
DUMPBIN /SYMBOLS primeCommon.obj
I recive it’s contents
019 00000000 SECT6 notype () External | ?transformPoint@@YA?AUfloat3@optix@@AEBUSimpleMatrix4x3@@AEBU12@@Z (struct optix::float3 __cdecl transformPoint(struct SimpleMatrix4x3 const &,struct optix::float3 const &))
So this function properly compiled to .obj file.
In main.cpp I have this situation (simplified):
#include <cuda.h>
#include <cuda_runtime.h>
#include <optix_prime/optix_primepp.h>
#include "primeCommon.h"
int main()
{
SimpleMatrix4x3 *transforms;
optix::float3 *vertices;
/* some code */
optix::float3 A = transformPoint(transforms[indexMesh], vertices[tri.x]);
/* some code */
}
Linking fails with message
adding resource. type:MANIFEST, name:1, language:0x0409, flags:0x30, size:381
primeInstancing.obj : error LNK2019: unresolved external symbol "struct float3 __cdecl transformPoint(struct SimpleMatrix4x3 const &,struct float3 const &)" (?transformPoint@@YA?AUfloat3@@AEBUSimpleMatrix4x3@@AEBU1@@Z) referenced in function "main()"
Linker symbol and obj symbol are identical, except “optix::”
I repeat, there is no using namespace optix; directive.
Every type defined with optix::.
If I remove #include <cuda.h> #include <cuda_runtime.h> and dependent code, all works fine.