Codegen: Different code with "-s < filelist", with codegen filename.wav and with Process.Start out of a C# Program?

177 views
Skip to first unread message

thomas

unread,
Jul 6, 2011, 11:57:58 AM7/6/11
to echo...@googlegroups.com

codegen is running under Windows XP 32 bit

I have used the "Windows XP Startup.wav" for some tests and tried the code generation in batch mode.

list.txt:

Windows XP Startup.wav
Windows XP Startup.wav
Windows XP Startup.wav

Commandline: "codegen -s < list.txt"

code":"eJydxMERwCAIBMCWDjSA5cgh_ZeQGf_5ZB8LQAZ-h_OZW8pqJk_VfGjNKsHMvIV4eHo72dvgxrF7h_VNpXS20ZZpDISq-yahtxdFWCwU"
code":"eJydxEERACAIBMBKBzqc1AGlfwQL4Md9LAAZ-A7nGS3EKyNP1xIuBovZpbJ1lqV51wXUEi6m"
code":"eJydxEERACAIBMBKBzqc1AGlfwQL4Md9LAAZ-A7nGS3EKyNP1xIuBovZpbJ1lqV51wXUEi6m"


If I generate the code with "codegen "Windows XP Startup.wav"" I get:

code":"eJydxMERwCAIBMCWQNDDcuQI_ZeQGf_5ZB8rImryO3k-w0rdzeQT4JylVqbimbdQBBINWqPSnUCfWH0bWsN7ce1pHA5GxyFl3F4O3SvD", "tag":0}

And if I use a C#-Programm that calls the codegen.exe (Process class with start and capturing of the stdout) I get this one:

code\":\"eJydxLsRgEAIBcCWHsgBlsPn6L8EZ87YxA0WAF34HfZnpkn3VNYuYUR3byVI5snJ3NLGSmLliJj6hOucmJpltPR21lW81Diq8PYAKGortg=="

Why do I get 4 different codes for the same file???


Thank you
Thomas from Germany

youssef elrayes

unread,
Jul 6, 2011, 12:46:47 PM7/6/11
to echo...@googlegroups.com
hi Thomas,
i am trying to compile the codegen under windows 7 (64 bit) and VS 2010 , but i am gettig link errors.
can you help.
i have build the Zlib , and taglib , and i have pointed to them correctly ( i hope :) )
i even added them to the PATH variable .

below is the C++ command line :
/I"D:\Echoprint\taglib-1.7\taglib\Release" /I"D:\Echoprint\zlib-1.2.5\Release" /I"D:\Echoprint\taglib-1.7\include" /I"D:\Echoprint\taglib-1.7" /I"D:\Echoprint\zlib-1.2.5" /I"D:\Echoprint\boost_1_46_1" /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "CODEGEN_EXPORTS" /D "BOOST_UBLAS_NDEBUG" /D "_UNICODE" /D "UNICODE" /Gm- /EHsc /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Release\codegen.pch" /Fa"Release\" /Fo"Release\" /Fd"Release\vc100.pdb" /Gd /analyze- /errorReport:queue 
and here is the Linker Command line :
/OUT:"D:\Echoprint\windows\Release\codegen.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"D:\Echoprint\taglib-1.7\taglib\Release" /LIBPATH:"D:\Echoprint\zlib-1.2.5\Release" "tag.lib" "zlib.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Release\codegen.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\Echoprint\windows\Release\codegen.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:"D:\Echoprint\windows\Release\codegen.pgd" /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE 

and here is some of the errors i get :
Error 451 error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall TagLib::String::toCString(bool)const " (__imp_?toCString@String@TagLib@@QBEPBD_N@Z) D:\Echoprint\windows\Metadata.obj codegen

Error 452 error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall TagLib::String::~String(void)" (__imp_??1String@TagLib@@UAE@XZ) D:\Echoprint\windows\Metadata.obj codegen

Error 453 error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall TagLib::FileRef::isNull(void)const " (__imp_?isNull@FileRef@TagLib@@QBE_NXZ) D:\Echoprint\windows\Metadata.obj codegen

Error 454 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class TagLib::AudioProperties * __thiscall TagLib::FileRef::audioProperties(void)const " (__imp_?audioProperties@FileRef@TagLib@@QBEPAVAudioProperties@2@XZ) D:\Echoprint\windows\Metadata.obj codegen

Error 455 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class TagLib::Tag * __thiscall TagLib::FileRef::tag(void)const " (__imp_?tag@FileRef@TagLib@@QBEPAVTag@2@XZ) D:\Echoprint\windows\Metadata.obj

Error 456 error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall TagLib::FileRef::~FileRef(void)" (__imp_??1FileRef@TagLib@@UAE@XZ) D:\Echoprint\windows\Metadata.obj

Error 457 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall TagLib::FileRef::FileRef(class TagLib::FileName,bool,enum TagLib::AudioProperties::ReadStyle)" (__imp_??0FileRef@TagLib@@QAE@VFileName@1@_NW4ReadStyle@AudioProperties@1@@Z) D:\Echoprint\windows\Metadata.obj

Error 458 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall TagLib::FileName::~FileName(void)" (__imp_??1FileName@TagLib@@QAE@XZ) D:\Echoprint\windows\Metadata.obj
Error 459 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall TagLib::FileName::FileName(char const *)" (__imp_??0FileName@TagLib@@QAE@PBD@Z) D:\Echoprint\windows\Metadata.obj

can you give any advice , or even share your compiled version of the condegen

thanks
youssef

Power2All

unread,
Jul 6, 2011, 1:32:58 PM7/6/11
to echo...@googlegroups.com
Your missing the TagLib library.
Grab it somewhere ^^

- Cheers.

thomas.s...@web.de

unread,
Jul 6, 2011, 3:59:04 PM7/6/11
to echo...@googlegroups.com
Hi youssef,

I have done it today straight forward with the readme from here:

https://github.com/echonest/echoprint-codegen/tree/master/windows

What do you mean with " and i have pointed to them correctly "? I only
had to add the path to taglib in cmake like it is described. For
compilation you don't have to add anything to the path!

Have you extracted taglib and zlib to the correct path?

My structure is:

echonest-echoprint-codegen-7dd649f
- here is echoprint with src, windows folder aso

echonest-echoprint-codegen-7dd649f\boost_1_46_1

echonest-echoprint-codegen-7dd649f\taglib-1.7

echonest-echoprint-codegen-7dd649f\zlib-1.2.5

boost, taglib and zlib have to be directly in their folders. Check
this out. It seems that taglib isn't compiled or that it's not in the
correct folder.

Bye
Thomas

2011/7/6 youssef elrayes <yous...@gmail.com>:

thomas

unread,
Jul 7, 2011, 3:00:05 AM7/7/11
to echo...@googlegroups.com
It confuses me more and more.

Today I tried the tests of yesterday again and get different codes?!?

codegen without -s yesterday vs. today:

"eJydxMERwCAIBMCWQNDDcuQI_ZeQGf_5ZB8rImryO3k-w0rdzeQT4JylVqbimbdQBBINWqPSnUCfWH0bWsN7ce1pHA5GxyFl3F4O3SvD"
"eJydyrsBgDAIRdGVIEQ-44RH2H8ENb2NzbnNJSIW-g3tT0yTo5HYy_TNJRfTzDw4m1taG7pCNiq9ern2YXCN2QoNf-ZpiJQF0DjcQ_8sqg=="

codegen with -s yesterday (first 3) vs. today (last 3):

code":"

"eJydxMERwCAIBMCWDjSA5cgh_ZeQGf_5ZB8LQAZ-h_OZW8pqJk_VfGjNKsHMvIV4eHo72dvgxrF7h_VNpXS20ZZpDISq-yahtxdFWCwU"
"eJydxEERACAIBMBKBzqc1AGlfwQL4Md9LAAZ-A7nGS3EKyNP1xIuBovZpbJ1lqV51wXUEi6m"
"eJydxEERACAIBMBKBzqc1AGlfwQL4Md9LAAZ-A7nGS3EKyNP1xIuBovZpbJ1lqV51wXUEi6m"
"eJydxLkRwDAIBMCWDrAAlcMj-i_BM8qdeIMFQILf4XxmmrSnss5e0XUcMoQn8-ZkbmljZY1QJqeecJ0bU_MzWrpXyfJRmY4q8O0FIuUsFw=="
"eJydxEERACAIBMBKBzqc1AGlfwQL4Md9LAAZ-A7nGS3EKyNP1xIuBovZpbJ1lqV51wXUEi6m"
"eJydxEERACAIBMBKBzqc1AGlfwQL4Md9LAAZ-A7nGS3EKyNP1xIuBovZpbJ1lqV51wXUEi6m"


C# call to codegen yesterday vs. today:

"eJydxLsRgEAIBcCWHsgBlsPn6L8EZ87YxA0WAF34HfZnpkn3VNYuYUR3byVI5snJ3NLGSmLliJj6hOucmJpltPR21lW81Diq8PYAKGortg=="
"eJydxLkRwDAIBMCWDuHhRDk8ov8SPKPciTdYAKL4Hc5ntBSfyjqLDLMOqODJvG3hZnJYaaZwdeTEtrkt6fWMlbnAeVg9HVVYtxf-Dyuz"

            string path = @"F:\echoprint\bin32";
            string codegenexe = "codegen.exe";

            Process p = new Process();

            p.StartInfo.EnvironmentVariables["PATH"] = @".\;";
            p.StartInfo.WorkingDirectory = path;
            p.StartInfo.Arguments =  @"""Windows XP Startup.wav""";
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.FileName = path + @"\" + codegenexe;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.UseShellExecute = false;

            p.Start();
            p.WaitForExit();

            string stdOut = p.StandardOutput.ReadToEnd();
            string stdErr = p.StandardError.ReadToEnd();


Nobody here who can explain this differences?


Bye
Thomas

youssef elrayes

unread,
Jul 7, 2011, 11:24:56 AM7/7/11
to echo...@googlegroups.com
Hi Thomas,
thanks a lot for your help , i got the codegen to  work

and i tried to encode more that once , and i always get the same result 
what i did was :
1- i created a list of some files
2- i used the command codegen -s < listfile.txt > generatedcodes.txt
3- i used a comparing text tool the only diff was the time for decoding , and codegen time params in each tag.

i also used the same way to encode the same song like 8 times 
and it gave the exact encoding for all of them.

don't know if this helps or not :(

youssef

2011/7/7 thomas <groe...@gmail.com>

thomas.s...@web.de

unread,
Jul 7, 2011, 2:36:31 PM7/7/11
to echo...@googlegroups.com
I think I figured it out. The problem was that I tried it with a short WAV-File.

I now tried it with some MP3-Files and there I also get always the
same result as I would expect it.

Thanks
Thomas

2011/7/7 youssef elrayes <yous...@gmail.com>:

Alastair Porter

unread,
Jul 8, 2011, 11:21:03 AM7/8/11
to echo...@googlegroups.com
Hi Thomas,
We've made a small change to the codegen which now produces consistent results on short files.

Alastair
Message has been deleted

Pedro Lucas

unread,
Jul 13, 2016, 5:53:21 PM7/13/16
to echoprint
Hey Yussef

"thanks a lot for your help , i got the codegen to  work"

So you got rid of the unresolved external errors. And here I am, 5 years later in 2016, and a lot of people on the web with the same problem. It must be an easy fix but no one finds it easily.

Could it be a problem with multi/unicode, or Zc:wchar_t, I wonder ?

Damn thing, these unresolved always drive me crazy. Been working with MSVC since v1.0 in the 90's and these DLL/lib crap/cpp name mangling/.def stuff still causes problems for developers. Arrgh.

Oh well, if anyone can suggest a solution, feel free to post. Thank you :)
Reply all
Reply to author
Forward
0 new messages