I think Simon is on the right track here. I'm not sure about g++, but MSVC cannot link against a DLL this way. You must write a text .lib file which defines the exported functions and their offsets in the DLL. Then you need to make sure that those methods are marked __declspec(dllimport) in the header when you compile.
Honestly, building from scratch with static libraries will probably be easier Good luck, Kevin On Sun, Dec 6, 2020, 9:37 AM Simon Fly <xaser...@hotmail.de> wrote: > Hey, > > > > I don’t want to discourage you, but looking at how you constructed the > first Compiler command, I have the strong Impression that all this stuff is > very new to you. So let me give you some Questions ( Facts to consider > before you move on. > > > > 1. G++ / gcc is a Compiler primarly meant for UNIX based operating > Systems, i.e. Ubuntu etc. Programs compiled for unix CANNOT be simply > copied over to Windows and run natively there, or vice versa. MSVC is what > you probably want to use when directly Building for Windows. You’ll > probably want visual Studio or visual Studio Code with that to get you > started. That being said, g++ CAN be used for „cross-compiling“, but it’s > an advanced Topic. > 2. Dynamic libraries are not trivial, especially when writing for > first program. If you are completely new to this, I urge you to take into > account a relatively steep learning curve, and the time it takes to get > over it. > 3. Are you sure you got the Right Tools for what you want to do? > perhaps a simple python script is much easier to get running and does the > same Job. > > > > Best of luck, > > . > > > > PS: apologies for the capitalization, my mail program thinks I’m writing > german. > > > > *Von: *Pablo Frank <frank_pa...@hotmail.com> > *Gesendet: *Sonntag, 6. Dezember 2020 17:03 > *An: *MUSIC-DSP@LISTS.COLUMBIA.EDU > *Betreff: *Re: libsndfile-1.dll: file not recognized: file format not > recognized > > > > I just gave up. I got no answer from Erik Castro Lopo, no answer from the > forum of the site from where libsndfile is downloaded. I got one answer > from someone from this forum and the csound forum and it was not useful. So > i begin to install linux ubuntu in VM and i'll try to transfer files > between VM and windows10... > > *From:* music-dsp <MUSIC-DSP@LISTS.COLUMBIA.EDU> on behalf of Matthias > Brandt <the.matthias.bra...@gmail.com> > *Sent:* Sunday, December 6, 2020 2:54 PM > *To:* MUSIC-DSP@LISTS.COLUMBIA.EDU <MUSIC-DSP@LISTS.COLUMBIA.EDU> > *Subject:* Re: libsndfile-1.dll: file not recognized: file format not > recognized > > > > Did you fix the linking problem? If so, could you let us know what caused > the issue? > > > > > > Thanks, > > > > Matthias > > > > Am So., 29. Nov. 2020 um 14:05 Uhr schrieb Matthias Brandt < > the.matthias.bra...@gmail.com>: > > Hi again, > > > > this problem _could_ be related to a 32/64 bit mismatch of your OS and the > DLL. Could you make sure the DLL is compatible with your OS? Also, it maybe > cannot hurt to remove previous object files - if there are any. > > > > > > Best, > > > > Matthias > > > > Am So., 29. Nov. 2020 um 13:55 Uhr schrieb Pablo Frank < > frank_pa...@hotmail.com>: > > in Windows7 it works perfect with the syntax i used: > > C:\MinGW\bin>g++ oscc_cr_sr_autonomous.cpp libsndfile-1.dll > > > > > > Trying the syntax you say in windows10, i get this: > > > > C:\MinGW\bin>g++ oscc_cr_sr_autonomous.cpp -l libsndfile-1.dll > > > > c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: > cannot find -llibsndfile-1.dll > > collect2.exe: error: ld returned 1 exit status > > *From:* music-dsp <MUSIC-DSP@LISTS.COLUMBIA.EDU> on behalf of Matthias > Brandt <the.matthias.bra...@gmail.com> > *Sent:* Sunday, November 29, 2020 12:41 PM > *To:* MUSIC-DSP@LISTS.COLUMBIA.EDU <MUSIC-DSP@LISTS.COLUMBIA.EDU> > *Subject:* Re: libsndfile-1.dll: file not recognized: file format not > recognized > > > > Hi Frank, > > > > As I see it, you didn't tell gcc that libsndfile-1.dll should be treated > as a dynamic library. Since you didn't use the "-l" option, gcc assumes > that libsndfile-1.dll is a plain-text source code file. Since it is a > binary file, not a plain-text file, gcc has trouble processing it. > > > > A first reference for you to solve this problem may be > https://stackoverflow.com/questions/17968801/link-against-a-windows-dll-lib-file-combination-with-gcc-under-cygwin/34902737#34902737 > . > > > > > > Good luck, > > > > Matthias > > > > Am So., 29. Nov. 2020 um 08:59 Uhr schrieb Pablo Frank < > frank_pa...@hotmail.com>: > > > > Hello all, > > when calling libsndfile in windows10 64 bit (installation from mega-nerd) > > I get this message: > > > > libsndfile-1.dll: file not recognized: file format not recognized > > collect2.exe: error: ld returned 1 exit status > > > > The compiler used is MinGW and works fine. > > I didn't find any useful answer with google. what to do? > > Please help! > > > > > > > > > > >