User forums > Using Code::Blocks
undefined reference
MortenMacFly:
--- Quote from: mikethebike on April 12, 2009, 01:21:38 pm ---" You must select a host application to run a library."
--- End quote ---
The host application is the one that loads the DLL you are developing. In your case it's X-Plane. You can setup the host application in the "Project" menu under "Set programs arguments".
BTW: In the case of X-Plane it's best if you run X-Plane separately and not from within C::B. You cannot debug it easily anyways...
mikethebike:
Thanks Morten. In VC I could debug, VC started x-plane. But here not. Even manually starting x-plane does not allow debugging. Am i doing something wrong, F7 ends immediately debug mode. How shall I debug, use CB?
Thanks again Michael
mikethebike:
So CB is broken?
This is what I get:
...
The program is not being run.
Debugger finished with status 0
If debugging is not working the whole IDE is worthless.
MortenMacFly:
--- Quote from: mikethebike on April 12, 2009, 06:14:01 pm ---So CB is broken?
--- End quote ---
No. I am developing an X-Plane plugin myself using C::B - I can tell you: It just works. :-)
Did you compile your DLL correctly - meaning: Does it include debugging information? Did you setup the host application correctly? It's best if you post thew build log (see my sig...).
mikethebike:
Hi Morten
many thanks for your help. Below the build and debugger log:
-------------- Build: Debug in PC-12 ---------------
mingw32-g++.exe -Wall -DIBM=1 -g -DIBM=1 -DIBM=1 -I..\SDL -I..\XPSDK200b2\SDK\CHeaders\XPLM -I..\AdvancedSDKExamples\Projects\Win\SDL\lib -I..\XPSDK200b2\SDK\CHeaders\XPLM -I..\SDL -I..\AdvancedSDKExamples\Projects\Win\SDL\lib -IC:\Users\Michael\Desktop\C++\XPSDK200b2\SDK\CHeaders\XPLM -c C:\Users\Michael\Desktop\C++\PC-12\main.cpp -o obj\Debug\main.o
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:2: warning: ignoring #pragma comment
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:3: warning: ignoring #pragma comment
C:\Users\Michael\Desktop\C++\PC-12\main.cpp: In function `int LoadGLTexture(char*, int)':
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:290: warning: unused variable 'pImageData'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:291: warning: unused variable 'sWidth'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:291: warning: unused variable 'sHeight'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:292: warning: unused variable 'result'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:292: warning: unused variable 'width'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:292: warning: unused variable 'height'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:299: warning: unused variable 'texture_format'
C:\Users\Michael\Desktop\C++\PC-12\main.cpp:300: warning: unused variable 'nOfColors'
mingw32-g++.exe -shared -Wl,--dll -LC:\Users\Michael\Desktop\C++\AdvancedSDKExamples\Projects\Win\SDL\lib -L..\SDL -LC:\Users\Michael\Desktop\C++\AdvancedSDKExamples\Projects\Win\SDL\lib -L..\SDL\lib -L..\SDL -LC:\Users\Michael\Desktop\C++\XPSDK200b2\SDK\CHeaders\XPLM obj\Debug\main.o -o E:\X-Plane\Resources\plugins\PC12.xpl -lmingw32 -lSDLmain -lSDL.dll -luser32 -lgdi32 -lwinmm -ldxguid ..\XPSDK200b2\SDK\Libraries\Win\XPLM.lib ..\AdvancedSDKExamples\Projects\Win\SDL\lib\SDL_image.lib -lopengl32 -lglu32 -lmingw32 -lSDLmain -lSDL.dll -luser32 -lgdi32 -lwinmm -ldxguid ..\XPSDK200b2\SDK\Libraries\Win\XPLM.lib ..\AdvancedSDKExamples\Projects\Win\SDL\lib\SDL_image.lib -lopengl32 -lglu32 "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libmingw32.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL.dll.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSDLmain.a"
Output size is 827.94 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 10 warnings
Debugger:
---------------------
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Users\Michael\Desktop\C++\PC-12\
Adding source dir: C:\Users\Michael\Desktop\C++\PC-12\
Changing directory to: E:/X-Plane
Adding file: X-Plane.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
No symbol table is loaded. Use the "file" command.
No symbol table is loaded. Use the "file" command.
No symbol table is loaded. Use the "file" command.
The program is not being run.
Debugger finished with status 0
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version