1 (edited by Hojat.Badnava 29-01-2015 15:18:26)

Topic: OOFEM-2.3- Problem in debug mode with visual studio 2008

Hey,
I downloaded CMake and followed the instructions from "CMake Tutorial"on wiki for Windows (Visual Studio).
I configured the defaults. Compilation completed without error and oofem.exe was created. But the debug mode was just activated for oofem project, not for other project. For example, I cant use "step into" option for misesmat.c or other files when I run debug mode using "Mises01.in" example input file. When I tried to create a breakpoint in the any file this error appear:
“the breakpoint will not currently be hit. No symbols have been loaded for this document”

Post's attachments

main.jpg 377.84 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

When you say debug mode was activated, do you mean the build type specified in CMake, or the debug option inside Visual Studio?

Unfortunately, very few of the devs are using windows machines (and even fewer are using Visual Studio), so I can't come with any good suggestions.

3 (edited by Hojat.Badnava 29-01-2015 15:19:22)

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

For Cmake the debug mode is default. But the debug option inside VS not work (It only works for oofem main.c file). I will try Ubuntu. Which IDE in Ubuntu can work similar to VS? How you create a project from oofem source files for IDEs?
thanks.

Post's attachments

misesmat.png 225.45 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

If I recall correctly, the BUILD_TYPE in CMake isn't used for Visual Studio (since VS picks the build type later), so it makes no difference if you put in Debug in that field.
What I mean is the debug build setting inside VS. On the top bar, there should be a drop menu where one can select "Debug"
It's next to the Start option on in this screenshot
http://blogs.msdn.com/cfs-filesystemfil … a-Full.png

Under linux, some IDEs you can try are KDevelop, QT creator, and Eclipse CDT or Code::blocks

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

As I said before, debug just works for main.c inside visual studio. I have attached two photos to previous posts (post 1 and 3), please take a look at them.

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

I believe you missed the attached figures (there are none that I can see)
If there are problems attaching them, you can use something like:
http://picpaste.com/
and paste the links.

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

Sorry,
take a look at to these files:
http://picpaste.com/main-gJk6lkEB.png
http://picpaste.com/misesmat-JOV2tied.png

see the error (“the breakpoint will not currently be hit. No symbols have been loaded for this document”) in the second link.

8 (edited by johnnyontheweb 01-02-2015 11:28:20)

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

I had the same (unexpected) problem in some VS installation and I solved using USE_LIB=OFF in CMake. Let me know if it helps you; VS will generate an EXE without the DLL file.

Exact CMake entry: USE_SHARED_LIB

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

How can I use USE_LIB=OFF option in Cmake inside window?

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

Use Cmake to re-create the solution and the VS projects. In Cmake, deselect USE_SHARED_LIB and then Configure and Generate.

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

now it's ok!  thank you very much!

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

Hmm.
This is an ideal solution. The shared library is used for things like the python bindings, USE_SHARED_LIB=Off  limits this functionality. It's also in general the way you want to build OOFEM so that it can build multiple targets (like the standalone binary beam01 example)
The USE_SHARED_LIB was intended for a backwards compatibility mode, and it is something I would like to remove in the future.

If someone with Visual Studio can figure out if there is a change we can do to make VS automatically load symbols for the "oofem.dll", then it would be greatly appreciated.

Re: OOFEM-2.3- Problem in debug mode with visual studio 2008

Mikael,
I'm aware that the solution I proposed is temporary and not clean, but for now it's the only one also for me. I'll try to check deeper how to load the DLL debug symbols; in the meanwhile, I don't think it'll be a good idea to remove USE_SHARED_LIB, for 2 reasons:
- the python bindings are not documented yet, and there's not an urgent need to use them for many people;
- having a monolithic exe will help not only for debugging but also to use and debug OOFEM in clusters.