• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What would cause a C++ .exe and .dll to only work on the machine it was built on?

Bulldog13

Golden Member
I am using VS2010 and am working with this project.

http://www.codeproject.com/KB/audio-video/Asio_Net.aspx

Initially, I downloaded the demo binary and it would crash on my machine. After reading through some of the comments, it said to download the source, build it, (after getting the ASIO SDK), and it should work on your machine. This is correct, after building it in VS it works, on that machine.

When I moving the rebuilt .exe and .dll to a different machine, it crashes with the same error as the originally downloaded demo binary. So I am unsure what would cause this. How can I make this C++ binary work on any machine??

I am a C# developer and most of the code is c++, so am kind of at a loss.

BTW, here is the error message:

"Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
embly 'Bluewave.Interop.Asio.dll' or one of its dependencies. The specified module could not be found.at BlueWave.Interop.Asio.Test.TestConsole.Main(String[] args)"
 
Last edited:
Whenever I am building components, I use a tool called Dependency Walker. It is VERY useful to catch various DLL requirements.
 
Yeah when this particular species of error used to pop up locally in a Visual C++ program the first thing I did was get out depends.exe. Very often the issue was the VC runtime. The meatier problem, of course, is when it happens on a client system you don't have access to. Linking the runtime statically used to be one way to solve the problem. Not sure if you can still do that. I think you can ship it with the program and it will be loaded from the local directory. Other than that there is no substitute for a proper installer that checks required dependencies.
 
Well since, I have a bunch of the C++ programmers on the board here, let me pose you a question.

I am a reasonably competent MS web programmer. C#, JavaScript, MVC. I understand design patterns such as the repository pattern and the factory pattern.

As a C# programmer though every once in awhile I run across a library written in C or C++ that would absolutely do what I need. Many times there is no equivalent C# library. The answer always seems to be write a "wrapper class" to call the unmanaged code from managed code.

How would you all recommend I learn C++, given that I already have a strong background in programming? The issue I run into is, if I start at the beginning of the plethora of tutorials, it is too basic, loops, conditionals, etc and I find myself losing interest rapidly. If I find a tutorial that deals specifically with wrapper classes or the WIN32 API, I feel like I am in way over my head.

Can anyone make any recommendations on a route to take besides starting at "Hello World" ?
 
it's one of those things that is hard to do without setting the ground work in place.

Maybe port your existing code to all C++, that should be a good learning tool...but you may end up lacking 'total' knowledge.

I hack at programming...I learned C, C++, ASP, VBScript and a lot of other scripting languages...did a lot in Scheme/LISP as well as BASIC.

Still I just sit down, flow chart it and then google up my syntax. Works well for me.
 
Well since, I have a bunch of the C++ programmers on the board here, let me pose you a question.

I am a reasonably competent MS web programmer. C#, JavaScript, MVC. I understand design patterns such as the repository pattern and the factory pattern.

As a C# programmer though every once in awhile I run across a library written in C or C++ that would absolutely do what I need. Many times there is no equivalent C# library. The answer always seems to be write a "wrapper class" to call the unmanaged code from managed code.

How would you all recommend I learn C++, given that I already have a strong background in programming? The issue I run into is, if I start at the beginning of the plethora of tutorials, it is too basic, loops, conditionals, etc and I find myself losing interest rapidly. If I find a tutorial that deals specifically with wrapper classes or the WIN32 API, I feel like I am in way over my head.

Can anyone make any recommendations on a route to take besides starting at "Hello World" ?

Have you looked into System.Interop and the other Marshalling classes. You can create your wrapper classes directly in C# if you need to.

EDIT: Nevermind, re-read your post and realized that's what you want to avoid.
 
Last edited:
Well since, I have a bunch of the C++ programmers on the board here, let me pose you a question.

I am a reasonably competent MS web programmer. C#, JavaScript, MVC. I understand design patterns such as the repository pattern and the factory pattern.

As a C# programmer though every once in awhile I run across a library written in C or C++ that would absolutely do what I need. Many times there is no equivalent C# library. The answer always seems to be write a "wrapper class" to call the unmanaged code from managed code.

How would you all recommend I learn C++, given that I already have a strong background in programming? The issue I run into is, if I start at the beginning of the plethora of tutorials, it is too basic, loops, conditionals, etc and I find myself losing interest rapidly. If I find a tutorial that deals specifically with wrapper classes or the WIN32 API, I feel like I am in way over my head.

Can anyone make any recommendations on a route to take besides starting at "Hello World" ?

Just pick something and do it. C# and C++ share a ton of features, though, I would say that C# is quite a bit more feature rich. You'll learn a lot by just saying "Ok, I would do it like this in C#, how would I do the same thing in C++".

I would suggest NOT starting with a GUI application. GUI stuff is pretty complicated in C++ because it is VERY tightly connected to the way the OS works. (though, you'll get a lot of good insights on why things are the way they are when doing it.. The very concept of the message pump is quite illuminating when you look at how things are done in C#)

Start a bit simpler. One of my favorite mini projects was creating an RSA encryption program.
 
Back
Top