Hi Everyone,
I'm having a strange header file issue I don't know what to make of. Maybe you've seen it before.
Apparently VS can see csound.hpp but not csPerfThread.hpp. They're in the same directory!
I've posted the errors and source code below. VS has no problem finding the Csound class, only methods in the CsoundPerformanceThread class.
What could be the problem?
Rebuild started...
1>------ Rebuild All started: Project: csound_api_test, Configuration: Debug x64 ------
1>csound_api_test.cpp
1>C:\Program Files\Csound6_x64\include\csound\csound.hpp(437,39): warning C4244: 'return': conversion from 'int64_t' to 'long', possible loss of data
1> Creating library C:\jana\csound\projects\csound_api_test\x64\Debug\csound_api_test.lib and object C:\jana\csound\projects\csound_api_test\x64\Debug\csound_api_test.exp
1>csound_api_test.obj : error LNK2019: unresolved external symbol "public: void __cdecl CsoundPerformanceThread::Play(void)" (?Play@CsoundPerformanceThread@@QEAAXXZ) referenced in function main
1>csound_api_test.obj : error LNK2019: unresolved external symbol "public: void __cdecl CsoundPerformanceThread::Stop(void)" (?Stop@CsoundPerformanceThread@@QEAAXXZ) referenced in function main
1>csound_api_test.obj : error LNK2019: unresolved external symbol "public: int __cdecl CsoundPerformanceThread::Join(void)" (?Join@CsoundPerformanceThread@@QEAAHXZ) referenced in function main
1>csound_api_test.obj : error LNK2019: unresolved external symbol "public: __cdecl CsoundPerformanceThread::CsoundPerformanceThread(struct CSOUND_ *)" (??0CsoundPerformanceThread@@QEAA@PEAUCSOUND_@@@Z) referenced in function main
1>csound_api_test.obj : error LNK2019: unresolved external symbol "public: __cdecl CsoundPerformanceThread::~CsoundPerformanceThread(void)" (??1CsoundPerformanceThread@@QEAA@XZ) referenced in function main
1>C:\jana\csound\projects\csound_api_test\x64\Debug\csound_api_test.exe : fatal error LNK1120: 5 unresolved externals
1>Done building project "csound_api_test.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
#include <stdio.h>
#include "csound.hpp"
#include "csPerfThread.hpp"
int main(int argc, const char* argv[])
{
int result = 0;
Csound cs;
result = cs.Compile(argc, argv);
if (!result)
{
CsoundPerformanceThread perfThread(cs.GetCsound());
perfThread.Play(); // Starts performance
while (perfThread.GetStatus() == 0);
// nothing to do here...
// but you could process input events, graphics etc
perfThread.Stop(); // Stops performance. In fact, performance should have
// already finished, so this is just an example of how
//to stop if you need
perfThread.Join(); // always call Join() after Stop() as a rule of thumb.
}
else {
printf("csoundCompile returned an error\n");
return 1;
}
return 0;
}
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here