Thread: EXTREMELY Weird problem...

  1. #1
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230

    EXTREMELY Weird problem...

    Okay so could someone please tell me what the **** IS GOING ON... Basically, I've made a SSH client in C++ using libssh2. The problem is, it only runs on machines with Visual C++ Express Edition installed... I'm not sure if other versions (such as Visual Studio) or earlier versions (such as 2005) would get it working or not.

    I tried to get it working by installing the Visual C++ Redistributable library but that doesn't fix the problem... No matter which version of the redistributable library I install, the program won't run, unless I install Visual C++. I tried installing redistributable 2008, 2008 SP1, 2005, and so fourth.

    The program is compiled in 2008...

    So how is this possible? What is going on? This is extremely frustrating... Okay thank you lol.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Make sure that you did a release build of your application (as opposed to a debug build).
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    Quote Originally Posted by bithub View Post
    Make sure that you did a release build of your application (as opposed to a debug build).
    Yep, definitely release build.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  4. #4
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Then use dependency walker to see what's not being found.

  5. #5
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    That I did, all the DLLs were there after I installed the redistributable library but it still wouldn't run...
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  6. #6
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Code::Blocks is a free IDE that will use the VC++ compiler, trying compiling through that. If that doesn't work, download MinGW GCC (also will run in Code::Blocks) and try compiling the program with it - you'll have to make a couple changes, but it shouldn't be a problem so long as your program isn't doing some special exception handling.

  7. #7
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    It doesn't even compile in CodeBlocks... I get all these unresolved external symbol errors. I get the exact same errors if I compile the project in VC++ with /MT instead of /MD... Could this be the cause of the problem (I'm using /MD instead of /MT because /MT doesn't work)?
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  8. #8
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Yarin View Post
    Code::Blocks is a free IDE that will use the VC++ compiler, trying compiling through that. If that doesn't work, download MinGW GCC (also will run in Code::Blocks) and try compiling the program with it - you'll have to make a couple changes, but it shouldn't be a problem so long as your program isn't doing some special exception handling.
    That doesn't answer the question of why it isn't working. I don't like the debugging approach of "start changing stuff until it works." It's important to understand what's going on.

    What exactly happens when you try to run the program and it fails? Does it fail silently, pop some kind of dialog, what?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  9. #9
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    Quote Originally Posted by brewbuck View Post
    That doesn't answer the question of why it isn't working. I don't like the debugging approach of "start changing stuff until it works." It's important to understand what's going on.

    What exactly happens when you try to run the program and it fails? Does it fail silently, pop some kind of dialog, what?
    Well, if I run it on XP and it fails it says something along the lines of "This program failed to run", and I get a different error message on 7 and Vista... I'll re-install XP on a virtual machine again and tell you exactly what it says, although the output wasn't very revealing lol, it was just something simple to let me know something is messed up.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  10. #10
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    Ok on XP Pro it says "The system cannot execute the specified program." (prints it to stdout in the command prompt).
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  11. #11
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Have you read through this already?
    bit∙hub [bit-huhb] n. A source and destination for information.

  12. #12
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    Yes I have bithub: Visual C++ files can be redistributed using either the provided Redistributable Merge Modules, or the Visual C++ Redistributable Package, I tried that In fact, I just reformatted the test machine, tried to run it, got that error. I then installed the Visual C++ 2008 Redistributable Package, ran dependency walker, and it says the following DLL's are missing still:

    MSVCP90.DLL
    MSVCR90.DLL
    IESHIMS.DLL
    WER.DLL

    I tried the 2008 version and the 2008 Service Pack 1 version. I don't quite understand how this may be possible as it was my understand that the intention of the redistributable package was to register those exact DLLs on my system?!

    Edit: I just tried both methods at:

    http://msdn.microsoft.com/en-us/libr...91(VS.80).aspx

    Neither worked...
    Last edited by pobri19; 08-07-2009 at 01:08 PM.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  13. #13
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    Okay uh I just read this in the Event Viewer under System...

    Resolve Partial Assembly failed for Microsoft.VC90.DebugCRT. Reference error message: The referenced assembly is not installed on your system.

    Now this leads me to believe that even know I have it on release mode it's compiling in debug mode or something? And since I'm supplying the non Debug CRT files, this is why it will not run? Why would it be looking for DebugCRT... I'm compiling in Release.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  14. #14
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by pobri19 View Post

    So how is this possible? What is going on? This is extremely frustrating... Okay thank you lol.

    Under project properties->Configurations Properties->C++->Code Generation-> Runtime Library set it to Multithreaded or Debug Multithreaded. Do not use the DLL version of the runtime unless your customer has the runtime installed, which 99.99% don't.

  15. #15
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by abachler View Post
    Under project properties->Configurations Properties->C++->Code Generation-> Runtime Library set it to Multithreaded or Debug Multithreaded. Do not use the DLL version of the runtime unless your customer has the runtime installed, which 99.99% don't.
    He said that he couldn't do that (although I'm not sure of the cause).
    Quote Originally Posted by pobri19
    I get the exact same errors if I compile the project in VC++ with /MT instead of /MD
    bit∙hub [bit-huhb] n. A source and destination for information.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Weird Problem With Pointer
    By DarkDot in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2007, 07:50 PM
  2. very weird problem (pointers I think)
    By hannibar in forum C Programming
    Replies: 2
    Last Post: 10-11-2005, 06:45 AM
  3. Replies: 6
    Last Post: 05-12-2005, 03:39 AM
  4. Weird mouse problem in XP
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 06-16-2004, 11:47 AM
  5. Weird class problem!
    By aker_y3k in forum C++ Programming
    Replies: 2
    Last Post: 09-25-2002, 06:12 AM